COVISE Core
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
coConfigSchemaInfos.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 CONFIGSCHEMAINFOS
9 #define CONFIGSCHEMAINFOS
10 
11 // #include <config/coConfigSchema.h>
12 #include <util/coTypes.h>
13 #include <QString>
14 #include <QRegExp>
15 #include <QHash>
16 #include <QList>
17 #include <QStringList>
18 
19 // holds the data for one attribute
20 
21 namespace covise
22 {
23 
24 typedef struct
25 {
26  bool required;
27  QString defaultValue, readableRule, regularExpressionString, attrDescription;
28 } attrData;
29 
31 {
32  friend class coConfigSchema; // needs all the setter methods
33 public:
36 
37  const QString &getElement(); // real name
38  const QString &getElementPath();
39  const QString &getElementName(); // shown name
40  const QString &getElementDescription();
41  const QString &getElementGroup(); // group to that the element belongs
42  QStringList getElementAllowedChildren();
43  QList<QString> getAttributes(); // list of all attributes for this element
44  // pointer to the attribute data
45  attrData *getAttributeData(const QString &attribute);
46 
47 private:
48  void setElement(const QString &name);
49  void setReadableElementRule(const QString &rule);
50  void setElementPath(const QString &path);
51  void setElementName(const QString &name);
52  void setElementDescription(const QString &elDescription);
53  void setElementGroup(const QString &group);
54  void setAllowedChildren(QStringList children);
55  void addAttribute(const QString &attr, bool required, const QString &defValue, const QString &readableRule = 0,
56  const QString &regExpressionString = 0, const QString &attrDescription = 0);
57 
58  QString element, elementPath, readableElementRule, elementName, elementDescription, elementGroup;
59  QStringList allowedChildren;
60  QHash<QString, attrData> attributes;
61 };
62 }
63 #endif
GLuint const GLchar * name
Definition: khronos-glext.h:6722
#define CONFIGEXPORT
Definition: coExport.h:337
QString regularExpressionString
Definition: coConfigSchemaInfos.h:27
QStringList allowedChildren
Definition: coConfigSchemaInfos.h:59
Definition: coConfigSchemaInfos.h:30
Definition: coConfigSchema.h:34
QHash< QString, attrData > attributes
Definition: coConfigSchemaInfos.h:60
bool required
Definition: coConfigSchemaInfos.h:26
GLsizei const GLchar ** path
Definition: khronos-glext.h:7952
GLboolean GLuint group
Definition: khronos-glext.h:12389
QString readableElementRule
Definition: coConfigSchemaInfos.h:58
Definition: coConfigSchemaInfos.h:24