Frapper  1.0a
ParameterPlugin.h
Go to the documentation of this file.
1 /*
2 -----------------------------------------------------------------------------
3 This source file is part of FRAPPER
4 research.animationsinstitut.de
5 sourceforge.net/projects/frapper
6 
7 Copyright (c) 2008-2009 Filmakademie Baden-Wuerttemberg, Institute of Animation
8 
9 This program is free software; you can redistribute it and/or modify it under
10 the terms of the GNU Lesser General Public License as published by the Free Software
11 Foundation; either version 2 of the License, or (at your option) any later
12 version.
13 
14 This program is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
17 
18 You should have received a copy of the GNU Lesser General Public License along with
19 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
20 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
21 http://www.gnu.org/copyleft/lesser.txt.
22 -----------------------------------------------------------------------------
23 */
24 
33 
34 
35 #ifndef PARAMETERPLUGIN_H
36 #define PARAMETERPLUGIN_H
37 
38 #include "FrapperPrerequisites.h"
39 #include "Parameter.h"
40 #include "NumberParameter.h"
41 #include "Key.h"
42 
43 namespace Frapper {
44 
46 {
47  Q_OBJECT
48 public: // constructors and destructors : public Parameter
49 
50 
59  ParameterPlugin ( const QString &name, QString type, QMap<QString, QVariant> flags, const QVariant &value );
60 
69  ParameterPlugin ( const QString &name, QString type, const QVariant &value );
70 
78  ParameterPlugin ( const QString &name, const QVariant &value );
79 
85  ParameterPlugin ( ParameterPlugin * parameter );
86 
94  virtual ~ParameterPlugin ();
95 
96 public: // functions
97 
103  void setFlags(QMap<QString, QVariant> flags);
104 
111  void addFlag(QString key, QVariant value);
112 
118  QMap<QString, QVariant> getFlags();
119 
126  QVariant getFlag(QString flag);
127 
133  QString getCall();
134 
140  void setCall(QString call);
141 
145  void triggerWidgetRedraw();
146 
147  // //
148  // //
149  // the following functions are still in developement and not intended for use //
150  // //
151  // //
152 
158  void copyParameterValue(Parameter * parameter);
159 
165  void copyNumberParameterValue(NumberParameter * numberParameter);
166 
174  bool getIntegerFlag(QString flag, int &number);
175 
183  bool getFloatFlag(QString flag, float &number);
184 
192  bool getStringFlag(QString flag, QString &string);
193 
201  bool getBoolFlag(QString flag, bool &boolean);
202 
209  QVariant::Type getFlagType(QString flag);
210 
216  QVariant::Type getParameterType();
217 
224  QList<QVariant> * TransformFloatToVariantList(QList<float> * list);
225 
232  QList<float> * TransformVariantToFloatList(QList<QVariant> * list);
233 
234 private: // data
235 
239  QString m_call;
240 
244  QMap<QString, QVariant> m_flags;
245 
246 signals:
247 
251  void forceRedraw();
252 };
253 
254 } // end namespace Frapper
255 
256 #endif