00001 #ifndef HTML_COLOR_HH
00002 #define HTML_COLOR_HH
00003
00004 #include "html/Attrib.hh"
00005 #include <string>
00006
00007 namespace html {
00008 class writer;
00009
00010
00017 class color : public attrib {
00018 public:
00023 color(void);
00024
00032 color(int red, int green, int blue);
00033
00039 color(const std::string& clr);
00040
00044 ~color(void);
00045
00050 color* clone(void) const;
00051
00055 bool isDefault(void) const;
00056
00061 void putAttr(writer& w) const;
00062
00066 void setDefault(void);
00067
00074 void setRGB(int red, int green, int blue);
00075
00080 void setColorName(const std::string& name);
00081
00087 bool operator==(const color& x) const;
00088
00089 private:
00090 enum ColorMode {
00091 k_default,
00092 k_rgb,
00093 k_named
00094 };
00095
00096 private:
00097 ColorMode mMode;
00098 int mRed;
00099 int mGreen;
00100 int mBlue;
00101 std::string mName;
00102 };
00103
00104 }
00105
00106 #endif // HTML_COLOR_HH