|
UniWidgets
1.2.0
|
00001 #ifndef _SHOWLOGIC_H 00002 #define _SHOWLOGIC_H 00003 // ------------------------------------------------------------------------- 00004 #include <UniSetTypes.h> 00005 #include <objects/AbstractLogic.h> 00006 #include <global_macros.h> 00007 #include <USignals.h> 00008 // ------------------------------------------------------------------------- 00009 namespace UniWidgets 00010 { 00024 class SimpleView; 00025 class ShowLogic : public AbstractLogic 00026 { 00027 public: 00028 ShowLogic(); 00029 explicit ShowLogic(Gtk::EventBox::BaseObjectType* gobject); 00030 virtual ~ShowLogic(); 00031 00032 /* Public methods */ 00033 virtual bool show_state( const long mode, bool blink = true ); 00034 virtual void hide_state( const long mode); 00035 virtual void confirm_handler(const long mode); 00036 virtual long get_state_obj(); 00037 inline void noconfirm_insert(const long mode) 00038 { 00039 if( std::find(noconfirms.begin(), noconfirms.end(), mode) == noconfirms.end() ) 00040 { 00041 noconfirms.push_back(mode); 00042 } 00043 } 00044 00045 inline bool is_noconfirm(const long mode) 00046 { 00047 if( std::find(noconfirms.begin(), noconfirms.end(), mode) != noconfirms.end() ) 00048 { 00049 return true; 00050 } 00051 return false; 00052 } 00053 00054 protected: 00055 /* Methods */ 00056 virtual void on_init(); 00058 /* Variables */ 00059 std::vector<SimpleView*> states_; 00060 SimpleView* current_state_; 00061 bool is_initialize_; 00062 bool is_glade; 00063 std::vector<long> noconfirms; 00064 void configure_noconfirm(); 00065 00066 /* Methods */ 00067 void constructor(); 00068 virtual void init_states(); 00070 virtual long mode_to_priority(const long mode); 00071 virtual bool is_priority_higher(const long new_priority); 00072 virtual void set_state(const long mode,bool blink); 00073 SimpleView* mode_to_state(const long mode); 00074 long get_mode_in_max_priority(); 00075 DISALLOW_COPY_AND_ASSIGN(ShowLogic); 00076 00077 ADD_PROPERTY( view_type,long ) 00078 ADD_PROPERTY( noconfirm, Glib::ustring ) 00080 }; 00081 00082 } 00083 00084 #endif
1.7.6.1