Fraxinus  18.10
An IGT application
cxPresets.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 
13 #ifndef CXPRESETS_H_
14 #define CXPRESETS_H_
15 
16 #include "cxResourceExport.h"
17 #include "cxPrecompiledHeader.h"
18 
19 #include <QObject>
20 
21 #include <map>
22 #include <vector>
23 #include <boost/shared_ptr.hpp>
24 #include "cxXmlOptionItem.h"
25 
26 namespace cx {
27 
40 class cxResource_EXPORT Presets : public QObject
41 {
42  Q_OBJECT
43 
44 public:
45  Presets(XmlOptionFile presetFile, XmlOptionFile customFile); //used
46  virtual ~Presets(){};
47 
48  QString getId() const;
49 
50  void addCustomPreset(QDomElement& element);
51  virtual void deleteCustomPreset(QString name);
52  virtual void save();
53  virtual void remove();
54 
55  QStringList getPresetList(QString tag="");
56  bool isDefaultPreset(QString presetName);
57  XmlOptionFile getCustomFile();
58 
59 signals:
60  void changed();
61 
62 protected:
63  virtual QStringList generatePresetList(QString tag);
64  XmlOptionFile getPresetNode(const QString& presetName);
65  void addDefaultPreset(QDomElement& element); //used
66  void addPreset(XmlOptionFile& file, QDomElement& element); //used
67 
68  //debugging
69  void print(QDomElement element);
70 
73 
75 private:
76  XmlOptionFile mCustomFile; //used
77  QString mId;
78 };
79 
80 typedef boost::shared_ptr<class Presets> PresetsPtr;
81 
82 } /* namespace cx */
83 #endif /* CXPRESETS_H_ */
Base class for a group of presets in the system.
Definition: cxPresets.h:40
XmlOptionFile mPresetFile
< the name of the last custom preset removed
Definition: cxPresets.h:74
QString mLastCustomPresetRemoved
< the name of the last custom preset added
Definition: cxPresets.h:72
boost::shared_ptr< class Presets > PresetsPtr
QString mLastCustomPresetAdded
Definition: cxPresets.h:71
virtual ~Presets()
Definition: cxPresets.h:46
void print(QString header, QRect r)
Helper class for xml files used to store ssc/cx data.
Namespace for all CustusX production code.