COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
WSChoiceParameter.h
Go to the documentation of this file.
1 /* This file is part of COVISE.
2 
3  You can use it under the terms of the GNU Lesser General Public License
4  version 2.1 or later, see lgpl-2.1.txt.
5 
6  * License: LGPL 2+ */
7 
8 #ifndef WSCHOICEPARAMETER_H
9 #define WSCHOICEPARAMETER_H
10 
11 #include "WSExport.h"
12 #include "WSParameter.h"
13 #include "WSTools.h"
14 
15 namespace covise
16 {
17 
19 {
20 
21  Q_OBJECT
22 
23  Q_PROPERTY(QStringList value READ getValue WRITE setValue)
24  Q_PROPERTY(int selected READ getSelected WRITE setSelected)
25  Q_PROPERTY(QString selectedValue READ getSelectedValue)
26 
27 public:
28  WSChoiceParameter(const QString &name, const QString &description,
29  const QStringList &inValue = QStringList(), int selected = 1);
30 
31  virtual ~WSChoiceParameter();
32 
33 public slots:
38  bool setValue(const QStringList &inValue, int selected = 1);
39 
44  bool setValue(int selected);
45 
50  QStringList getValue() const;
51 
52  const QString getSelectedValue();
53 
54  bool setSelected(int index);
55 
56  int getSelected() const;
57 
58  virtual int getComponentCount() const;
59 
60 public:
61  virtual QString toString() const;
62 
63  virtual WSParameter *clone() const;
64 
65  virtual const covise::covise__Parameter *getSerialisable();
66 
67 protected:
68  virtual bool setValueFromSerialisable(const covise::covise__Parameter *serialisable);
69 
70  virtual QString toCoviseString() const;
71 
72 private:
73  bool setValue(int selected, bool changed);
74  covise::covise__ChoiceParameter parameter;
75  WSChoiceParameter();
76  static WSChoiceParameter *prototype;
77 };
78 }
79 
80 #endif // WSCHOICEPARAMETER_H
GLuint const GLchar * name
Definition: khronos-glext.h:6722
#define WSLIBEXPORT
Definition: coExport.h:355
Definition: WSChoiceParameter.h:18
GLuint index
Definition: khronos-glext.h:6722
Definition: WSParameter.h:27
GLsizei const GLfloat * value
Definition: khronos-glext.h:6760