VR-Exchange 2.1 API Documentation
property.h
Go to the documentation of this file.
1 /*********************************************************************
2  ** Copyright (c) 1992-2010 VT MAK
3  ** All rights reserved.
4  *********************************************************************/
5 
6 
7 #ifndef property_H_
8 #define property_H_
9 
10 #include <QtCore/QVariant>
11 #include <QtCore/QString>
12 #include <list>
13 
14 #include <namespace.h>
15 #include <widgets/propertyType.h>
16 #include <widgets/property.h>
17 #include <memory>
18 
19 namespace MAKVrExchange
20 {
21  class DtProperty;
23  typedef std::auto_ptr<DtPropertyType> DtPropertyTypeAP;
24  typedef std::list<DtProperty> DtPropertyList;
25 
28  {
29  public:
30 
31  // Default constructor Construct a property of a name and type.
32  DtProperty(QString name, DtPropertyTypeAP type,QVariant value);
33 
35  DtProperty(const DtProperty&);
36 
37  // Default constructor, used by list, do NOT USE. Internal values are
38  // invalid.
39  DtProperty();
40 
41  // DTOR
42  ~DtProperty();
43 
44  //bool operator== (const DtProperty&);
45  DtProperty& operator= (const DtProperty&);
46  virtual bool operator<(const DtProperty&) const;
47 
48  DtProperty& appendChild(const DtProperty& child);
49  void removeChild(QString name);
50 
52  DtProperty* findChild(QString name);
53  const DtProperty* findChild(QString name) const;
54 
55  // Accessors
56  const DtPropertyType* type() const;
57  QString name() const;
58  QVariant value() const;
59 
60  // This provides a simple means of identifying a property and provides a hook
61  // to associate this property with some other object. Helps alleviate problems
62  // of objects with duplicate names. Id of -1 is defualt--ie it's unassigned.
63  int id() const;
64 
65  // Is read only if myReadOnly is true OR parent is readOnly.
66  // If no parent then use only myReadOnly.
67  bool readOnly() const;
68 
69  DtPropertyList* children();
70  const DtPropertyList* children() const;
71 
72  // Mutators
73  void setId(int id);
74  void setValue(QVariant value);
75  void setReadOnly(bool readOnly);
76 
77  protected:
78  QString myName;
79  QVariant myValue;
81  int myId;
84  bool myReadOnly;
85  };
86 }
87 
88 #endif

Document ID: Generated on Tue Aug 7 22:07:13 EDT 2012 from SVN revision 117874
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)