CustusX  2023.01.05-dev+develop.0da12
An IGT application
cxLayoutRepository.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 #ifndef CXLAYOUTREPOSITORY_H
12 #define CXLAYOUTREPOSITORY_H
13 
14 #include "cxResourceVisualizationExport.h"
15 
16 #include <QObject>
17 #include "cxForwardDeclarations.h"
18 #include <vector>
19 #include "cxXmlOptionItem.h"
20 #include "cxLayoutData.h"
21 
22 namespace cx
23 {
24 class LayoutData;
25 
35 class cxResourceVisualization_EXPORT LayoutRepository : public QObject
36 {
37  Q_OBJECT
38 public:
40 
41  LayoutData get(const QString uid) const;
42  std::vector<QString> getAvailable() const;
43  void insert(const LayoutData& data);
44  QString generateUid() const;
45  void erase(const QString uid);
46  bool isCustom(const QString& uid) const;
47 
48  void load(XmlOptionFile file);
49  void save(XmlOptionFile file);
50 
51  void addDefault(LayoutData data);
52  bool exists(const QString uid) const;
53 signals:
54  void layoutChanged(QString uid);
55 private:
56  void addDefaults();
57  unsigned indexOf(const QString uid) const;
58 
59  typedef std::vector<LayoutData> LayoutDataVector;
60  LayoutDataVector mLayouts;
61  std::vector<QString> mDefaultLayouts;
62 };
63 
64 } // namespace cx
65 
66 
67 #endif // CXLAYOUTREPOSITORY_H
Helper class for xml files used to store ssc/cx data.
Namespace for all CustusX production code.