]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/buttonContainerPanel.h
Support #1768 CREATIS Licence insertion
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / creaButtonContainer / view / buttonContainerPanel.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 buttonContainerController.h
28  * @brief This contains the ButtonContainerController class
29  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
30  * @date  2011-06-02
31  */
32
33 #ifndef BUTTONCONTAINERPANEL_H
34 #define BUTTONCONTAINERPANEL_H
35
36 #include <wx/scrolwin.h>
37 #include <wx/button.h>
38 #include <wx/sizer.h>
39
40 #include <list>
41 #include <map>
42 #include <exception>
43
44 #include "buttonGroup.h"
45 #include "groupManager.h"
46 #include "buttonGroupFactory.h"
47 #include "containerSettings.h"
48 #include "buttonContainerController.h"
49
50 /*!     @namespace <creaButtonContainer>
51  *      @brief Contains the creaButtonContainer library included in creaMaracasVisu.
52  */
53 namespace creaButtonContainer
54 {
55         /*!     @namespace<creaButtonContainer::controller>
56          *      @brief Contains the implementation of the controller in creaButtonContainer library.
57          *      @see <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC Software Architecture</a>
58          */
59         namespace controller
60         {
61                 /*! @class ButtonContainerController buttonContainerController.h "buttonContainerController.h"
62                  *      @brief This class contains the ButtonContainerPanel controller.
63                  *  @details This class describes the button events, it derives from wxEvtHandler.
64                  *  @see <a href="http://docs.wxwidgets.org/stable/wx_wxevthandler.html">wxEvtHandler</a>
65                  */
66                 class ButtonContainerController;
67         }
68
69         /*! @namespace <creaButtonContainer::view>
70          *      @brief Contains the implementation of the view in creaButtonContainer library.
71          *      @see <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC Software Architecture</a>
72          */
73         namespace view
74         {
75                 /*! @class ButtonContainerPanel buttonContainerPanel.h "buttonContainerPanel.h"
76                  *  @brief This class is the container of the creaButtonContainer.
77                  *  @details This class derives from wxScrolledWindow and manages the view of the buttonContainer.
78                  *  @bug The scrolled it doesn't work! (to be changed soon)
79                  *  @see <a href="http://docs.wxwidgets.org/stable/wx_wxscrolledwindow.html">wxScrolledWindow</a>
80                  */
81                 class ButtonContainerPanel : public wxScrolledWindow
82                 {
83                         public:
84                                 //typedef definition
85                                 // ----------------------------------------------------------------------------------
86                                 /*!     @typedef creaButtonContainer::view::ButtonGroup ButtonGroup;
87                                  *      @brief Defines the ButtonGroup type.
88                                  */
89                                 typedef creaButtonContainer::view::ButtonGroup ButtonGroup;
90                                 // ----------------------------------------------------------------------------------
91                                 /*!     @typedef creaButtonContainer::view::GroupManager GroupManager;
92                                  *      @brief Defines the GroupManager type.
93                                  */
94                                 typedef creaButtonContainer::view::GroupManager GroupManager;
95                                 // ----------------------------------------------------------------------------------
96                                 /*!     @typedef std::list< ButtonGroup* > ButtonGroupList;
97                                  *      @brief Defines the ButtonGroupList type.
98                                  */
99                                 typedef std::list< ButtonGroup* > ButtonGroupList;
100                                 // ----------------------------------------------------------------------------------
101                                 /*!     @typedef std::map< long, GroupManager* > GroupManagerList;
102                                  *      @brief Defines the GroupManagerList type.
103                                  */
104                                 typedef std::map< long, GroupManager* > GroupManagerList;
105                                 // ----------------------------------------------------------------------------------
106                                 /*!     @typedef wxFlexGridSizer Sizer;
107                                  *      @brief Defines the Sizer type.
108                                  */
109                                 typedef wxFlexGridSizer Sizer;
110                                 // ----------------------------------------------------------------------------------
111                                 /*!     @typedef std::list< long > KeyList;
112                                  *      @brief Defines the KeyList type.
113                                  */
114                                 typedef std::list< long > KeyList;
115                                 // ----------------------------------------------------------------------------------
116                                 /*!     @typedef creaButtonContainer::model::ContainerSettings ButtonGroupSettings;
117                                  *      @brief Defines the ButtonGroupSettings type.
118                                  */
119                                 typedef creaButtonContainer::model::ContainerSettings
120                                     ButtonGroupSettings;
121                                 // ----------------------------------------------------------------------------------
122                                 /*!     @typedef creaButtonContainer::model::ButtonGroupFactory ButtonGroupFactory;
123                                  *      @brief Defines the ButtonGroupFactory type.
124                                  */
125                                 typedef creaButtonContainer::model::ButtonGroupFactory
126                                     ButtonGroupFactory;
127                                 // ----------------------------------------------------------------------------------
128                                 /*!     creaButtonContainer::controller::ButtonContainerController BCController;
129                                  *      @brief Defines the BCController type.
130                                  */
131                                 typedef creaButtonContainer::controller::ButtonContainerController
132                                     BCController;
133                                 // ----------------------------------------------------------------------------------
134                                 //end of typedef definition
135                         public:
136                                 /*! @fn ButtonContainerPanel( wxWindow* parent, ButtonGroupSettings* settings );
137                                  * @brief This is the parameterized constructor.
138                                  * @param parent wxWindow pointer to parent.
139                                  * @param settings ButtonGroupSettings Pointer to button container settings.
140                                  */
141                                 ButtonContainerPanel( wxWindow* parent, ButtonGroupSettings* settings );
142                                 // ----------------------------------------------------------------------------------
143                                 /*! @fn ~ButtonContainerPanel( );
144                                  * @brief This is the destructor.
145                                  */
146                                 virtual
147                                 ~ButtonContainerPanel( );
148                                 // ----------------------------------------------------------------------------------
149                                 /*! @fn SetGroupContainer( ButtonGroupList groupContainer );
150                                  * @brief This method sets the settings to the container.
151                                  * @param groupContainer
152                                  */
153                                 void
154                                 SetGroupContainer( ButtonGroupList groupContainer );
155                                 // ----------------------------------------------------------------------------------
156                                 /*! @fn PanelInit( );
157                                  *      This method initializes the panel.
158                                  *      @exception std::bad_alloc
159                                  */
160                                 void
161                                 PanelInit( );
162                                 // ----------------------------------------------------------------------------------
163                                 /*! @fn FitSizer( );
164                                  * This method fits and organizes the sizer.
165                                  */
166                                 void
167                                 FitSizer( );
168                                 // ----------------------------------------------------------------------------------
169                         public:
170                                 friend class creaButtonContainer::controller::ButtonContainerController;
171                         private:
172                                 GroupManagerList m_GroupManagerList; //!<The container of managers.
173                                 ButtonGroupList m_ButtonGroupList; //!<The list of button groups.
174                                 BCController* m_ButtonCController; //!<Pontier to controller.
175                                 Sizer* m_Sizer; //!<Pointer to wxSizer
176                         DECLARE_EVENT_TABLE() //!<Event Table declaration.
177                 };
178         }//ecapseman
179 }//ecapseman
180
181 #endif // BUTTONCONTAINERPANEL_H