00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 #ifndef _ucolor_hpp_
00022 #define _ucolor_hpp_
00023 
00024 #include <ubit/uprop.hpp>
00025 namespace ubit {
00026 
00027 class  UColorImpl;
00028 
00029 
00040 class UColor : public UProp {
00041 public:
00042   UBIT_ATTR_CLASS(UColor, UProp)
00043 
00044   
00045   static UColor none, inherit, white, black, grey, lightgrey, darkgrey, 
00046     navy, lightblue, blue, red, green, yellow, orange, wheat, teal, disabled;
00047   
00048   UColor();
00049   UColor(const UColor&);
00050   UColor(int r, int g, int b);
00051   UColor(const char* color_spec);
00052   UColor(const UStr& color_spec);
00059   friend UColor& ucolor(const UColor& c) {return *new UColor(c);}
00060   friend UColor& ucolor(int r, int g, int b) {return *new UColor(r,g,b);}
00061   friend UColor& ucolor(const char* c)   {return *new UColor(c);}
00062   friend UColor& ucolor(const UStr& c)   {return *new UColor(c);}
00064 
00065   ~UColor();
00066 
00067   UColor& operator=(const UColor& c) {set(c); return *this;}
00068   virtual void set(const UColor&);
00069   virtual void set(int r, int g, int b);
00070   virtual void set(const char* color_spec);
00071   virtual void set(const UStr& color_spec);
00073 
00074   bool operator==(const UColor& c) const {return equals(c);}
00075   bool operator!=(const UColor& c) const {return !equals(c);}
00076   virtual bool equals(const UColor&) const;
00077 
00078   
00079 
00080   virtual void update();
00082 
00083   bool realize(UDisp*);
00090 #ifndef NO_DOC
00091   UColor(const UColor&, UMask);
00092   UColor(UColorImpl*, UMask); 
00093   UColorImpl& getImpl() const {return *ci;}
00094   virtual void putProp(UContext*, UControl*);
00095 protected:
00096   uptr<UColorImpl> ci;
00097 #endif
00098 };
00099 
00100 }
00101 #endif
00102 
00103 
00104