00001 00020 #ifndef INC_MGUI_HOTKEYSET_H 00021 #define INC_MGUI_HOTKEYSET_H 00022 00023 #ifndef INC_MGUI_KEYCODE_H 00024 #include <mgui/keycode.h> 00025 #endif 00026 00027 #ifndef INC_MGUI_KEYSTATE_H 00028 #include <mgui/keystate.h> 00029 #endif 00030 00031 #ifndef INC_MI32_MILIST_H 00032 #include <mi32/milist.h> 00033 #endif 00034 00035 namespace MGUI { 00036 00037 class HOTKEYSET { 00038 public: 00039 typedef FastDelegate<void(KEYCODE, KEYSTATE, const POINT&)> DELEGATE; 00040 00042 HOTKEYSET (); 00043 00045 HOTKEYSET ( 00046 const HOTKEYSET& rhs 00047 ); 00048 00050 ~HOTKEYSET (); 00051 00053 HOTKEYSET& operator= ( 00054 const HOTKEYSET& rhs 00055 ); 00056 00059 bool Add ( 00060 KEYCODE KeyCode, 00061 DELEGATE HotKeyDelegate, 00062 KEYSTATE KeyState = KEYSTATE_None 00063 ); 00064 00067 bool Add ( 00068 const HOTKEYSET& HotKeySet 00069 ); 00070 00073 bool CallDelegate ( 00074 KEYCODE KeyCode, 00075 KEYSTATE KeyState, 00076 const POINT& Point 00077 ) const; 00078 00081 bool IsEmpty ( 00082 ) const { return (m_HotKeyItemList.IsEmpty()); } 00083 00086 bool Remove ( 00087 KEYCODE KeyCode, 00088 DELEGATE HotKeyDelegate, 00089 KEYSTATE KeyState = KEYSTATE_None 00090 ); 00091 00094 bool Remove ( 00095 const HOTKEYSET& HotKeySet 00096 ); 00097 00098 private: 00099 #ifndef GENERATING_DOXYGEN_OUTPUT 00100 struct ITEM { 00101 KEYCODE m_KeyCode; 00102 KEYSTATE m_KeyState; 00103 DELEGATE m_HotKeyDelegate; 00104 }; 00105 00106 MILIST<ITEM> m_HotKeyItemList; 00107 #endif 00108 }; 00109 00110 //===================================================================================================================== 00111 00112 } // End namespace MGUI 00113 00114 #endif // INC_MGUI_HOTKEYSET_H
1.6.1