2 * @file buttonContainerSettings.h
3 * @brief This contains the ButtonContainerSettings class.
4 * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
8 #ifndef BUTTONCONTAINERSETTINGS_H_
9 #define BUTTONCONTAINERSETTINGS_H_
18 #include "structBCPSettings.h"
19 #include "containerSettings.h"
22 /*! @namespace <creaPanelButtonContainer>
23 * @brief Contains the creaPanelButtonContainer library included in creaMaracasVisu.
25 namespace creaPanelButtonContainer
27 /*! @class ButtonContainerSettings buttonContainerSettings.h "buttonContainerSettings.h"
28 * @brief This class contains the settings of the buttons.
30 class ButtonContainerSettings
34 // ----------------------------------------------------------------------------------
35 /*! @typedef std::string* StringType;
36 * @brief Defines the StringType type.
38 typedef std::string StringType;
39 // ----------------------------------------------------------------------------------
40 /*! typedef creaButtonContainer::model::TFunctor TFunctor;
41 * @brief Defines the TFunctor type.
43 typedef creaButtonContainer::model::TFunctor TFunctor;
44 // ----------------------------------------------------------------------------------
45 /*! @typedef creaButtonContainer::model::ContainerSettings ButtonGroupSettings;
46 * @brief Defines the ButtonGroupSettings type.
48 typedef creaButtonContainer::model::ContainerSettings ButtonGroupSettings;
49 // ----------------------------------------------------------------------------------
50 /*! @typedef wxPanel* PanelButton;
51 * @brief Defines the PanelButton type.
53 typedef wxPanel* PanelButton;
54 // ----------------------------------------------------------------------------------
55 /*! @typedef std::pair< std::string, PanelButton > ActionButton;
56 * @brief Defines the ActionButton type.
57 * First is the button description, Second FunctionEventType
59 typedef std::pair< std::string, PanelButton > ActionButton;
60 // ----------------------------------------------------------------------------------
61 /*! @typedef std::pair< std::string, std::string > ButtonInfo;
62 * @brief Defines the ButtonInfo type.
63 * First is the ButtonName, Second is the ImageIconPath
65 typedef std::pair< std::string, std::string > ButtonInfo;
66 // ----------------------------------------------------------------------------------
67 /*! @typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair;
68 * @brief Defines the ButtonPair type.
70 typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair;
71 // ----------------------------------------------------------------------------------
72 /*! @typedef std::list< std::string > KeyMapList;
73 * @brief Defines the KeyMapList type.
75 typedef std::list< std::string > KeyMapList;
76 // ----------------------------------------------------------------------------------
77 /*! @typedef std::list< ButtonPair* > ButtonList;
78 * @brief Defines the ButtonList type.
80 typedef std::list< ButtonPair* > ButtonList;
81 // ----------------------------------------------------------------------------------
82 /*! @typedef std::map< std::string, ButtonList > ButtonGroupMap;
83 * @brief Defines the ButtonGroupMap type.
85 typedef std::map< std::string, ButtonList > ButtonGroupMap;
86 // ----------------------------------------------------------------------------------
87 /*! @typedef std::vector< BCPSettingsStruct* > BCStructVectorType;
88 * @brief Defines the BCStructVectorType type.
90 typedef std::vector< BCPSettingsStruct* > BCStructVectorType;
91 //end typedef definition
92 // ----------------------------------------------------------------------------------
93 /*! @class ButtonContainerSettings buttonContainerSettings.h "buttonContainerSettings.h"
94 * @brief This class contains the settings of the button container.
97 // ----------------------------------------------------------------------------------
98 /*! @fn ButtonContainerSettings( );
99 * @brief This is the default constructor.
101 ButtonContainerSettings( );
102 // ----------------------------------------------------------------------------------
103 /*! @fn virtual ~ButtonContainerSettings( );
104 * @brief This is the destructor.
107 ~ButtonContainerSettings( );
108 // ----------------------------------------------------------------------------------
109 /*! @fn ButtonGroupMap GetButtonGroupContainer( );
110 * @brief This method returns ButtonGroupMap with all buttons.
114 GetButtonGroupContainer( );
115 // ----------------------------------------------------------------------------------
116 /*! @fn KeyMapList GetGroupNameList( );
117 * @brief This method returns a KeyMapsList with the name of the groups.
122 // ----------------------------------------------------------------------------------
123 /*! @fn PanelButton GetPanelButton( const std::string &buttonName );
124 * @brief This method returns the panel of a button.
126 * @exception std::bad_alloc
130 GetPanelButton( const std::string &buttonName );
131 // ----------------------------------------------------------------------------------
132 /*! @fn ButtonGroupSettings* GetButtonGroupSettings( TFunctor* functor );
133 * @brief this method return the settings the generic settings for creaButtonContainer.
134 * @param functor The function to be called in the action button.
135 * @exception std::bad_alloc
139 GetButtonGroupSettings( TFunctor* functor );
140 // ----------------------------------------------------------------------------------
141 /*! @fn void SetButtonGroupContainer( ButtonGroupMap bGroupContainer );
142 * @brief This method sets the button group container.
143 * @param bGroupContainer
146 SetButtonGroupContainer( ButtonGroupMap bGroupContainer );
147 // ----------------------------------------------------------------------------------
148 /*! @fn void SetGroupNameList( KeyMapList gNameList );
149 * @brief this method sets the groupName list
153 SetGroupNameList( KeyMapList gNameList );
154 // ----------------------------------------------------------------------------------
155 /*! @fn void AddButton( const std::string &groupName, const std::string &buttonName,
156 const std::string &iconpath, const std::string &buttonDescription,
158 * @brief This method adds a new button into a group of buttons.
159 * @param groupName The button groupName
160 * @param buttonName The buttonName
161 * @param iconpath The path of the icon
162 * @param buttonDescription The button tooltip
163 * @param panel The panel to be called when the button is clicked
164 * @exception std::bad_alloc
167 AddButton( const std::string &groupName, const std::string &buttonName,
168 const std::string &iconpath, const std::string &buttonDescription,
170 // ----------------------------------------------------------------------------------
171 /*! @fn void AddButton( BCPSettingsStruct* info );
172 * @brief This method adds a new button into a group of buttons.
173 * @param info The pointer to BCPSettingsStruct.
174 * @exception std::bad_alloc
177 AddButton( BCPSettingsStruct* info );
178 // ----------------------------------------------------------------------------------
179 /*! @fn void AddButtons( BCStructVectorType infoList );
180 * @brief This method adds new buttons into the container.
181 * @param infoList The BCStructVectorType
182 * @exception std::bad_alloc
185 AddButtons( BCStructVectorType infoList );
186 // ----------------------------------------------------------------------------------
188 ButtonGroupMap m_ButtonGroupContainer; //!<This is the map with the groups of buttons.
189 KeyMapList m_GroupNameList; //!<This is a container with the name of the groups.
192 #endif /* BUTTONCONTAINERSETTINGS_H_ */