]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/containerSettings.h
#2647 creaMaracasVisu Feature New Normal - Merge creaButtonContainer BRANCH
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / creaButtonContainer / model / containerSettings.h
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 containerSettings.h
28  * @brief Contains the ContainerSettings class
29  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
30  * @date  2011-06-02
31  */
32
33 #ifndef BUTTONGROUPSETTINGS_H_
34 #define BUTTONGROUPSETTINGS_H_
35
36 #include <vector>
37 #include <wx/bitmap.h>
38
39 #include "structBCSettings.h"
40 #include "system.h"
41
42 /*!     @namespace <creaButtonContainer>
43  *      @brief Contains the creaButtonContainer library included in creaMaracasVisu.
44  */
45
46
47 namespace creaButtonContainer
48 {
49         /*! @namespace <creaButtonContainer::model>
50          *      @brief Contains the implementation of the model in creaButtonContainer library.
51          *      @see <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC Software Architecture</a>
52          */
53         namespace model
54         {
55                 /*! @class ContainerSettings containerSettings.h "containerSettings.h"
56                  *      @brief This class contains the settings of the button container.
57                  */
58                 class ContainerSettings
59                 {
60                         public:
61                                 //typedef definition
62                                 // ----------------------------------------------------------------------------------
63                                 /*!     @typedef creaButtonContainer::model::BCSettingsStruct BCSettingsStruct;
64                                  *      @brief Defines the BCSettingsStruct type.
65                                  */
66                                 typedef creaButtonContainer::model::BCSettingsStruct BCSettingsStruct;
67                                 // ----------------------------------------------------------------------------------
68                                 /*!     @typedef std::vector< BCPSettingsStruct* > BCStructVectorType;
69                                  *      @brief Defines the BCStructVectorType type.
70                                  */
71                                 typedef std::vector< BCSettingsStruct* > BCStructVectorType;
72                                 // ----------------------------------------------------------------------------------
73                                 //end of typedef definition
74                         public:
75                                 // ----------------------------------------------------------------------------------
76                                 /*! @fn ContainerSettings::ContainerSettings( )
77                                  *      @brief This is the constructor.
78                                  */
79                                 ContainerSettings( );
80                                 // ----------------------------------------------------------------------------------
81                                 /*! @fn virtual ContainerSettings::~ContainerSettings( )
82                                  *      @brief This is the destructor.
83                                  */
84                                 virtual
85                                 ~ContainerSettings( );
86                                 
87                                 // ----------------------------------------------------------------------------------
88                                 /*! @fn ButtonGroupMap ContainerSettings::GetButtonGroupContainer( )
89                                  *      @brief This method returns a container of buttons ordered by group.
90                                  *      @return ButtonGroupMap A container with buttons
91                                  */
92                                 ButtonGroupMap
93                                 GetButtonGroupContainer( );
94                                 // ----------------------------------------------------------------------------------
95                                 /*! @fn KeyMapList ContainerSettings::GetGroupNameList( )
96                                  *      @brief This method returns a container with the name of the groups.
97                                  *      @return KeyMapList A list with the name of the button groups.
98                                  */
99                                 KeyMapList
100                                 GetGroupNameList( );
101                                 
102                                 // ----------------------------------------------------------------------------------
103                                 /*! void ContainerSettings::SetButtonGroupContainer( ButtonGroupMap m_ButtonGroupContainer )
104                                  *      @brief This method allows to create the ButtonGroupContainer.
105                                  *      @param bgContainer The ButtonGroupMap with all buttons.
106                                  */
107                                 void
108                                 SetButtonGroupContainer( ButtonGroupMap bgContainer );
109
110
111                                 // ----------------------------------------------------------------------------------
112                                 /*! void ContainerSettings::SetGroupNameList( KeyMapList gNameList )
113                                  * @brief This method sets a container with the name of the groups.
114                                  * @param gNameList the KeyMapList with all groupNames.
115                                  */
116                                 void
117                                 SetGroupNameList( KeyMapList gNameList );
118                                 
119
120                                 // ----------------------------------------------------------------------------------
121                                 /*!
122                                  * @fn ContainerSettings::AddButton( const std::string & groupName, const std::string buttonName,
123                                  const std::string iconpath, const std::string buttonDescription,
124                                  FunctionEventType event )
125                                  * @brief This method adds a new button to the container.
126                                  * @param groupName The name of the group of buttons.
127                                  * @param buttonName The ID of the button.
128                                  * @param iconpath The path of the button icon.
129                                  * @param buttonDescription The description of the button.
130                                  * @param event The event associated to the button.
131                                  * @see class Functor, ConcreteFunctor for add an event for a button.
132                                  * @exception std::bad_alloc
133                                  */
134                                 void
135                                 AddButton( const StringType & groupName, const StringType &buttonName,
136                                     const wxBitmap &icon, const StringType &buttonDescription,
137                                     FunctionEventType event );
138                                 // ----------------------------------------------------------------------------------
139                                 /*! @fn void AddButton( BCSettingsStruct* info );
140                                  *      @brief This method adds a new button to the container using the
141                                  *      BCSettingsStruct structure.
142                                  *      @exception std::bad_alloc
143                                  *      @param info
144                                  */
145                                 void
146                                 AddButton( BCSettingsStruct* info );
147                                 // ----------------------------------------------------------------------------------
148                                 /*! @fn void AddButtons( BCStructVectorType infoList );
149                                  *      @brief This method adds new buttons to the container.
150                                  *      @exception std::bad_alloc
151                                  *      @param infoList
152                                  */
153                                 void
154                                 AddButtons( BCStructVectorType infoList );
155
156                                 // ----------------------------------------------------------------------------------
157                                 // ----------------------------------------------------------------------------------
158                         private:
159                                 ButtonGroupMap m_ButtonGroupContainer; //! <The container with the group of buttons.
160                                 KeyMapList m_GroupNameList; //! <The container with the name of the groups of buttons.
161
162                 };
163         }
164 }
165
166 #endif /* BUTTONGROUPSETTINGS_H_ */