MuseScore  3.4
Music composition and notation
inspectorplugin.h
Go to the documentation of this file.
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2017 Werner Schweer and others
6 //
7 // This program is free software; you can redistribute it and/or modify
8 // it under the terms of the GNU General Public License version 2
9 // as published by the Free Software Foundation and appearing in
10 // the file LICENSE.GPL
11 //=============================================================================
12 
13 #ifndef __INSPECTORPLUGIN_H__
14 #define __INSPECTORPLUGIN_H__
15 
16 #include <QtUiPlugin/QDesignerCustomWidgetInterface>
17 #include "libmscore/mscore.h"
18 
19 namespace Ms {
20  struct MScore {
21  static QColor selectColor[VOICES];
22  static void init();
23  };
24 
25  struct Preferences {
26  int getInt(QString) const;
27  bool isThemeDark() const;
28  };
29  }
30 
31 //---------------------------------------------------------
32 // InspectorPlugin
33 //---------------------------------------------------------
34 
35 class InspectorPlugin : public QDesignerCustomWidgetInterface {
36  Q_INTERFACES(QDesignerCustomWidgetInterface)
37  bool m_initialized;
38 
39  public:
40  InspectorPlugin() : m_initialized(false) { }
41  bool isContainer() const { return false; }
42  bool isInitialized() const { return m_initialized; }
43  QIcon icon() const { return QIcon(); }
44  virtual QString codeTemplate() const { return QString(); }
45  QString whatsThis() const { return QString(); }
46  QString toolTip() const { return QString(); }
47  QString group() const { return "MuseScore Inspector Widgets"; }
48  void initialize(QDesignerFormEditorInterface *);
49  };
50 
51 //---------------------------------------------------------
52 // FontStyleSelectPlugin
53 //---------------------------------------------------------
54 
55 class FontStyleSelectPlugin : public QObject, public InspectorPlugin {
56  Q_OBJECT
57 
58  public:
59  FontStyleSelectPlugin(QObject* parent = 0) : QObject(parent) {}
60  QString includeFile() const { return QString("inspector/fontStyleSelect.h"); }
61  QString name() const { return "Ms::FontStyleSelect"; }
62  QWidget* createWidget(QWidget* parent);
63  };
64 
65 //---------------------------------------------------------
66 // ResetButtonPlugin
67 //---------------------------------------------------------
68 
69 class ResetButtonPlugin : public QObject, public InspectorPlugin {
70  Q_OBJECT
71 
72  public:
73  ResetButtonPlugin(QObject* parent = 0) : QObject(parent) {}
74  QString includeFile() const { return QString("inspector/resetButton.h"); }
75  QString name() const { return "Ms::ResetButton"; }
76  QWidget* createWidget(QWidget* parent);
77  };
78 
79 //---------------------------------------------------------
80 // InspectorPlugins
81 //---------------------------------------------------------
82 
83 class InspectorPlugins : public QObject, public QDesignerCustomWidgetCollectionInterface {
84  Q_OBJECT
85  Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QDesignerCustomWidgetCollectionInterface")
86  Q_INTERFACES(QDesignerCustomWidgetCollectionInterface)
87 
88  public:
90  QList<QDesignerCustomWidgetInterface*> customWidgets() const;
91  };
92 
93 
94 #endif
95 
Definition: inspectorplugin.h:55
bool isInitialized() const
Definition: inspectorplugin.h:42
QIcon icon() const
Definition: inspectorplugin.h:43
bool isContainer() const
Definition: inspectorplugin.h:41
QString includeFile() const
Definition: inspectorplugin.h:60
ResetButtonPlugin(QObject *parent=0)
Definition: inspectorplugin.h:73
int getInt(int byte, int bits)
Definition: ove.cpp:5182
QString name() const
Definition: inspectorplugin.h:75
QString toolTip() const
Definition: inspectorplugin.h:46
Definition: inspectorplugin.h:83
FontStyleSelectPlugin(QObject *parent=0)
Definition: inspectorplugin.h:59
#define VOICES
Definition: mscore.h:72
Definition: inspectorplugin.h:69
static void init()
Definition: mscore.cpp:235
QString name() const
Definition: inspectorplugin.h:61
QString group() const
Definition: inspectorplugin.h:47
Definition: aeolus.cpp:26
QString includeFile() const
Definition: inspectorplugin.h:74
QString whatsThis() const
Definition: inspectorplugin.h:45
virtual QString codeTemplate() const
Definition: inspectorplugin.h:44
static QColor selectColor[VOICES]
Definition: mscore.h:327
Definition: inspectorplugin.h:35
Definition: inspectorplugin.h:25
InspectorPlugin()
Definition: inspectorplugin.h:40