Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryIQtStyleManager.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 BlueBerry Platform
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 
18 #ifndef BERRYIQTSTYLEMANAGER_H_
19 #define BERRYIQTSTYLEMANAGER_H_
20 
21 #include <QString>
22 #include <QList>
23 #include <QtPlugin>
24 
26 
27 namespace berry {
28 
30 {
31 
32  struct Style {
33  QString name;
34  QString fileName;
35 
36  Style() {}
37 
38  Style(const QString& name, const QString& fn)
39  : name(name), fileName(fn) {}
40 
41  Style& operator=(const Style& s)
42  {
43  this->name = s.name;
44  this->fileName = s.fileName;
45  return *this;
46  }
47 
48  bool operator<(const Style& s) const
49  { return name < s.name; }
50 
51  bool operator==(const Style& s) const
52  { return name == s.name; }
53  };
54 
55  struct IconTheme {
56  QString name;
57 
58  IconTheme() {}
59 
60  IconTheme(const QString& name)
61  : name(name) {}
62 
64  {
65  this->name = s.name;
66  return *this;
67  }
68 
69  bool operator<(const IconTheme& s) const
70  { return name < s.name; }
71 
72  bool operator==(const IconTheme& s) const
73  { return name == s.name; }
74  };
75 
76  typedef QList<Style> StyleList;
77  typedef QList<IconTheme> IconThemeList;
78 
79  virtual ~IQtStyleManager();
80 
81  virtual Style GetStyle() const = 0;
82  virtual QString GetStylesheet() const = 0;
83  virtual QString GetActiveTabStylesheet() const = 0;
84  virtual QString GetTabStylesheet() const = 0;
85 
86  virtual void AddStyle(const QString& styleFileName, const QString& styleName = QString()) = 0;
87  virtual void AddStyles(const QString& path) = 0;
88  virtual void RemoveStyle(const QString& styleFileName) = 0;
89  virtual void RemoveStyles(const QString& repository = QString()) = 0;
90 
91  virtual void GetStyles(StyleList& styles) const = 0;
92  virtual void SetStyle(const QString& fileName) = 0;
93 
94  virtual Style GetDefaultStyle() const = 0;
95  virtual void SetDefaultStyle() = 0;
96 
97  virtual void GetIconThemes(IconThemeList& iconThemes) const = 0;
98 
99  virtual void SetIconTheme(const QString& themeName) = 0;
100 
101  virtual bool Contains(const QString& fileName) const = 0;
102 
103 };
104 
105 }
106 
107 Q_DECLARE_INTERFACE(berry::IQtStyleManager, "org.blueberry.service.IQtStyleManager")
108 
109 #endif /* BERRYIQTSTYLEMANAGER_H_ */
bool operator<(const Style &s) const
IconTheme & operator=(const IconTheme &s)
bool operator==(const Style &s) const
Style(const QString &name, const QString &fn)
bool operator==(const IconTheme &s) const
Style & operator=(const Style &s)
QList< IconTheme > IconThemeList
bool operator<(const IconTheme &s) const
#define BERRY_UI_QT