00001 #include "imagestate.h"
00002
00003 bool ImageState::toXML( QDomDocument &doc,
00004 QDomElement &elem,
00005 std::string id ) {
00006 QDomElement base = doc.createElement( "ImageState" );
00007 if ( id != "" )
00008 base.setAttribute( "id", (char*)id.c_str() );
00009 elem.appendChild( base );
00010
00011 writeIntTag( doc, base, "Color", mColor );
00012 writeIntTag( doc, base, "Red", mRed );
00013 writeIntTag( doc, base, "Green", mGreen );
00014 writeIntTag( doc, base, "Blue", mBlue );
00015 writeTextTag( doc, base, "FileName", mFileName );
00016 writeIntTag( doc, base, "Type", mType );
00017 return true;
00018 }
00019
00020 bool ImageState::fromXML( QDomElement &elem ) {
00021 if ( elem.isNull() )
00022 return false;
00023
00024 if ( std::string( "ImageState" ).compare( (const char*)elem.tagName() ) )
00025 return false;
00026
00027 mColor = readIntTag( elem, "Color" );
00028 mRed = readIntTag( elem, "Red" );
00029 mGreen = readIntTag( elem, "Green" );
00030 mBlue = readIntTag( elem, "Blue" );
00031 mFileName = readTextTag( elem, "FileName" );
00032 mType = readIntTag( elem, "Type" );
00033 return true;
00034 }
00035
00036