html/size.hh

00001 /* -*- mode: c++; c-basic-offset: 4; -*- */
00002 #ifndef HTML_SIZE_HH
00003 #define HTML_SIZE_HH
00004 
00005 #include "html/Attrib.hh"
00006 #include <string>
00007 
00008 namespace html {
00009     class writer;
00010 
00017     class size : public attrib {
00018     public:
00023         size(int Size=0);
00024 
00028         ~size(void);
00029 
00034         size* clone(void) const;
00035 
00040         bool isDefault(void) const;
00041 
00046         void putAttr(writer& w) const;
00047 
00051         void setDefault(void);
00052 
00057         void setRelative(int delta);
00058 
00063         void setSize(int Size);
00064 
00070         bool operator==(const size& x) const;
00071 
00072     private:
00073         enum {kDefault, kPoints, kDelta} mType;
00074         int mSize;
00075     };
00076 }
00077 
00078 inline bool
00079 html::size::operator==(const size& x) const {
00080     return (mType == x.mType) && (mType == kDefault || mSize == x.mSize);
00081 }
00082 
00083 #endif //  HTML_SIZE_HH

Generated on Sun Mar 8 19:20:48 2009 for dmt by  doxygen 1.5.4