]> Creatis software - creaMaracasVisu.git/blob
ef4819635b46eef281d65ff30cbd3c55e728fff5
[creaMaracasVisu.git] /
1 /*# ---------------------------------------------------------------------
2 #
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
4 #                        pour la Sant�)
5 # Authors : Eduardo Davila, Frederic Cervenansky, Claire Mouton
6 # Previous Authors : Laurent Guigues, Jean-Pierre Roux
7 # CreaTools website : www.creatis.insa-lyon.fr/site/fr/creatools_accueil
8 #
9 #  This software is governed by the CeCILL-B license under French law and
10 #  abiding by the rules of distribution of free software. You can  use,
11 #  modify and/ or redistribute the software under the terms of the CeCILL-B
12 #  license as circulated by CEA, CNRS and INRIA at the following URL
13 #  http://www.cecill.info/licences/Licence_CeCILL-B_V1-en.html
14 #  or in the file LICENSE.txt.
15 #
16 #  As a counterpart to the access to the source code and  rights to copy,
17 #  modify and redistribute granted by the license, users are provided only
18 #  with a limited warranty  and the software's author,  the holder of the
19 #  economic rights,  and the successive licensors  have only  limited
20 #  liability.
21 #
22 #  The fact that you are presently reading this means that you have had
23 #  knowledge of the CeCILL-B license and that you accept its terms.
24 # ------------------------------------------------------------------------ */
25
26 /*!
27  * @file buttonContainerSettings.h
28  * @brief This contains the ButtonContainerSettings class.
29  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
30  * @date  2011-06-02
31  */
32
33 #ifndef BUTTONCONTAINERSETTINGS_H_
34 #define BUTTONCONTAINERSETTINGS_H_
35
36 #include <wx/panel.h>
37
38 #include <list>
39 #include <map>
40 #include <vector>
41 #include <iostream>
42
43 #include "structBCPSettings.h"
44 #include "containerSettings.h"
45 #include "functor.h"
46
47 /*!     @namespace <creaPanelButtonContainer>
48  *      @brief Contains the creaPanelButtonContainer library included in creaMaracasVisu.
49  */
50 namespace creaPanelButtonContainer
51 {
52         /*! @class ButtonContainerSettings buttonContainerSettings.h "buttonContainerSettings.h"
53          *      @brief This class contains the settings of the buttons.
54          */
55         class ButtonContainerSettings
56         {
57                 public:
58                         //typedef definition.
59                         // ----------------------------------------------------------------------------------
60                         /*!     @typedef std::string* StringType;
61                          *      @brief Defines the StringType type.
62                          */
63                         typedef std::string StringType;
64                         // ----------------------------------------------------------------------------------
65                         /*!     typedef creaButtonContainer::model::TFunctor TFunctor;
66                          *      @brief Defines the TFunctor type.
67                          */
68                         typedef creaButtonContainer::model::TFunctor TFunctor;
69                         // ----------------------------------------------------------------------------------
70                         /*!     @typedef creaButtonContainer::model::ContainerSettings ButtonGroupSettings;
71                          *      @brief Defines the ButtonGroupSettings type.
72                          */
73                         typedef creaButtonContainer::model::ContainerSettings ButtonGroupSettings;
74                         // ----------------------------------------------------------------------------------
75                         /*!     @typedef wxPanel* PanelButton;
76                          *      @brief Defines the PanelButton type.
77                          */
78                         typedef wxPanel* PanelButton;
79                         // ----------------------------------------------------------------------------------
80                         /*!     @typedef std::pair< std::string, PanelButton > ActionButton;
81                          *      @brief Defines the ActionButton type.
82                          *      First is the button description, Second FunctionEventType
83                          */
84                         typedef std::pair< std::string, PanelButton > ActionButton;
85                         // ----------------------------------------------------------------------------------
86                         /*!     @typedef std::pair< std::string, std::string > ButtonInfo;
87                          *      @brief Defines the ButtonInfo type.
88                          *      First is the ButtonName, Second is the ImageIconPath
89                          */
90                         typedef std::pair< std::string, std::string > ButtonInfo;
91                         // ----------------------------------------------------------------------------------
92                         /*!     @typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair;
93                          *      @brief Defines the ButtonPair type.
94                          */
95                         typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair;
96                         // ----------------------------------------------------------------------------------
97                         /*!     @typedef std::list< std::string > KeyMapList;
98                          *      @brief Defines the KeyMapList type.
99                          */
100                         typedef std::list< std::string > KeyMapList;
101                         // ----------------------------------------------------------------------------------
102                         /*!     @typedef std::list< ButtonPair* > ButtonList;
103                          *      @brief Defines the ButtonList type.
104                          */
105                         typedef std::list< ButtonPair* > ButtonList;
106                         // ----------------------------------------------------------------------------------
107                         /*!     @typedef std::map< std::string, ButtonList > ButtonGroupMap;
108                          *      @brief Defines the ButtonGroupMap type.
109                          */
110                         typedef std::map< std::string, ButtonList > ButtonGroupMap;
111                         // ----------------------------------------------------------------------------------
112                         /*!     @typedef std::vector< BCPSettingsStruct* > BCStructVectorType;
113                          *      @brief Defines the BCStructVectorType type.
114                          */
115                         typedef std::vector< BCPSettingsStruct* > BCStructVectorType;
116                         //end typedef definition
117                         // ----------------------------------------------------------------------------------
118                         /*! @class ButtonContainerSettings buttonContainerSettings.h "buttonContainerSettings.h"
119                          *      @brief This class contains the settings of the button container.
120                          */
121                 public:
122                         // ----------------------------------------------------------------------------------
123                         /*! @fn ButtonContainerSettings( );
124                          *      @brief This is the default constructor.
125                          */
126                         ButtonContainerSettings( );
127                         // ----------------------------------------------------------------------------------
128                         /*! @fn virtual ~ButtonContainerSettings( );
129                          *      @brief This is the destructor.
130                          */
131                         virtual
132                         ~ButtonContainerSettings( );
133                         // ----------------------------------------------------------------------------------
134                         /*! @fn ButtonGroupMap GetButtonGroupContainer( );
135                          *      @brief This method returns ButtonGroupMap with all buttons.
136                          * @return
137                          */
138                         ButtonGroupMap
139                         GetButtonGroupContainer( );
140                         // ----------------------------------------------------------------------------------
141                         /*! @fn KeyMapList GetGroupNameList( );
142                          *      @brief This method returns a KeyMapsList with the name of the groups.
143                          * @return
144                          */
145                         KeyMapList
146                         GetGroupNameList( );
147                         // ----------------------------------------------------------------------------------
148                         /*! @fn PanelButton GetPanelButton( const std::string &buttonName );
149                          *      @brief This method returns the panel of a button.
150                          *      @param buttonName
151                          *      @exception std::bad_alloc
152                          *      @return
153                          */
154                         PanelButton
155                         GetPanelButton( const std::string &buttonName );
156                         // ----------------------------------------------------------------------------------
157                         /*! @fn ButtonGroupSettings* GetButtonGroupSettings( TFunctor* functor );
158                          *      @brief this method return the settings the generic settings for creaButtonContainer.
159                          * @param functor The function to be called in the action button.
160                          * @exception std::bad_alloc
161                          * @return
162                          */
163                         ButtonGroupSettings*
164                         GetButtonGroupSettings( TFunctor* functor );
165                         // ----------------------------------------------------------------------------------
166                         /*! @fn void SetButtonGroupContainer( ButtonGroupMap bGroupContainer );
167                          *      @brief This method sets the button group container.
168                          * @param bGroupContainer
169                          */
170                         void
171                         SetButtonGroupContainer( ButtonGroupMap bGroupContainer );
172                         // ----------------------------------------------------------------------------------
173                         /*! @fn void SetGroupNameList( KeyMapList gNameList );
174                          *      @brief this method sets the groupName list
175                          * @param gNameList
176                          */
177                         void
178                         SetGroupNameList( KeyMapList gNameList );
179                         // ----------------------------------------------------------------------------------
180                         /*! @fn void AddButton( const std::string &groupName, const std::string &buttonName,
181                          const std::string &iconpath, const std::string &buttonDescription,
182                          PanelButton panel );
183                          * @brief This method adds a new button into a group of buttons.
184                          * @param groupName The button groupName
185                          * @param buttonName The buttonName
186                          * @param iconpath The path of the icon
187                          * @param buttonDescription The button tooltip
188                          * @param panel The panel to be called when the button is clicked
189                          * @exception std::bad_alloc
190                          */
191                         void
192                         AddButton( const std::string &groupName, const std::string &buttonName,
193                             const std::string &iconpath, const std::string &buttonDescription,
194                             PanelButton panel );
195                         // ----------------------------------------------------------------------------------
196                         /*! @fn void AddButton( BCPSettingsStruct* info );
197                          * @brief This method adds a new button into a group of buttons.
198                          * @param info The pointer to BCPSettingsStruct.
199                          * @exception std::bad_alloc
200                          */
201                         void
202                         AddButton( BCPSettingsStruct* info );
203                         // ----------------------------------------------------------------------------------
204                         /*! @fn void AddButtons( BCStructVectorType infoList );
205                          * @brief This method adds new buttons into the container.
206                          * @param infoList The BCStructVectorType
207                          * @exception std::bad_alloc
208                          */
209                         void
210                         AddButtons( BCStructVectorType infoList );
211                         // ----------------------------------------------------------------------------------
212                 private:
213                         ButtonGroupMap m_ButtonGroupContainer; //!<This is the map with the groups of buttons.
214                         KeyMapList m_GroupNameList; //!<This is a container with the name of the groups.
215         };
216 }//ecapseman
217 #endif /* BUTTONCONTAINERSETTINGS_H_ */