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