1 /*# ---------------------------------------------------------------------
3 # Copyright (c) CREATIS (Centre de Recherche en Acquisition et Traitement de l'Image
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
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.
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
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 # ------------------------------------------------------------------------ */
27 * @file buttonContainerSettings.h
28 * @brief This contains the ButtonContainerSettings class.
29 * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
33 #ifndef BUTTONCONTAINERSETTINGS_H_
34 #define BUTTONCONTAINERSETTINGS_H_
43 #include "structBCPSettings.h"
44 #include "containerSettings.h"
47 /*! @namespace <creaPanelButtonContainer>
48 * @brief Contains the creaPanelButtonContainer library included in creaMaracasVisu.
50 namespace creaPanelButtonContainer
52 /*! @class ButtonContainerSettings buttonContainerSettings.h "buttonContainerSettings.h"
53 * @brief This class contains the settings of the buttons.
55 class ButtonContainerSettings
59 // ----------------------------------------------------------------------------------
60 /*! @typedef std::string* StringType;
61 * @brief Defines the StringType type.
63 typedef std::string StringType;
64 // ----------------------------------------------------------------------------------
65 /*! typedef creaButtonContainer::model::TFunctor TFunctor;
66 * @brief Defines the TFunctor type.
68 typedef creaButtonContainer::model::TFunctor TFunctor;
69 // ----------------------------------------------------------------------------------
70 /*! @typedef creaButtonContainer::model::ContainerSettings ButtonGroupSettings;
71 * @brief Defines the ButtonGroupSettings type.
73 typedef creaButtonContainer::model::ContainerSettings ButtonGroupSettings;
74 // ----------------------------------------------------------------------------------
75 /*! @typedef wxPanel* PanelButton;
76 * @brief Defines the PanelButton type.
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
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
90 typedef std::pair< std::string, std::string > ButtonInfo;
91 // ----------------------------------------------------------------------------------
92 /*! @typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair;
93 * @brief Defines the ButtonPair type.
95 typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair;
96 // ----------------------------------------------------------------------------------
97 /*! @typedef std::list< std::string > KeyMapList;
98 * @brief Defines the KeyMapList type.
100 typedef std::list< std::string > KeyMapList;
101 // ----------------------------------------------------------------------------------
102 /*! @typedef std::list< ButtonPair* > ButtonList;
103 * @brief Defines the ButtonList type.
105 typedef std::list< ButtonPair* > ButtonList;
106 // ----------------------------------------------------------------------------------
107 /*! @typedef std::map< std::string, ButtonList > ButtonGroupMap;
108 * @brief Defines the ButtonGroupMap type.
110 typedef std::map< std::string, ButtonList > ButtonGroupMap;
111 // ----------------------------------------------------------------------------------
112 /*! @typedef std::vector< BCPSettingsStruct* > BCStructVectorType;
113 * @brief Defines the BCStructVectorType type.
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.
122 // ----------------------------------------------------------------------------------
123 /*! @fn ButtonContainerSettings( );
124 * @brief This is the default constructor.
126 ButtonContainerSettings( );
127 // ----------------------------------------------------------------------------------
128 /*! @fn virtual ~ButtonContainerSettings( );
129 * @brief This is the destructor.
132 ~ButtonContainerSettings( );
133 // ----------------------------------------------------------------------------------
134 /*! @fn ButtonGroupMap GetButtonGroupContainer( );
135 * @brief This method returns ButtonGroupMap with all buttons.
139 GetButtonGroupContainer( );
140 // ----------------------------------------------------------------------------------
141 /*! @fn KeyMapList GetGroupNameList( );
142 * @brief This method returns a KeyMapsList with the name of the groups.
147 // ----------------------------------------------------------------------------------
148 /*! @fn PanelButton GetPanelButton( const std::string &buttonName );
149 * @brief This method returns the panel of a button.
151 * @exception std::bad_alloc
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
164 GetButtonGroupSettings( TFunctor* functor );
165 // ----------------------------------------------------------------------------------
166 /*! @fn void SetButtonGroupContainer( ButtonGroupMap bGroupContainer );
167 * @brief This method sets the button group container.
168 * @param bGroupContainer
171 SetButtonGroupContainer( ButtonGroupMap bGroupContainer );
172 // ----------------------------------------------------------------------------------
173 /*! @fn void SetGroupNameList( KeyMapList gNameList );
174 * @brief this method sets the groupName list
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,
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
192 AddButton( const std::string &groupName, const std::string &buttonName,
193 const std::string &iconpath, const std::string &buttonDescription,
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
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
210 AddButtons( BCStructVectorType infoList );
211 // ----------------------------------------------------------------------------------
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.
217 #endif /* BUTTONCONTAINERSETTINGS_H_ */