MuseScore Plugins 3.3
Plugins API for MuseScore
Loading...
Searching...
No Matches
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
25namespace Ms {
26
27class Score;
28
29namespace PluginAPI {
30
31//---------------------------------------------------------
32// MStyle
45//---------------------------------------------------------
46
47class 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
65extern MStyle* wrap(Ms::MStyle*, Ms::Score*);
66
67} // namespace PluginAPI
68} // namespace Ms
69
70#endif
Provides an access to score style settings.
Definition style.h:47
Q_INVOKABLE QVariant value(const QString &key) const
Returns a value of style setting named key.
Definition style.cpp:66
Q_INVOKABLE void setValue(const QString &key, QVariant value)
Sets the value of style setting named key to value.
Definition style.cpp:86
Definition cursor.cpp:30
Sid
Enumerates the list of score style settings.
Definition style.h:50