]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/creaPanelButtonContainer/buttonContainerSettings.h
creaButtonContainer: new structure to make easy the button settings
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / creaPanelButtonContainer / buttonContainerSettings.h
1 /*!
2  * @file buttonContainerSettings.h
3  * @brief This contains the ButtonContainerSettings class.
4  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
5  * @date  2011-05-24
6  */
7
8 #ifndef BUTTONCONTAINERSETTINGS_H_
9 #define BUTTONCONTAINERSETTINGS_H_
10
11 #include <list>
12 #include <map>
13 #include <wx/panel.h>
14 #include <vector>
15
16 #include "structBCPSettings.h"
17 #include "containerSettings.h"
18 #include "functor.h"
19
20 /*!     @namespace <creaPanelButtonContainer>
21  *      @brief Contains the creaPanelButtonContainer library included in creaMaracasVisu.
22  */
23 namespace creaPanelButtonContainer
24 {
25         /*! @class ButtonContainerSettings buttonContainerSettings.h "buttonContainerSettings.h"
26          *      @brief This class contains the settings of the buttons.
27          */
28         class ButtonContainerSettings
29         {
30                 public:
31                         //typedef definition.
32                         /*!     typedef creaButtonContainer::model::TFunctor TFunctor;
33                          *      @brief Defines the TFunctor type.
34                          */
35                         typedef creaButtonContainer::model::TFunctor TFunctor;
36                         // ----------------------------------------------------------------------------------
37                         /*!     @typedef creaButtonContainer::model::ContainerSettings ButtonGroupSettings;
38                          *      @brief Defines the ButtonGroupSettings type.
39                          */
40                         typedef creaButtonContainer::model::ContainerSettings ButtonGroupSettings;
41                         // ----------------------------------------------------------------------------------
42                         /*!     @typedef wxPanel* PanelButton;
43                          *      @brief Defines the PanelButton type.
44                          */
45                         typedef wxPanel* PanelButton;
46                         // ----------------------------------------------------------------------------------
47                         /*!     @typedef std::pair< std::string, PanelButton > ActionButton;
48                          *      @brief Defines the ActionButton type.
49                          *      First is the button description, Second FunctionEventType
50                          */
51                         typedef std::pair< std::string, PanelButton > ActionButton;
52                         // ----------------------------------------------------------------------------------
53                         /*!     @typedef std::pair< std::string, std::string > ButtonInfo;
54                          *      @brief Defines the ButtonInfo type.
55                          *      First is the ButtonName, Second is the ImageIconPath
56                          */
57                         typedef std::pair< std::string, std::string > ButtonInfo;
58                         // ----------------------------------------------------------------------------------
59                         /*!     @typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair;
60                          *      @brief Defines the ButtonPair type.
61                          */
62                         typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair;
63                         // ----------------------------------------------------------------------------------
64                         /*!     @typedef std::list< std::string > KeyMapList;
65                          *      @brief Defines the KeyMapList type.
66                          */
67                         typedef std::list< std::string > KeyMapList;
68                         // ----------------------------------------------------------------------------------
69                         /*!     @typedef std::list< ButtonPair* > ButtonList;
70                          *      @brief Defines the ButtonList type.
71                          */
72                         typedef std::list< ButtonPair* > ButtonList;
73                         // ----------------------------------------------------------------------------------
74                         /*!     @typedef std::map< std::string, ButtonList > ButtonGroupMap;
75                          *      @brief Defines the ButtonGroupMap type.
76                          */
77                         typedef std::map< std::string, ButtonList > ButtonGroupMap;
78                         // ----------------------------------------------------------------------------------
79                         /*!     @typedef std::vector< BCPSettingsStruct* > BCStructVectorType;
80                          *      @brief Defines the BCStructVectorType type.
81                          */
82                         typedef std::vector< BCPSettingsStruct* > BCStructVectorType;
83                         //end typedef definition
84                         // ----------------------------------------------------------------------------------
85                         /*! @class ButtonContainerSettings buttonContainerSettings.h "buttonContainerSettings.h"
86                          *      @brief This class contains the settings of the button container.
87                          */
88                 public:
89                         // ----------------------------------------------------------------------------------
90                         /*! @fn ButtonContainerSettings( );
91                          *      @brief This is the default constructor.
92                          */
93                         ButtonContainerSettings( );
94                         // ----------------------------------------------------------------------------------
95                         /*! @fn virtual ~ButtonContainerSettings( );
96                          *      @brief This is the destructor.
97                          */
98                         virtual
99                         ~ButtonContainerSettings( );
100                         // ----------------------------------------------------------------------------------
101                         /*! @fn ButtonGroupMap GetButtonGroupContainer( );
102                          *      @brief This method returns ButtonGroupMap with all buttons.
103                          * @return
104                          */
105                         ButtonGroupMap
106                         GetButtonGroupContainer( );
107                         // ----------------------------------------------------------------------------------
108                         /*! @fn KeyMapList GetGroupNameList( );
109                          *      @brief This method returns a KeyMapsList with the name of the groups.
110                          * @return
111                          */
112                         KeyMapList
113                         GetGroupNameList( );
114                         // ----------------------------------------------------------------------------------
115                         /*! @fn PanelButton GetPanelButton( const std::string &buttonName );
116                          *      @brief This method returns the panel of a button.
117                          *      @param buttonName
118                          *      @exception std::bad_alloc
119                          *      @return
120                          */
121                         PanelButton
122                         GetPanelButton( const std::string &buttonName );
123                         // ----------------------------------------------------------------------------------
124                         /*! @fn ButtonGroupSettings* GetButtonGroupSettings( TFunctor* functor );
125                          *      @brief this method return the settings the generic settings for creaButtonContainer.
126                          * @param functor
127                          * @exception std::bad_alloc
128                          * @return
129                          */
130                         ButtonGroupSettings*
131                         GetButtonGroupSettings( TFunctor* functor );
132                         // ----------------------------------------------------------------------------------
133                         /*! @fn void SetButtonGroupContainer( ButtonGroupMap bGroupContainer );
134                          *      @brief This method sets the button group container.
135                          * @param bGroupContainer
136                          */
137                         void
138                         SetButtonGroupContainer( ButtonGroupMap bGroupContainer );
139                         // ----------------------------------------------------------------------------------
140                         /*! @fn void SetGroupNameList( KeyMapList gNameList );
141                          *      @brief this method sets the groupName list
142                          * @param gNameList
143                          */
144                         void
145                         SetGroupNameList( KeyMapList gNameList );
146                         // ----------------------------------------------------------------------------------
147                         /*! @fn void AddButton( const std::string &groupName, const std::string &buttonName,
148                          const std::string &iconpath, const std::string &buttonDescription,
149                          PanelButton panel );
150                          * @brief This method adds a new button into a group of buttons.
151                          * @param groupName
152                          * @param buttonName
153                          * @param iconpath
154                          * @param buttonDescription
155                          * @param panel
156                          * @exception std::bad_alloc
157                          */
158                         void
159                         AddButton( const std::string &groupName, const std::string &buttonName,
160                             const std::string &iconpath, const std::string &buttonDescription,
161                             PanelButton panel );
162                         // ----------------------------------------------------------------------------------
163                         /*! @fn void AddButton( BCPSettingsStruct* info );
164                          * @brief This method adds a new button into a group of buttons.
165                          * @param info
166                          * @exception std::bad_alloc
167                          */
168                         void
169                         AddButton( BCPSettingsStruct* info );
170                         // ----------------------------------------------------------------------------------
171                         /*! @fn void AddButtons( BCStructVectorType infoList );
172                          * @brief This method adds new buttons into the container.
173                          * @param infoList
174                          * @exception std::bad_alloc
175                          */
176                         void
177                         AddButtons( BCStructVectorType infoList );
178                         // ----------------------------------------------------------------------------------
179                 private:
180                         ButtonGroupMap m_ButtonGroupContainer; //!<This is the map with the groups of buttons.
181                         KeyMapList m_GroupNameList; //!<This is a container with the name of the groups.
182         };
183 }//ecapseman
184 #endif /* BUTTONCONTAINERSETTINGS_H_ */