petalnode.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef PETALNODE__H
00013 #define PETALNODE__H
00014
00015 #include <qstring.h>
00016 #include <qpair.h>
00017 #include <qvaluelist.h>
00018 #include <qstringlist.h>
00019
00040 class PetalNode {
00041 public:
00048 struct StringOrNode {
00049 QString string;
00050 PetalNode *node;
00051 StringOrNode() { node = 0; }
00052 virtual ~StringOrNode() { }
00053 bool isEmpty() { return (string.isEmpty() && node == 0); }
00054 };
00055 typedef QPair<QString, StringOrNode> NameValue;
00056 typedef QValueList<NameValue> NameValueList;
00057
00058 enum NodeType { nt_object, nt_list };
00059
00060 PetalNode(NodeType nt);
00061 virtual ~PetalNode();
00062
00063
00064 NodeType type() const;
00065 QStringList initialArgs() const;
00066 QString name() const;
00067 NameValueList attributes() const;
00068
00069
00070 void setInitialArgs(const QStringList& args);
00071 void setAttributes(NameValueList vl);
00072
00078 StringOrNode findAttribute(const QString& name) const;
00079 private:
00080 NodeType m_type;
00081 QStringList m_initialArgs;
00082 NameValueList m_attributes;
00083 };
00084
00085 #endif
00086
This file is part of the documentation for umbrello Version 3.1.0.