UniWidgets  1.0.0
TypicalText.h
00001 #ifndef _TYPICALTEXT_H
00002 #define _TYPICALTEXT_H
00003 // -------------------------------------------------------------------------
00004 #include <map>
00005 #include <typical/AbstractTypical.h>
00006 #include <objects/StateLogic.h>
00007 #include <objects/ShowLogic.h>
00008 #include <components/Text.h>
00009 #include <uniwidgets/USignals.h>
00010 #include <global_macros.h>
00011 // -------------------------------------------------------------------------
00012 namespace UniWidgets
00013 {
00014 class Text;
00019 struct text_prop{
00020     long mode;          
00021     long priority;          
00022     Glib::ustring text;     
00023     Glib::ustring fname;        
00024     long fsize;         
00025     Gdk::Color color_on;        
00026     Gdk::Color color_off;       
00027     bool bstate;            
00028     bool shadow;            
00029     Pango::Alignment al;        
00030 };
00040 class TypicalText : public AbstractTypical
00041 {
00042 public:
00043     TypicalText();
00044     explicit TypicalText(AbstractTypical::BaseObjectType* gobject);
00045     virtual ~TypicalText();
00046 
00047     /* FIXME: Move this types to private or into include/types.h */
00048     /* Types */
00049     typedef std::map<long, text_prop*> ModeTextMap;             
00050     typedef std::pair<long, text_prop*> ModeTextPair;           
00052     /* Methods */
00053     void configure();                           
00055     void set_rect(Gdk::Rectangle* rect);
00056     void set_textlogic_state_ai(const UniSetTypes::ObjectId sensor);    
00057     void set_node(const UniSetTypes::ObjectId node);            
00058     void set_textlogic_mode(const long);                    
00059     void set_textlogic_detntr(const long);                  
00060     void set_invert_mode(const bool state);                 
00061     void set_state_obj(const UniSetTypes::ObjectId sensor);         
00062     virtual void set_lock_view(const bool lock);                
00064     void add_mode_text(text_prop *);                    
00066     Gdk::Rectangle* get_rect();
00067 
00068     /* Variables */
00069     std::vector<Text *> texts_;                 
00071 private:
00072     /* Variables */
00073     void constructor();
00074     Gdk::Rectangle* rect_;
00075     ShowLogic showlogic_;
00076     StateLogic statelogic_;
00077     ModeTextMap t_modes_;
00078 
00079     /* Methods */
00080     void create_texts(long int num_state = 1);
00081 
00082     DISALLOW_COPY_AND_ASSIGN(TypicalText);
00083 };
00084 
00085 }
00086 #endif