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>
 
  38 #include <wx/listctrl.h>
 
  45 #include "structBCPSettings.h"
 
  46 #include "containerSettings.h"
 
  50 /*!     @namespace <creaPanelButtonContainer>
 
  51  *      @brief Contains the creaPanelButtonContainer library included in creaMaracasVisu.
 
  53 namespace creaPanelButtonContainer
 
  55         /*! @class ButtonContainerSettings buttonContainerSettings.h "buttonContainerSettings.h"
 
  56          *      @brief This class contains the settings of the buttons.
 
  58         class ButtonContainerSettings
 
  62                         // ----------------------------------------------------------------------------------
 
  63                         /*!     @typedef std::string* StringType;
 
  64                          *      @brief Defines the StringType type.
 
  66                         typedef std::string StringType;
 
  67                         // ----------------------------------------------------------------------------------
 
  68                         /*!     typedef creaButtonContainer::model::TFunctor TFunctor;
 
  69                          *      @brief Defines the TFunctor type.
 
  71                         typedef creaButtonContainer::model::TFunctor TFunctor;
 
  72                         // ----------------------------------------------------------------------------------
 
  73                         /*!     @typedef creaButtonContainer::model::ContainerSettings ButtonGroupSettings;
 
  74                          *      @brief Defines the ButtonGroupSettings type.
 
  76                         typedef creaButtonContainer::model::ContainerSettings ButtonGroupSettings;
 
  77                         // ----------------------------------------------------------------------------------
 
  78                         /*!     @typedef wxPanel* PanelButton;
 
  79                          *      @brief Defines the PanelButton type.
 
  81                         typedef wxPanel* PanelButton;
 
  82                         // ----------------------------------------------------------------------------------
 
  83                         /*!     @typedef std::pair< std::string, PanelButton > ActionButton;
 
  84                          *      @brief Defines the ActionButton type.
 
  85                          *      First is the button description, Second FunctionEventType
 
  87                         typedef std::pair< std::string, PanelButton > ActionButton;
 
  89                         // ----------------------------------------------------------------------------------
 
  90                         /*!     @typedef std::pair< std::string, wxBitmap > ButtonInfo;
 
  91                          *      @brief Defines the ButtonInfo type.
 
  92                          *      First is the ButtonName, Second is the ImageIcon
 
  94                         typedef std::pair< std::string, wxBitmap > ButtonInfo;
 
  96                         // ----------------------------------------------------------------------------------
 
  97                         /*!     @typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair;
 
  98                          *      @brief Defines the ButtonPair type.
 
 100                         typedef std::pair< ButtonInfo*, ActionButton* > ButtonPair;
 
 101                         // ----------------------------------------------------------------------------------
 
 102                         /*!     @typedef std::list< std::string > KeyMapList;
 
 103                          *      @brief Defines the KeyMapList type.
 
 105                         typedef std::list< std::string > KeyMapList;
 
 107                         // ----------------------------------------------------------------------------------
 
 108                         /*!     @typedef std::list< ButtonPair* > ButtonList;
 
 109                          *      @brief Defines the ButtonList type.
 
 111                         typedef std::list< ButtonPair* > ButtonList;                    
 
 113                         // ----------------------------------------------------------------------------------
 
 114                         /*!     @typedef std::map< std::string, ButtonList > ButtonGroupMap;
 
 115                          *      @brief Defines the ButtonGroupMap type.
 
 117                         typedef std::map< std::string, ButtonList > ButtonGroupMap;
 
 118                         // ----------------------------------------------------------------------------------
 
 119                         /*!     @typedef std::vector< BCPSettingsStruct* > BCStructVectorType;
 
 120                          *      @brief Defines the BCStructVectorType type.
 
 122                         typedef std::vector< BCPSettingsStruct* > BCStructVectorType;
 
 123                         //end typedef definition
 
 124                         // ----------------------------------------------------------------------------------
 
 125                         /*! @class ButtonContainerSettings buttonContainerSettings.h "buttonContainerSettings.h"
 
 126                          *      @brief This class contains the settings of the button container.
 
 129                         typedef std::map< std::string, wxPanel* > ItemsMap;
 
 132                         // ----------------------------------------------------------------------------------
 
 133                         /*! @fn ButtonContainerSettings( );
 
 134                          *      @brief This is the default constructor.
 
 136                         ButtonContainerSettings( );
 
 137                         // ----------------------------------------------------------------------------------
 
 138                         /*! @fn virtual ~ButtonContainerSettings( );
 
 139                          *      @brief This is the destructor.
 
 142                         ~ButtonContainerSettings( );
 
 144                         // ----------------------------------------------------------------------------------
 
 145                         /*! @fn ButtonGroupMap GetButtonGroupContainer( );
 
 146                          *      @brief This method returns ButtonGroupMap with all buttons.
 
 150                         GetButtonGroupContainer( );
 
 151                         // ----------------------------------------------------------------------------------
 
 152                         /*! @fn KeyMapList GetGroupNameList( );
 
 153                          *      @brief This method returns a KeyMapsList with the name of the groups.
 
 158                         // ----------------------------------------------------------------------------------
 
 159                         /*! @fn PanelButton GetPanelButton( const std::string &buttonName );
 
 160                          *      @brief This method returns the panel of a button.
 
 162                          *      @exception std::bad_alloc
 
 166                         GetPanelButton( const std::string &buttonName );
 
 167                         // ----------------------------------------------------------------------------------
 
 168                         /*! @fn ButtonGroupSettings* GetButtonGroupSettings( TFunctor* functor );
 
 169                          *      @brief this method return the settings the generic settings for creaButtonContainer.
 
 170                          * @param functor The function to be called in the action button.
 
 171                          * @exception std::bad_alloc
 
 175                         GetButtonGroupSettings( TFunctor* functor );
 
 176                         // ----------------------------------------------------------------------------------
 
 177                         /*! @fn void SetButtonGroupContainer( ButtonGroupMap bGroupContainer );
 
 178                          *      @brief This method sets the button group container.
 
 179                          * @param bGroupContainer
 
 182                         // ----------------------------------------------------------------------------------
 
 185                         GetListGroupSettings();
 
 187                         // ----------------------------------------------------------------------------------
 
 192                         SetButtonGroupContainer( ButtonGroupMap bGroupContainer );
 
 193                         // ----------------------------------------------------------------------------------
 
 194                         /*! @fn void SetGroupNameList( KeyMapList gNameList );
 
 195                          *      @brief this method sets the groupName list
 
 199                         SetGroupNameList( KeyMapList gNameList );
 
 201                         // ----------------------------------------------------------------------------------
 
 202                         /*! @fn void AddButton( const std::string &groupName, const std::string &buttonName,
 
 203                          const std::string &iconpath, const std::string &buttonDescription,
 
 205                          * @brief This method adds a new button into a group of buttons.
 
 206                          * @param groupName The button groupName
 
 207                          * @param buttonName The buttonName
 
 208                          * @param iconpath The path of the icon
 
 209                          * @param buttonDescription The button tooltip
 
 210                          * @param panel The panel to be called when the button is clicked
 
 211                          * @exception std::bad_alloc
 
 214                         AddButton( const std::string &groupName, const std::string &buttonName,
 
 215                             const wxBitmap &icon, const std::string &buttonDescription,
 
 218                         // ----------------------------------------------------------------------------------
 
 219                         /*! @fn void AddButton( BCPSettingsStruct* info );
 
 220                          * @brief This method adds a new button into a group of buttons.
 
 221                          * @param info The pointer to BCPSettingsStruct.
 
 222                          * @exception std::bad_alloc
 
 225                         AddButton( BCPSettingsStruct* info );
 
 227                         // ----------------------------------------------------------------------------------
 
 228                         /*! @fn void AddButtons( BCStructVectorType infoList );
 
 229                          * @brief This method adds new buttons into the container.
 
 230                          * @param infoList The BCStructVectorType
 
 231                          * @exception std::bad_alloc
 
 234                         AddButtons( BCStructVectorType infoList, int type );
 
 237                         AddItems(BCPSettingsStruct* info);
 
 243                         GetPanelList( const StringType &buttonName );
 
 246                         // ----------------------------------------------------------------------------------
 
 248                         ButtonGroupMap m_ButtonGroupContainer; //!<This is the map with the groups of buttons.
 
 249                         KeyMapList m_GroupNameList; //!<This is a container with the name of the groups.
 
 252                         ItemsMap m_itemsMap; //This is the map with the name and the wPanel
 
 255 #endif /* BUTTONCONTAINERSETTINGS_H_ */