00001 #ifndef MYTHUI_CHECKBOX_H_ 00002 #define MYTHUI_CHECKBOX_H_ 00003 00004 // MythUI headers 00005 #include "mythuitype.h" 00006 #include "mythuistatetype.h" 00007 00015 class MUI_PUBLIC MythUICheckBox : public MythUIType 00016 { 00017 Q_OBJECT 00018 00019 public: 00020 MythUICheckBox(MythUIType *parent, const QString &name); 00021 ~MythUICheckBox(); 00022 00023 enum StateType { None = 0, Normal, Disabled, Active, Selected, 00024 SelectedInactive }; 00025 00026 virtual bool gestureEvent(MythGestureEvent *event); 00027 virtual bool keyPressEvent(QKeyEvent *); 00028 00029 void toggleCheckState(void); 00030 00031 void SetCheckState(MythUIStateType::StateType state); 00032 void SetCheckState(bool onoff); 00033 00034 MythUIStateType::StateType GetCheckState() const; 00035 bool GetBooleanCheckState(void) const; 00036 00037 protected slots: 00038 void Select(); 00039 void Deselect(); 00040 void Enable(); 00041 void Disable(); 00042 00043 signals: 00044 void valueChanged(); 00045 void toggled(bool); 00046 00047 protected: 00048 virtual void CopyFrom(MythUIType *base); 00049 virtual void CreateCopy(MythUIType *parent); 00050 virtual void Finalize(void); 00051 00052 void SetInitialStates(void); 00053 00054 MythUIStateType *m_BackgroundState; 00055 MythUIStateType *m_CheckState; 00056 00057 MythUIStateType::StateType m_currentCheckState; 00058 QString m_state; 00059 }; 00060 00061 #endif
1.6.3