MuseScore Plugins  3.5
Plugins API for MuseScore
style.h
1 //=============================================================================
2 // MuseScore
3 // Music Composition & Notation
4 //
5 // Copyright (C) 2020 MuseScore BVBA 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 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 //=============================================================================
19 
20 #ifndef __PLUGIN_API_STYLE_H__
21 #define __PLUGIN_API_STYLE_H__
22 
23 #include "libmscore/style.h"
24 
25 namespace Ms {
26 
27 class Score;
28 
29 namespace PluginAPI {
30 
31 //---------------------------------------------------------
32 // MStyle
45 //---------------------------------------------------------
46 
47 class MStyle : public QObject {
48  Q_OBJECT
49 
50  Ms::MStyle* _style;
51  Ms::Score* _score;
52 
53  static Sid keyToSid(const QString& key);
54 
55  public:
57  MStyle(Ms::MStyle* style, Ms::Score* score)
58  : QObject(), _style(style), _score(score) {}
60 
61  Q_INVOKABLE QVariant value(const QString& key) const;
62  Q_INVOKABLE void setValue(const QString& key, QVariant value);
63  };
64 
65 extern MStyle* wrap(Ms::MStyle*, Ms::Score*);
66 
67 } // namespace PluginAPI
68 } // namespace Ms
69 
70 #endif
Sid
Enumerates the list of score style settings.
Definition: style.h:50
Definition: cursor.cpp:30
Provides an access to score style settings.
Definition: style.h:47
Q_INVOKABLE void setValue(const QString &key, QVariant value)
Sets the value of style setting named key to value.
Definition: style.cpp:86
Q_INVOKABLE QVariant value(const QString &key) const
Returns a value of style setting named key.
Definition: style.cpp:66