CustusX  2023.01.05-dev+develop.0da12
An IGT application
cxProperty.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 #ifndef CXPROPERTY_H_
13 #define CXPROPERTY_H_
14 
15 #include "cxResourceExport.h"
16 
17 #include <boost/shared_ptr.hpp>
18 #include <vector>
19 #include <QString>
20 #include <QObject>
21 #include <QVariant>
22 
23 namespace cx {
24 typedef boost::shared_ptr<class Property> PropertyPtr;
25 typedef boost::shared_ptr<class PatientModelService> PatientModelServicePtr;
26 typedef boost::shared_ptr<class ViewService> ViewServicePtr;
27 
43 class cxResource_EXPORT Property: public QObject
44 {
45  Q_OBJECT
46 
47 public:
48  Property();
49  virtual ~Property(){}
50 
51  static PropertyPtr findProperty(std::vector<PropertyPtr> properties, QString id);
52 
53 public:
54  virtual QString getDisplayName() const = 0;
55  virtual QString getUid() const = 0;
56 
57  virtual QVariant getValueAsVariant() const = 0;
58  virtual void setValueFromVariant(QVariant val) = 0;
59 
60  virtual bool getEnabled() const;
61  virtual bool getAdvanced() const;
62  virtual QString getGroup() const;
63 
64 public slots:
65  virtual bool setEnabled(bool enabled);
66  virtual bool setAdvanced(bool advanced);
67  virtual bool setGroup(QString name);
68 
69 signals:
70  void changed();
71 
72 protected:
73  bool mEnabled; //< a property can be in either a enabled or disabled state
74  bool mAdvanced; //< flag marking this property value as a advanced option
75  QString mGroup; //< tag marking this property as part of a group with this name
76 };
77 } //namespace cx
78 
79 #endif /* CXPROPERTY_H_ */
virtual ~Property()
Definition: cxProperty.h:49
Superclass for all data adapters.
Definition: cxProperty.h:43
boost::shared_ptr< class ViewService > ViewServicePtr
bool mEnabled
Definition: cxProperty.h:73
boost::shared_ptr< class Property > PropertyPtr
boost::shared_ptr< class PatientModelService > PatientModelServicePtr
bool mAdvanced
Definition: cxProperty.h:74
QString mGroup
Definition: cxProperty.h:75
Namespace for all CustusX production code.