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

Document ID: Generated on Thu Jul 23 10:25:22 EDT 2015 from SVN revision 155065
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)