00001 #ifndef __ZOOMATTR_H
00002 #define __ZOOMATTR_H
00003
00004 #include "xmlserializeable.h"
00005
00016 class ZoomAttr : public XMLSerializeable {
00017 public:
00018 typedef enum {
00019 FIXED,
00020 SCALE,
00021 FREE,
00022 WHOLE
00023 } ZoomType;
00024
00025 double factor;
00026 ZoomType type;
00027 double min;
00028 double max;
00029
00030 virtual bool toXML( QDomDocument &doc,
00031 QDomElement &elem,
00032 std::string id = "" ) {
00033 QDomElement base;
00034 base = createBaseTag( doc, elem, id, "ZoomAttr" );
00035
00036 writeDoubleTag( doc, base, "Factor", factor );
00037 writeIntTag( doc, base, "Type", type );
00038 writeDoubleTag( doc, base, "Min", min );
00039 writeDoubleTag( doc, base, "Max", max );
00040 return true;
00041 }
00042
00043 virtual bool fromXML( QDomElement &elem ) {
00044 if ( std::string( "ZoomAttr" ).compare( (const char*)elem.tagName() ) )
00045 return false;
00046
00047 factor = readDoubleTag( elem, "Factor" );
00048 type = (ZoomType)readIntTag( elem, "Type" );
00049 min = readDoubleTag( elem, "Min" );
00050 max = readDoubleTag( elem, "Max" );
00051 return true;
00052 }
00053 };
00054
00055 #endif
00056
00057
00058
00059