]> Creatis software - creaMaracasVisu.git/blob - lib/maracasVisuLib/src/interface/wxWindows/widgets/creaButtonContainer/view/button.h
creaButtonContainer: new structure to make easy the button settings
[creaMaracasVisu.git] / lib / maracasVisuLib / src / interface / wxWindows / widgets / creaButtonContainer / view / button.h
1 /*!
2  * @file button.h
3  * @brief Contains the Button class.
4  * @author Diego CACERES (diego.caceres[AT]creatis.insa-lyon.fr)
5  * @date  2011-05-24
6  */
7
8 #ifndef BUTTON_H
9 #define BUTTON_H
10
11 #include <wx/bmpbuttn.h>
12 #include <wx/image.h>
13 #include <wx/string.h>
14 #include <string>
15 #include <iostream>
16 #include "functor.h"
17 #include "system.h"
18
19 /*!     @namespace <creaButtonContainer>
20  *      @brief Contains the creaButtonContainer library included in creaMaracasVisu.
21  */
22 namespace creaButtonContainer
23 {
24         /*! @namespace <creaButtonContainer::view>
25          *      @brief Contains the implementation of the view in creaButtonContainer library.
26          *      @see <a href="http://en.wikipedia.org/wiki/Model-view-controller">MVC Software Architecture</a>
27          */
28         namespace view
29         {
30                 /*! @class Button button.h "button.h"
31                  *      @brief This class contains the Button in the view perspective.
32                  *  @details This class contains the information of a button, it derives from wxBitmapButton.
33                  *  @see <a href="http://docs.wxwidgets.org/stable/wx_wxbitmapbutton.html">wxBitmapButton</a>
34                  */
35                 class Button : public wxBitmapButton
36                 {
37                         public:
38                                 //typedef definition
39                                 /*!     @typedef creaButtonContainer::model::TFunctor TFunctor;
40                                  *      @brief Defines the TFunctor type.
41                                  */
42                                 typedef creaButtonContainer::model::TFunctor TFunctor;
43                                 //end of typedef definition
44                         public:
45                                 // ----------------------------------------------------------------------------------
46                                 /*! @fn Button::Button( wxWindow* parent, long id, ButtonPair* pair );
47                                  *      @brief This is the constructor.
48                                  *      @param parent The wxWindow* parent.
49                                  *      @param id The wxID of the button.
50                                  *      @param pair The button information.
51                                  */
52                                 Button( wxWindow* parent, long id, ButtonPair* pair );
53                                 // ----------------------------------------------------------------------------------
54                                 /*! @fn virtual Button::~Button( );
55                                  *      @brief This is the destructor.
56                                  */
57                                 virtual
58                                 ~Button( );
59                                 // ----------------------------------------------------------------------------------
60                                 /*! @fn long Button::GetID( );
61                                  *      @brief This method gets the wxID of the button.
62                                  *      @return long wxID of the button.
63                                  */
64                                 long
65                                 GetID( );
66                                 // ----------------------------------------------------------------------------------
67                                 /*! @fn std::string Button::GetButtonName( );
68                                  *      @brief This method returns the name of the button.
69                                  *      @return std::string The name of the button.
70                                  */
71                                 std::string
72                                 GetButtonName( );
73                                 // ----------------------------------------------------------------------------------
74                                 /*! @fn std::string Button::GetIconPath( );
75                                  *      @brief This method returns the iconPath of the button.
76                                  *      @return std::string The path of the icon.
77                                  */
78                                 std::string
79                                 GetIconPath( );
80                                 // ----------------------------------------------------------------------------------
81                                 /*! @fn std::string Button::GetDescription( );
82                                  *      @brief This method returns a the description of the button.
83                                  *      @return std::string The tooltip of the button.
84                                  */
85                                 std::string
86                                 GetDescription( );
87                                 // ----------------------------------------------------------------------------------
88                                 /*! @fn void Button::Execute( );
89                                  *      @brief This method executes the Functor (Call_Back Function).
90                                  *      This is the event of the button that it was defined to be called remotely using
91                                  *      call_back functions. In this project it was implemented using Functors.
92                                  *      @exception std::bad_alloc
93                                  *      @see TFunctor
94                                  */
95                                 void
96                                 Execute( );
97                                 // ----------------------------------------------------------------------------------
98                         private:
99                                 ButtonPair* m_ButtonPair; //! <ButtonPair* ButtonPair pointer.
100                 };
101         }//ecapseman
102 }//ecapseman
103
104 #endif // BUTTON_H