Fraxinus  18.10
An IGT application
cxStringListProperty.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 CXSTRINGLISTPROPERTY_H
13 #define CXSTRINGLISTPROPERTY_H
14 
15 #include "cxResourceExport.h"
16 
17 #include <QDomElement>
18 #include <QStringList>
19 #include "cxStringPropertyBase.h"
20 #include "cxXmlOptionItem.h"
21 
22 namespace cx
23 {
24 
25 typedef boost::shared_ptr<class StringListProperty> StringListPropertyPtr;
26 
35 class cxResource_EXPORT StringListProperty: public Property
36 {
37 Q_OBJECT
38 public:
39  static StringListPropertyPtr initialize(const QString& uid, QString name, QString help, QStringList value, QStringList range, QDomNode root = QDomNode());
40 
41 public:
42  // inherited interface
43  virtual QString getDisplayName() const;
44  virtual QString getUid() const;
45  virtual QVariant getValueAsVariant() const;
46  virtual void setValueFromVariant(QVariant val);
47 
48  virtual bool setValue(const QStringList& value);
49  virtual QStringList getValue() const;
50  virtual QString getHelp() const;
51  virtual void setHelp(QString val);
52  virtual QStringList getValueRange() const;
53  virtual void setValueRange(QStringList range);
54  virtual QString convertInternal2Display(QString internal);
55  virtual void setDisplayNames(std::map<QString, QString> names);
56  virtual std::map<QString, QString> getDisplayNames() const { return mDisplayNames; }
57 
58  virtual void setDisplayName(QString val);
59 
60 private:
62  QString mName;
63  QString mUid;
64  QString mHelp;
65  QStringList mValue;
66  QStringList mRange;
67  XmlOptionItem mStore;
68  std::map<QString, QString> mDisplayNames;
69 };
70 
71 } // namespace cx
72 
73 #endif // CXSTRINGLISTPROPERTY_H
Superclass for all data adapters.
Definition: cxProperty.h:43
Represents one collection of strings.
Helper class for storing one string value in an xml document.
virtual std::map< QString, QString > getDisplayNames() const
boost::shared_ptr< class StringListProperty > StringListPropertyPtr
Namespace for all CustusX production code.