experiments/include/componentui.h
00001 /******************************************************************************** 00002 * FARSA Experiments Library * 00003 * Copyright (C) 2007-2012 * 00004 * Gianluca Massera <emmegian@yahoo.it> * 00005 * Stefano Nolfi <stefano.nolfi@istc.cnr.it> * 00006 * Tomassino Ferrauto <tomassino.ferrauto@istc.cnr.it> * 00007 * * 00008 * This program is free software; you can redistribute it and/or modify * 00009 * it under the terms of the GNU General Public License as published by * 00010 * the Free Software Foundation; either version 2 of the License, or * 00011 * (at your option) any later version. * 00012 * * 00013 * This program is distributed in the hope that it will be useful, * 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00016 * GNU General Public License for more details. * 00017 * * 00018 * You should have received a copy of the GNU General Public License * 00019 * along with this program; if not, write to the Free Software * 00020 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * 00021 ********************************************************************************/ 00022 00023 #ifndef COMPONENTUI_H 00024 #define COMPONENTUI_H 00025 00026 #include "experimentsconfig.h" 00027 #include <QString> 00028 00029 class QMenu; 00030 class QMenuBar; 00031 class QWidget; 00032 00033 namespace farsa { 00034 00042 class FARSA_EXPERIMENTS_TEMPLATE ComponentUIViewer { 00043 public: 00045 ComponentUIViewer() { /* nothing to do*/ }; 00047 ComponentUIViewer( QWidget* viewer, QString menuText, QString iconFilename=QString(), QString tooltip=QString() ) 00048 : viewer(viewer), menuText(menuText), iconFilename(iconFilename), tooltip(tooltip) { /*nothing to do*/ }; 00050 QWidget* viewer; 00052 QString menuText; 00054 QString iconFilename; 00056 QString tooltip; 00057 }; 00058 00065 class FARSA_EXPERIMENTS_TEMPLATE ComponentUI { 00066 public: 00068 virtual ~ComponentUI() { /*nothing to do*/ }; 00072 virtual void fillActionsMenu( QMenu* actionsMenu ) = 0; 00078 virtual QList<ComponentUIViewer> getViewers( QWidget* parent, Qt::WindowFlags flags ) = 0; 00082 virtual void addAdditionalMenus( QMenuBar* menuBar ) { /*by default don't add nothing*/ }; 00083 }; 00084 00085 } // end namespace farsa 00086 00087 #endif