itom 2.0.0
D:/git-itom/sources/itom/common/abstractAddInConfigDialog.h
00001 /* ********************************************************************
00002     itom software
00003     URL: http://www.uni-stuttgart.de/ito
00004     Copyright (C) 2013, Institut für Technische Optik (ITO),
00005     Universität Stuttgart, Germany
00006 
00007     This file is part of itom and its software development toolkit (SDK).
00008 
00009     itom is free software; you can redistribute it and/or modify it
00010     under the terms of the GNU Library General Public Licence as published by
00011     the Free Software Foundation; either version 2 of the Licence, or (at
00012     your option) any later version.
00013    
00014     In addition, as a special exception, the Institut für Technische
00015     Optik (ITO) gives you certain additional rights.
00016     These rights are described in the ITO LGPL Exception version 1.0,
00017     which can be found in the file LGPL_EXCEPTION.txt in this package.
00018 
00019     itom is distributed in the hope that it will be useful, but
00020     WITHOUT ANY WARRANTY; without even the implied warranty of
00021     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Library
00022     General Public Licence for more details.
00023 
00024     You should have received a copy of the GNU Library General Public License
00025     along with itom. If not, see <http://www.gnu.org/licenses/>.
00026 *********************************************************************** */
00027 
00028 #ifndef ABSTRACTADDINCONFIGDIALOG_H
00029 #define ABSTRACTADDINCONFIGDIALOG_H
00030 
00031 #include "retVal.h"
00032 #include "typeDefs.h"
00033 #include "sharedStructuresQt.h"
00034 #include "commonGlobal.h"
00035 #include "../common/interval.h"
00036 #include "../common/qtMetaTypeDeclarations.h"
00037 
00038 #if QT_VERSION < 0x050000
00039 #include <qdialog.h>
00040 #else
00041 #include <QtWidgets/qdialog.h>
00042 #endif
00043 #include <qmap.h>
00044 #include <qsharedpointer.h>
00045 
00046 
00047 
00048 
00049 
00050 //forward declarations
00051 namespace ito
00052 {
00053     class AddInBase; //forward declaration
00054     class AbstractAddInConfigDialogPrivate; //forward declaration
00055 
00056     //----------------------------------------------------------------------------------------------------------------------------------
00081     class ITOMCOMMONQT_EXPORT AbstractAddInConfigDialog : public QDialog
00082     {
00083         Q_OBJECT
00084 
00085         public:
00087             AbstractAddInConfigDialog(ito::AddInBase *plugin);
00088 
00090             virtual ~AbstractAddInConfigDialog();
00091             
00096             enum MessageLevel 
00097             {
00098                 msgLevelNo = 0,          
00099                 msgLevelErrorOnly = 1,   
00100                 msgLevelWarningOnly = 2, 
00101                 msgLevelWarningAndError = msgLevelErrorOnly | msgLevelWarningOnly 
00102             };
00103 
00105 
00113             virtual ito::RetVal applyParameters() = 0;
00114         
00115         protected:
00117 
00129             virtual ito::RetVal setPluginParameter(QSharedPointer<ito::ParamBase> param, MessageLevel msgLevel = msgLevelWarningAndError);
00130 
00132 
00144             virtual ito::RetVal setPluginParameters(const QVector<QSharedPointer<ito::ParamBase> > params, MessageLevel msgLevel = msgLevelWarningAndError);
00145             
00147 
00161             virtual ito::RetVal observeInvocation(ItomSharedSemaphore *waitCond, MessageLevel msgLevel) const;
00162 
00163             QMap<QString, ito::Param> m_currentParameters; 
00165         private:
00166             AbstractAddInConfigDialogPrivate* d; 
00168         public slots:
00170 
00178             virtual void parametersChanged(QMap<QString, ito::Param> params) = 0;
00179     };
00180 } //end namespace ito
00181 
00182 #endif //ABSTRACTADDINCONFIGDIALOG_H
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends