TypicalTwoState.h
00001 #ifndef _TYPICALTWOSTATE_H
00002 #define _TYPICALTWOSTATE_H
00003
00004 #include <map>
00005 #include <typical/AbstractTypical.h>
00006 #include <objects/StateLogic.h>
00007 #include <objects/ShowLogic.h>
00008 #include <components/Image.h>
00009 #include <USignals.h>
00010 #include <global_macros.h>
00011
00012 namespace UniWidgets
00013 {
00025 class TypicalTwoState : public AbstractTypical
00026 {
00027 public:
00028 TypicalTwoState();
00029 explicit TypicalTwoState(AbstractTypical::BaseObjectType* gobject);
00030 virtual ~TypicalTwoState();
00031
00032
00033
00034 typedef std::map<long, Image*> ModeImageMap;
00035 typedef std::pair<long, Image*> ModeImagePair;
00036 typedef std::map<long, Glib::ustring > ModePathMap;
00037 typedef std::pair<long, Glib::ustring > ModePathPair;
00039
00040 void configure();
00042 void set_rect(const Gdk::Rectangle rect);
00043 void set_path(const long mode, const Glib::ustring& path);
00044 void set_path2(const long mode, const Glib::ustring& path);
00045 void set_state_ai_high(const UniSetTypes::ObjectId sensor);
00046 void set_state_obj(const UniSetTypes::ObjectId sensor);
00047 void set_node_high(const UniSetTypes::ObjectId node);
00048 void set_mode_state_high(const long mode);
00049 void set_state_ai_low(const UniSetTypes::ObjectId sensor);
00050 void set_node_low(const UniSetTypes::ObjectId node);
00051 void set_mode_state_low(const long mode);
00052 void set_state_blink_low(bool state);
00053 void set_state_blink_high(bool state);
00054 virtual void set_lock_view(const bool lock);
00055 void insert_mode(const long mode, const long priority, const long blink);
00057 Glib::ustring get_path(const long mode, bool is_back = false);
00059 Gdk::Rectangle* get_rect();
00061 private:
00062
00063 Gdk::Rectangle rect_;
00064 ShowLogic showlogic_;
00065 StateLogic statelogic_high_;
00066 StateLogic statelogic_low_;
00067 ModeImageMap images_;
00068 ModePathMap paths_;
00069 ModePathMap paths_2;
00070
00071
00072 void constructor();
00073
00074 DISALLOW_COPY_AND_ASSIGN(TypicalTwoState);
00075 };
00076
00077 }
00078 #endif