|
UniWidgets
1.0.0
|
00001 #ifndef _QUEUELOGIC_H 00002 #define _QUEUELOGIC_H 00003 // ------------------------------------------------------------------------- 00004 #include <gtkmm.h> 00005 #include <gdkmm.h> 00006 #include <objects/AbstractLogic.h> 00007 #include <uniwidgets/SBlinker.h> 00008 #include <uniwidgets/USignals.h> 00009 #include <uniwidgets/ConfirmSignal.h> 00010 #include <global_macros.h> 00011 // ------------------------------------------------------------------------- 00012 namespace UniWidgets 00013 { 00014 00015 struct Indinfo 00016 { 00017 bool is_show_; 00018 bool blinking_; 00019 /*"1" - high level 00020 "0" - low level*/ 00021 int type_; 00022 }; 00032 class QueueLogic : public AbstractLogic 00033 { 00034 public: 00035 QueueLogic(); 00036 explicit QueueLogic(Gtk::EventBox::BaseObjectType* gobject); 00037 ~QueueLogic() {} 00038 00039 /*Types*/ 00040 typedef std::map<long , std::vector<Indinfo*>, std::greater<long> > Modes; 00042 virtual void stop_blink(){}; 00043 virtual void start_blink(){}; 00044 virtual void set_state(bool newstate_){}; 00045 virtual bool is_blinking(){return false;} 00046 virtual void set_mode(long mode) = 0; 00047 virtual long get_state_obj() = 0; 00048 void confirm(long mode, int type); 00049 void on_set_mode(const long mode, const int type,bool blink=true); 00050 void off_set_mode(const long mode, const int type); 00051 bool is_show(const long mode, const int type); 00052 bool is_blinking_mode(const long mode, const int type); 00053 protected: 00054 /* Methods */ 00055 virtual void on_init(){}; 00056 long current_mode_; 00057 private: 00058 /* Variables */ 00059 Modes on_modes_; 00060 int current_type_; 00062 /* Methods */ 00063 long get_max_mode(); 00064 Indinfo* set_info(bool show, bool blink,int type); 00065 Indinfo* find_type(const long mode, const int type); 00066 void erase_mode(const long mode, const int type); 00068 void constructor(); 00069 DISALLOW_COPY_AND_ASSIGN(QueueLogic); 00070 }; 00071 00072 } 00073 #endif
1.7.6.1