]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/model/containerSettings.h
creaButtonContainer: new structure to make easy the button settings
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / creaButtonContainer / model / containerSettings.h
1 /*!
2  * @file containerSettings.h
3  * @brief Contains the ContainerSettings class
4  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
5  * @date  2011-05-24
6  */
7
8 #ifndef BUTTONGROUPSETTINGS_H_
9 #define BUTTONGROUPSETTINGS_H_
10
11 #include <list>
12 #include <map>
13 #include <vector>
14 #include <iostream>
15 #include "structBCSettings.h"
16 #include "system.h"
17 #include "functor.h"
18
19 /*!     @namespace <creaButtonContainer>
20  *      @brief Contains the creaButtonContainer library included in creaMaracasVisu.
21  */
22 namespace creaButtonContainer
23 {
24         /*! @namespace <creaButtonContainer::model>
25          *      @brief Contains the implementation of the model in creaButtonContainer library.
26          *      @see <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC Software Architecture</a>
27          */
28         namespace model
29         {
30                 /*! @class ContainerSettings containerSettings.h "containerSettings.h"
31                  *      @brief This class contains the settings of the button container.
32                  */
33                 class ContainerSettings
34                 {
35                         public:
36                                 //typedef definition
37                                 // ----------------------------------------------------------------------------------
38                                 /*!     @typedef creaButtonContainer::model::BCSettingsStruct BCSettingsStruct;
39                                  *      @brief Defines the BCSettingsStruct type.
40                                  */
41                                 typedef creaButtonContainer::model::BCSettingsStruct BCSettingsStruct;
42                                 // ----------------------------------------------------------------------------------
43                                 /*!     @typedef std::vector< BCPSettingsStruct* > BCStructVectorType;
44                                  *      @brief Defines the BCStructVectorType type.
45                                  */
46                                 typedef std::vector< BCSettingsStruct* > BCStructVectorType;
47                                 // ----------------------------------------------------------------------------------
48                                 //end of typedef definition
49                         public:
50                                 // ----------------------------------------------------------------------------------
51                                 /*! @fn ContainerSettings::ContainerSettings( )
52                                  *      @brief This is the constructor.
53                                  */
54                                 ContainerSettings( );
55                                 // ----------------------------------------------------------------------------------
56                                 /*! @fn virtual ContainerSettings::~ContainerSettings( )
57                                  *      @brief This is the destructor.
58                                  */
59                                 virtual
60                                 ~ContainerSettings( );
61                                 // ----------------------------------------------------------------------------------
62                                 /*! @fn ButtonGroupMap ContainerSettings::GetButtonGroupContainer( )
63                                  *      @brief This method returns a container of buttons ordered by group.
64                                  *      @return ButtonGroupMap A container with buttons
65                                  */
66                                 ButtonGroupMap
67                                 GetButtonGroupContainer( );
68                                 // ----------------------------------------------------------------------------------
69                                 /*! @fn KeyMapList ContainerSettings::GetGroupNameList( )
70                                  *      @brief This method returns a container with the name of the groups.
71                                  *      @return KeyMapList A list with the name of the button groups.
72                                  */
73                                 KeyMapList
74                                 GetGroupNameList( );
75                                 // ----------------------------------------------------------------------------------
76                                 /*! void ContainerSettings::SetButtonGroupContainer( ButtonGroupMap m_ButtonGroupContainer )
77                                  *      @brief This method allows to create the ButtonGroupContainer.
78                                  *      @param bgContainer The ButtonGroupMap with all buttons.
79                                  */
80                                 void
81                                 SetButtonGroupContainer( ButtonGroupMap bgContainer );
82                                 // ----------------------------------------------------------------------------------
83                                 /*! void ContainerSettings::SetGroupNameList( KeyMapList gNameList )
84                                  * @brief This method sets a container with the name of the groups.
85                                  * @param gNameList the KeyMapList with all groupNames.
86                                  */
87                                 void
88                                 SetGroupNameList( KeyMapList gNameList );
89                                 // ----------------------------------------------------------------------------------
90                                 /*!
91                                  * @fn ContainerSettings::AddButton( const std::string & groupName, const std::string buttonName,
92                                  const std::string iconpath, const std::string buttonDescription,
93                                  FunctionEventType event )
94                                  * @brief This method adds a new button to the container.
95                                  * @param groupName The name of the group of buttons.
96                                  * @param buttonName The ID of the button.
97                                  * @param iconpath The path of the button icon.
98                                  * @param buttonDescription The description of the button.
99                                  * @param event The event associated to the button.
100                                  * @see class Functor, ConcreteFunctor for add an event for a button.
101                                  * @exception std::bad_alloc
102                                  */
103                                 void
104                                 AddButton( const std::string & groupName, const std::string buttonName,
105                                     const std::string iconpath, const std::string buttonDescription,
106                                     FunctionEventType event );
107                                 // ----------------------------------------------------------------------------------
108                                 /*! @fn void AddButton( BCSettingsStruct* info );
109                                  *      @brief This method adds a new button to the container.
110                                  *      @exception std::bad_alloc
111                                  *      @param info
112                                  */
113                                 void
114                                 AddButton( BCSettingsStruct* info );
115                                 // ----------------------------------------------------------------------------------
116                                 /*! @fn void AddButtons( BCStructVectorType infoList );
117                                  *      @brief This method adds new buttons to the container.
118                                  *      @exception std::bad_alloc
119                                  *      @param infoList
120                                  */
121                                 void
122                                 AddButtons( BCStructVectorType infoList );
123                                 // ----------------------------------------------------------------------------------
124                         private:
125                                 ButtonGroupMap m_ButtonGroupContainer; //! <std::map< std::string, ButtonList > View pointer.
126                                 KeyMapList m_GroupNameList; //! <ButtonContainerPanel View pointer.
127                 };
128         }
129 }
130
131 #endif /* BUTTONGROUPSETTINGS_H_ */