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_
37 #include <wx/bitmap.h>
44 #include "structBCPSettings.h"
45 #include "containerSettings.h"
48 /*! @namespace <creaPanelButtonContainer>
49 * @brief Contains the creaPanelButtonContainer library included in creaMaracasVisu.
51 namespace creaPanelButtonContainer
53 /*! @class ButtonContainerSettings buttonContainerSettings.h "buttonContainerSettings.h"
54 * @brief This class contains the settings of the buttons.
56 class ButtonContainerSettings
60 // ----------------------------------------------------------------------------------
61 /*! @typedef std::string* StringType;
62 * @brief Defines the StringType type.
64 typedef std::string StringType;
65 // ----------------------------------------------------------------------------------
66 /*! typedef creaButtonContainer::model::TFunctor TFunctor;
67 * @brief Defines the TFunctor type.
69 typedef creaButtonContainer::model::TFunctor TFunctor;
70 // ----------------------------------------------------------------------------------
71 /*! @typedef creaButtonContainer::model::ContainerSettings ButtonGroupSettings;
72 * @brief Defines the ButtonGroupSettings type.
74 typedef creaButtonContainer::model::ContainerSettings ButtonGroupSettings;
75 // ----------------------------------------------------------------------------------
76 /*! @typedef wxPanel* PanelButton;
77 * @brief Defines the PanelButton type.
79 typedef wxPanel* PanelButton;
80 // ----------------------------------------------------------------------------------
81 /*! @typedef std::pair< std::string, PanelButton > ActionButton;
82 * @brief Defines the ActionButton type.
83 * First is the button description, Second FunctionEventType
85 typedef std::pair< std::string, PanelButton > ActionButton;
87 // ----------------------------------------------------------------------------------
88 /*! @typedef std::pair< std::string, wxBitmap > ButtonInfo;
89 * @brief Defines the ButtonInfo type.
90 * First is the ButtonName, Second is the ImageIcon
92 typedef std::pair< std::string, wxBitmap > ButtonInfo;
94 // ----------------------------------------------------------------------------------
95 /*! @typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair;
96 * @brief Defines the ButtonPair type.
98 typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair;
99 // ----------------------------------------------------------------------------------
100 /*! @typedef std::list< std::string > KeyMapList;
101 * @brief Defines the KeyMapList type.
103 typedef std::list< std::string > KeyMapList;
105 // ----------------------------------------------------------------------------------
106 /*! @typedef std::list< ButtonPair* > ButtonList;
107 * @brief Defines the ButtonList type.
109 typedef std::list< ButtonPair* > ButtonList;
111 // ----------------------------------------------------------------------------------
112 /*! @typedef std::map< std::string, ButtonList > ButtonGroupMap;
113 * @brief Defines the ButtonGroupMap type.
115 typedef std::map< std::string, ButtonList > ButtonGroupMap;
116 // ----------------------------------------------------------------------------------
117 /*! @typedef std::vector< BCPSettingsStruct* > BCStructVectorType;
118 * @brief Defines the BCStructVectorType type.
120 typedef std::vector< BCPSettingsStruct* > BCStructVectorType;
121 //end typedef definition
122 // ----------------------------------------------------------------------------------
123 /*! @class ButtonContainerSettings buttonContainerSettings.h "buttonContainerSettings.h"
124 * @brief This class contains the settings of the button container.
127 // ----------------------------------------------------------------------------------
128 /*! @fn ButtonContainerSettings( );
129 * @brief This is the default constructor.
131 ButtonContainerSettings( );
132 // ----------------------------------------------------------------------------------
133 /*! @fn virtual ~ButtonContainerSettings( );
134 * @brief This is the destructor.
137 ~ButtonContainerSettings( );
139 // ----------------------------------------------------------------------------------
140 /*! @fn ButtonGroupMap GetButtonGroupContainer( );
141 * @brief This method returns ButtonGroupMap with all buttons.
145 GetButtonGroupContainer( );
146 // ----------------------------------------------------------------------------------
147 /*! @fn KeyMapList GetGroupNameList( );
148 * @brief This method returns a KeyMapsList with the name of the groups.
153 // ----------------------------------------------------------------------------------
154 /*! @fn PanelButton GetPanelButton( const std::string &buttonName );
155 * @brief This method returns the panel of a button.
157 * @exception std::bad_alloc
161 GetPanelButton( const std::string &buttonName );
162 // ----------------------------------------------------------------------------------
163 /*! @fn ButtonGroupSettings* GetButtonGroupSettings( TFunctor* functor );
164 * @brief this method return the settings the generic settings for creaButtonContainer.
165 * @param functor The function to be called in the action button.
166 * @exception std::bad_alloc
170 GetButtonGroupSettings( TFunctor* functor );
171 // ----------------------------------------------------------------------------------
172 /*! @fn void SetButtonGroupContainer( ButtonGroupMap bGroupContainer );
173 * @brief This method sets the button group container.
174 * @param bGroupContainer
177 SetButtonGroupContainer( ButtonGroupMap bGroupContainer );
178 // ----------------------------------------------------------------------------------
179 /*! @fn void SetGroupNameList( KeyMapList gNameList );
180 * @brief this method sets the groupName list
184 SetGroupNameList( KeyMapList gNameList );
186 // ----------------------------------------------------------------------------------
187 /*! @fn void AddButton( const std::string &groupName, const std::string &buttonName,
188 const std::string &iconpath, const std::string &buttonDescription,
190 * @brief This method adds a new button into a group of buttons.
191 * @param groupName The button groupName
192 * @param buttonName The buttonName
193 * @param iconpath The path of the icon
194 * @param buttonDescription The button tooltip
195 * @param panel The panel to be called when the button is clicked
196 * @exception std::bad_alloc
199 AddButton( const std::string &groupName, const std::string &buttonName,
200 const wxBitmap &icon, const std::string &buttonDescription,
203 // ----------------------------------------------------------------------------------
204 /*! @fn void AddButton( BCPSettingsStruct* info );
205 * @brief This method adds a new button into a group of buttons.
206 * @param info The pointer to BCPSettingsStruct.
207 * @exception std::bad_alloc
210 AddButton( BCPSettingsStruct* info );
212 // ----------------------------------------------------------------------------------
213 /*! @fn void AddButtons( BCStructVectorType infoList );
214 * @brief This method adds new buttons into the container.
215 * @param infoList The BCStructVectorType
216 * @exception std::bad_alloc
219 AddButtons( BCStructVectorType infoList );
220 // ----------------------------------------------------------------------------------
222 ButtonGroupMap m_ButtonGroupContainer; //!<This is the map with the groups of buttons.
223 KeyMapList m_GroupNameList; //!<This is a container with the name of the groups.
226 #endif /* BUTTONCONTAINERSETTINGS_H_ */