Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
berryIQtStyleManager.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 
14 #ifndef BERRYIQTSTYLEMANAGER_H_
15 #define BERRYIQTSTYLEMANAGER_H_
16 
17 #include <QString>
18 #include <QList>
19 #include <QtPlugin>
20 
22 
23 namespace berry {
24 
26 {
27 
28  struct Style {
29  QString name;
30  QString fileName;
31 
32  Style() {}
33 
34  Style(const QString& name, const QString& fn)
35  : name(name), fileName(fn) {}
36 
37  Style& operator=(const Style& s)
38  {
39  this->name = s.name;
40  this->fileName = s.fileName;
41  return *this;
42  }
43 
44  bool operator<(const Style& s) const
45  { return name < s.name; }
46 
47  bool operator==(const Style& s) const
48  { return name == s.name; }
49  };
50 
51  typedef QList<Style> StyleList;
52 
53  virtual ~IQtStyleManager();
54 
55  virtual Style GetStyle() const = 0;
56  virtual QString GetStylesheet() const = 0;
57  virtual QString GetActiveTabStylesheet() const = 0;
58  virtual QString GetTabStylesheet() const = 0;
59  virtual QString GetFont() const = 0;
60 
61  virtual void AddStyle(const QString& styleFileName, const QString& styleName = QString()) = 0;
62  virtual void AddStyles(const QString& path) = 0;
63  virtual void RemoveStyle(const QString& styleFileName) = 0;
64  virtual void RemoveStyles(const QString& repository = QString()) = 0;
65 
66  virtual void GetStyles(StyleList& styles) const = 0;
67  virtual void SetStyle(const QString& fileName) = 0;
68 
69  virtual void GetFonts(QStringList& fontNames) const = 0;
70  virtual void SetFont(const QString& fontName) = 0;
71  virtual void SetFontSize(const int fontSize) = 0;
72  virtual void UpdateWorkbenchFont() = 0;
73 
74  virtual Style GetDefaultStyle() const = 0;
75  virtual void SetDefaultStyle() = 0;
76 
77  virtual bool Contains(const QString& fileName) const = 0;
78 
79 };
80 
81 }
82 
83 Q_DECLARE_INTERFACE(berry::IQtStyleManager, "org.blueberry.service.IQtStyleManager")
84 
85 #endif /* BERRYIQTSTYLEMANAGER_H_ */
berry::IQtStyleManager
Definition: berryIQtStyleManager.h:25
org_blueberry_ui_qt_Export.h
berry::IQtStyleManager::StyleList
QList< Style > StyleList
Definition: berryIQtStyleManager.h:51
berry::IQtStyleManager::Style::operator<
bool operator<(const Style &s) const
Definition: berryIQtStyleManager.h:44
berry::IQtStyleManager::Style::operator=
Style & operator=(const Style &s)
Definition: berryIQtStyleManager.h:37
berry::IQtStyleManager::Style::name
QString name
Definition: berryIQtStyleManager.h:29
BERRY_UI_QT
#define BERRY_UI_QT
Definition: org_blueberry_ui_qt_Export.h:26
berry::IQtStyleManager::Style::operator==
bool operator==(const Style &s) const
Definition: berryIQtStyleManager.h:47
berry::IQtStyleManager::Style::fileName
QString fileName
Definition: berryIQtStyleManager.h:30
berry::IQtStyleManager::Style
Definition: berryIQtStyleManager.h:28
berry::IQtStyleManager::Style::Style
Style()
Definition: berryIQtStyleManager.h:32
berry::IQtStyleManager::Style::Style
Style(const QString &name, const QString &fn)
Definition: berryIQtStyleManager.h:34
berry
Definition: QmitkPropertyItemModel.h:24