]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/controller/buttonContainerController.h
a54d4f4324c87e340acedb448f70c35c46ac487a
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / creaButtonContainer / controller / buttonContainerController.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 Contains the ButtonContainerController class
29  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
30  * @date  2011-06-02
31  */
32
33 #ifndef BUTTONCONTAINERCONTROLLER_H_
34 #define BUTTONCONTAINERCONTROLLER_H_
35
36 #include <wx/event.h>
37 #include <iostream>
38 #include <exception>
39 #include "buttonContainerPanel.h"
40
41 /*!     @namespace <creaButtonContainer>
42  *      @brief Contains the creaButtonContainer library included in creaMaracasVisu.
43  */
44 namespace creaButtonContainer
45 {
46         /*! @namespace <creaButtonContainer::view>
47          *      @brief Contains the implementation of the view in creaButtonContainer library.
48          *      @see <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC Software Architecture</a>
49          */
50         namespace view
51         {
52                 //Predefinition of ButtonContainerPanel FriendClass!!
53                 /*! @class ButtonContainerPanel buttonContainerPanel.h "buttonContainerPanel.h"
54                  *  @brief This class is the container of the creaButtonContainer.
55                  *  @details This class derives from wxScrolledWindow and manages the view of the buttonContainer.
56                  *  @see <a href="http://docs.wxwidgets.org/stable/wx_wxscrolledwindow.html">wxScrolledWindow</a>
57                  */
58                 class ButtonContainerPanel;
59         }
60         /*!     @namespace<creaButtonContainer::controller>
61          *      @brief Contains the implementation of the controller in creaButtonContainer library.
62          *      @see <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC Software Architecture</a>
63          */
64         namespace controller
65         {
66                 /*! @class ButtonContainerController buttonContainerController.h "buttonContainerController.h"
67                  *      @brief This class contains the ButtonContainerPanel controller.
68                  *  @details This class describes the button events, it derives from wxEvtHandler.
69                  *  @see <a href="http://docs.wxwidgets.org/stable/wx_wxevthandler.html">wxEvtHandler</a>
70                  */
71                 class ButtonContainerController : public wxEvtHandler
72                 {
73                         public:
74                                 //typedef definitions
75                                 // ----------------------------------------------------------------------------------
76                                 /*!     @typedef creaButtonContainer::view::ButtonGroup ButtonGroup
77                                  *      @brief Defines the ButtonGroup type
78                                  */
79                                 typedef creaButtonContainer::view::ButtonGroup ButtonGroup;
80                                 // ----------------------------------------------------------------------------------
81                                 /*!     @typedef typedef creaButtonContainer::view::GroupManager GroupManager
82                                  *      @brief Defines the GroupManager type
83                                  */
84                                 typedef creaButtonContainer::view::GroupManager GroupManager;
85                                 // ----------------------------------------------------------------------------------
86                                 /*!     @typedef std::list< ButtonGroup* > ButtonGroupList
87                                  *      @brief Defines the ButtonGroupList type
88                                  */
89                                 typedef std::list< ButtonGroup* > ButtonGroupList;
90                                 // ----------------------------------------------------------------------------------
91                                 /*!     @typedef std::map< long, GroupManager* > GroupManagerList
92                                  *      @brief Defines the GroupManagerList type
93                                  */
94                                 typedef std::map< long, GroupManager* > GroupManagerList;
95                                 // ----------------------------------------------------------------------------------
96                                 /*!     @typedef wxFlexGridSizer Sizer
97                                  *      @brief Defines the Sizer type
98                                  */
99                                 typedef wxFlexGridSizer Sizer;
100                                 // ----------------------------------------------------------------------------------
101                                 /*!     @typedef std::list< long > KeyList
102                                  *      @brief Defines the KeyList type
103                                  */
104                                 typedef std::list< long > KeyList;
105                                 // ----------------------------------------------------------------------------------
106                                 /*!     @typedef creaButtonContainer::model::ContainerSettings ButtonGroupSettings
107                                  *      @brief Defines the ButtonGroupSettings type
108                                  */
109                                 typedef creaButtonContainer::model::ContainerSettings
110                                     ButtonGroupSettings;
111                                 // ----------------------------------------------------------------------------------
112                                 /*!     @typedef creaButtonContainer::view::ButtonContainerPanel BCPanel
113                                  *      @brief Defines the BCPanel type
114                                  */
115                                 typedef creaButtonContainer::view::ButtonContainerPanel BCPanel;
116                                 // ----------------------------------------------------------------------------------
117                                 //end of typedef definition
118                         public:
119                                 // ----------------------------------------------------------------------------------
120                                 /*!     @fn ButtonContainerController( BCPanel* );
121                                  *      @brief This is the Parameterized constructor.
122                                  *      @param BCPanel* The connection with the view (wxPanel link).
123                                  */
124                                 ButtonContainerController( BCPanel* );
125                                 // ----------------------------------------------------------------------------------
126                                 /*! @fn ~ButtonContainerController( );
127                                  *      @brief This is the destructor.
128                                  */
129                                 virtual
130                                 ~ButtonContainerController( );
131
132                                 // ----------------------------------------------------------------------------------
133                                 /*! @fn void AddEvents( );
134                                  *      @brief This method connect every buttonEvents to the view.
135                                  *      @exception std::bad_alloc
136                                  */
137                                 void
138                                 AddEvents( );
139                                 // ----------------------------------------------------------------------------------
140                                 /*! @fn void ButtonExpEvent( wxCommandEvent& event );
141                                  *      @brief This method is the button group "+" "-" event.
142                                  *      @exception std::bad_alloc
143                                  *      @param event Button action event.
144                                  */
145                                 void
146                                 ButtonExpEvent( wxCommandEvent& event );
147                                 // ----------------------------------------------------------------------------------
148                                 /*! @fn void ButtonEvent( wxCommandEvent& event );
149                                  *      @brief This method calls the events of the buttonContainer buttons
150                                  *      @exception std::bad_alloc
151                                  *      @param event Button action event.
152                                  */
153                                 void
154                                 ButtonEvent( wxCommandEvent& event );
155                                 // ----------------------------------------------------------------------------------
156                         private:
157                                 BCPanel* m_BCPanel; //! <ButtonContainerPanel View pointer.
158                 };
159         }//ecapsename
160 }//ecapsename
161
162 #endif //BUTTONCONTAINERCONTROLLER_H_