Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef EV_TOOLBAR_ACTIONS_H
00023 #define EV_TOOLBAR_ACTIONS_H
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038 #include "ut_types.h"
00039 #include "xap_Types.h"
00040 #include "xav_Listener.h"
00041
00042 class XAP_App;
00043 class AV_View;
00044 class EV_Toolbar_Label;
00045
00046
00047
00048
00049 typedef enum _ev_Toolbar_ItemState
00050 {
00051 EV_TIS_ZERO = 0x00,
00052 EV_TIS_Gray = 0x01,
00053 EV_TIS_Toggled = 0x02,
00054 EV_TIS_UseString = 0x04,
00055 EV_TIS_Hidden = 0x08
00056
00057 } EV_Toolbar_ItemState;
00058
00059 typedef EV_Toolbar_ItemState ( EV_GetToolbarItemState_Fn )(AV_View * pAV_View, XAP_Toolbar_Id id, const char ** pszState);
00060 typedef EV_Toolbar_ItemState (*EV_GetToolbarItemState_pFn)(AV_View * pAV_View, XAP_Toolbar_Id id, const char ** pszState);
00061 #ifdef ABI_DLL
00062 #define Defun_EV_GetToolbarItemState_Fn(fn) EV_Toolbar_ItemState fn(AV_View * pAV_View, XAP_Toolbar_Id id, const char ** pszState)
00063 #else
00064 #define Defun_EV_GetToolbarItemState_Fn(fn) ABI_EXPORT EV_Toolbar_ItemState fn(AV_View * pAV_View, XAP_Toolbar_Id id, const char ** pszState)
00065 #endif
00066
00067 #define EV_TIS_ShouldBeGray(tis) (((tis) & EV_TIS_Gray)!=0)
00068 #define EV_TIS_ShouldBeHidden(tis) (((tis) & EV_TIS_Hidden)!=0)
00069 #define EV_TIS_ShouldBeToggled(tis) (((tis) & EV_TIS_Toggled)!=0)
00070 #define EV_TIS_ShouldUseString(tis) (((tis) & EV_TIS_UseString)!=0)
00071
00072
00073
00074 typedef enum _ev_Toolbar_ItemType
00075 {
00076 EV_TBIT_BOGUS = 0,
00077 EV_TBIT_PushButton = 1,
00078 EV_TBIT_ToggleButton = 2,
00079 EV_TBIT_GroupButton = 3,
00080 EV_TBIT_EditText = 4,
00081 EV_TBIT_DropDown = 5,
00082 EV_TBIT_ComboBox = 6,
00083 EV_TBIT_StaticLabel = 7,
00084 EV_TBIT_Spacer = 8,
00085 EV_TBIT_ColorFore = 9,
00086 EV_TBIT_ColorBack = 10,
00087 EV_TBIT_MenuButton = 11
00088
00089 } EV_Toolbar_ItemType;
00090
00091
00092
00093 class ABI_EXPORT EV_Toolbar_Action
00094 {
00095 public:
00096 EV_Toolbar_Action(XAP_Toolbar_Id id,
00097 EV_Toolbar_ItemType type,
00098 const char * szMethodName,
00099 AV_ChangeMask maskOfInterest,
00100 EV_GetToolbarItemState_pFn pfnGetState);
00101 ~EV_Toolbar_Action(void);
00102
00103 XAP_Toolbar_Id getToolbarId(void) const;
00104 EV_Toolbar_ItemType getItemType(void) const;
00105 const char * getMethodName(void) const;
00106 AV_ChangeMask getChangeMaskOfInterest(void) const;
00107 EV_Toolbar_ItemState getToolbarItemState(AV_View * pView, const char ** pszState) const;
00108
00109 protected:
00110 XAP_Toolbar_Id m_id;
00111 EV_Toolbar_ItemType m_type;
00112 char * m_szMethodName;
00113
00114 AV_ChangeMask m_maskOfInterest;
00115 EV_GetToolbarItemState_pFn m_pfnGetState;
00116 };
00117
00118
00119
00120 class ABI_EXPORT EV_Toolbar_ActionSet
00121 {
00122 public:
00123 EV_Toolbar_ActionSet(XAP_Toolbar_Id first, XAP_Toolbar_Id last);
00124 ~EV_Toolbar_ActionSet(void);
00125
00126 bool setAction(XAP_Toolbar_Id id,
00127 EV_Toolbar_ItemType type,
00128 const char * szMethodName,
00129 AV_ChangeMask maskOfInterest,
00130 EV_GetToolbarItemState_pFn pfnGetState);
00131 EV_Toolbar_Action * getAction(XAP_Toolbar_Id id) const;
00132
00133 protected:
00134 EV_Toolbar_Action ** m_actionTable;
00135 XAP_Toolbar_Id m_first;
00136 XAP_Toolbar_Id m_last;
00137 };
00138
00139 #endif