parametersettableui.h
1 /********************************************************************************
2  * FARSA Experiments Library *
3  * Copyright (C) 2007-2012 *
4  * Gianluca Massera <emmegian@yahoo.it> *
5  * Stefano Nolfi <stefano.nolfi@istc.cnr.it> *
6  * Tomassino Ferrauto <tomassino.ferrauto@istc.cnr.it> *
7  * *
8  * This program is free software; you can redistribute it and/or modify *
9  * it under the terms of the GNU General Public License as published by *
10  * the Free Software Foundation; either version 2 of the License, or *
11  * (at your option) any later version. *
12  * *
13  * This program is distributed in the hope that it will be useful, *
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
16  * GNU General Public License for more details. *
17  * *
18  * You should have received a copy of the GNU General Public License *
19  * along with this program; if not, write to the Free Software *
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA *
21  ********************************************************************************/
22 
23 #ifndef PARAMETERSETTABLEUI_H
24 #define PARAMETERSETTABLEUI_H
25 
26 #include "configurationconfig.h"
27 #include <QString>
28 
29 class QMenu;
30 class QMenuBar;
31 class QWidget;
32 
33 namespace farsa {
34 
44 class FARSA_CONF_TEMPLATE ParameterSettableUIViewer {
45 public:
47  ParameterSettableUIViewer() { /* nothing to do*/ };
49  ParameterSettableUIViewer( QWidget* viewer, QString menuText, QString iconFilename=QString(), QString tooltip=QString() )
50  : viewer(viewer), menuText(menuText), iconFilename(iconFilename), tooltip(tooltip) { /*nothing to do*/ };
52  QWidget* viewer;
54  QString menuText;
56  QString iconFilename;
58  QString tooltip;
59 };
60 
67 class FARSA_CONF_TEMPLATE ParameterSettableUI {
68 public:
70  virtual ~ParameterSettableUI() { /*nothing to do*/ };
74  virtual void fillActionsMenu( QMenu* /*actionsMenu*/ ) { /*by default don't add nothing*/ };
80  virtual QList<ParameterSettableUIViewer> getViewers( QWidget* /*parent*/, Qt::WindowFlags /*flags*/ ) {
81  /* by default return an empty list */
82  return QList<ParameterSettableUIViewer>();
83  };
87  virtual void addAdditionalMenus( QMenuBar* /*menuBar*/ ) { /*by default don't add nothing*/ };
88 };
89 
90 } // end namespace farsa
91 
92 #endif
QString tooltip
the tooltip text
virtual void fillActionsMenu(QMenu *)
fill the menu "Actions" of Total99 with the actions of the ParameterSettable
This file contains the common type defitions used on the whole framework.
virtual ~ParameterSettableUI()
Destructor.
Helper class for storing information about a viewer for a ParameterSettable.
The ParameterSettableUI is the base (abstract) class that manage/create the graphic user interface fo...
QString menuText
the name to display on the views menu for this viewer
virtual QList< ParameterSettableUIViewer > getViewers(QWidget *, Qt::WindowFlags)
Return the list of all viewers for the ParameterSettable with corresponding informations for fill the...
QString iconFilename
the icon filename to display on the toolbar for this viewer
virtual void addAdditionalMenus(QMenuBar *)
add additional menus to the menu bar of Total99 is needed by the ParameterSettable ...
ParameterSettableUIViewer(QWidget *viewer, QString menuText, QString iconFilename=QString(), QString tooltip=QString())
Constructor - initialize all data.