UniWidgets  1.0.0
ShowLogic.h
00001 #ifndef _SHOWLOGIC_H
00002 #define _SHOWLOGIC_H
00003 // -------------------------------------------------------------------------
00004 #include <objects/AbstractLogic.h>
00005 #include <UniSetTypes.h>
00006 #include <global_macros.h>
00007 #include <uniwidgets/USignals.h>
00008 #include <components/Image.h>
00009 #include <components/SimpleText.h>
00010 // -------------------------------------------------------------------------
00011 namespace UniWidgets
00012 {
00020 template <typename T>
00021 class ShowLogic : public AbstractLogic
00022 {
00023 public:
00024     ShowLogic();
00025     explicit ShowLogic(Gtk::EventBox::BaseObjectType* gobject);
00026     virtual ~ShowLogic();
00027 
00028     /* Public methods */
00029     virtual bool show_state( const long mode, bool blink = true );  
00030     virtual void hide_state( const long mode);          
00031     virtual void confirm_handler(const long mode);          
00032     virtual long get_state_obj();                   
00034 protected:
00035     /* Methods */
00036     virtual void on_init();                     
00038     /* Variables */
00039     std::vector<T*> states_;                    
00040     T* current_state_;                      
00041   bool is_initialize_;
00042 
00043     /* Methods */
00044     void constructor();
00045     virtual void init_states();                 
00047     virtual long mode_to_priority(const long mode);         
00048     virtual bool is_priority_higher(const long new_priority);   
00049     virtual void set_state(const long mode,bool blink);     
00050     T* mode_to_state(const long mode);              
00051     long get_mode_in_max_priority();                
00052     DISALLOW_COPY_AND_ASSIGN(ShowLogic<T>);
00053 };
00054 
00055 }
00056 
00057 #endif