Line data Source code
1 : /*
2 : * SPDX-License-Identifier: GPL-3.0-only
3 : * MuseScore-Studio-CLA-applies
4 : *
5 : * MuseScore Studio
6 : * Music Composition & Notation
7 : *
8 : * Copyright (C) 2021 MuseScore Limited and others
9 : *
10 : * This program is free software: you can redistribute it and/or modify
11 : * it under the terms of the GNU General Public License version 3 as
12 : * published by the Free Software Foundation.
13 : *
14 : * This program is distributed in the hope that it will be useful,
15 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 : * GNU General Public License for more details.
18 : *
19 : * You should have received a copy of the GNU General Public License
20 : * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 : */
22 : #include "noteinputbarcustomiseitem.h"
23 :
24 : using namespace mu::notation;
25 :
26 0 : NoteInputBarCustomiseItem::NoteInputBarCustomiseItem(const ItemType& type, QObject* parent)
27 0 : : QObject(parent), m_type(type)
28 : {
29 0 : }
30 :
31 0 : QString NoteInputBarCustomiseItem::id() const
32 : {
33 0 : return m_id;
34 : }
35 :
36 0 : QString NoteInputBarCustomiseItem::title() const
37 : {
38 0 : return m_title;
39 : }
40 :
41 0 : NoteInputBarCustomiseItem::ItemType NoteInputBarCustomiseItem::type() const
42 : {
43 0 : return m_type;
44 : }
45 :
46 0 : void NoteInputBarCustomiseItem::setTitle(QString title)
47 : {
48 0 : if (m_title == title) {
49 0 : return;
50 : }
51 :
52 0 : m_title = title;
53 0 : emit titleChanged();
54 : }
55 :
56 0 : void NoteInputBarCustomiseItem::setId(const QString& id)
57 : {
58 0 : m_id = id;
59 0 : }
60 :
61 0 : int NoteInputBarCustomiseItem::icon() const
62 : {
63 0 : return static_cast<int>(m_icon);
64 : }
65 :
66 0 : bool NoteInputBarCustomiseItem::checked() const
67 : {
68 0 : return m_checked;
69 : }
70 :
71 0 : void NoteInputBarCustomiseItem::setIcon(muse::ui::IconCode::Code icon)
72 : {
73 0 : if (m_icon == icon) {
74 0 : return;
75 : }
76 :
77 0 : m_icon = icon;
78 0 : emit iconChanged();
79 : }
80 :
81 0 : void NoteInputBarCustomiseItem::setChecked(bool checked)
82 : {
83 0 : if (m_checked == checked) {
84 0 : return;
85 : }
86 :
87 0 : m_checked = checked;
88 0 : emit checkedChanged(m_checked);
89 : }
|