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 :
23 : #pragma once
24 :
25 : #include "engravingitem.h"
26 :
27 : #include "draw/types/font.h"
28 : #include "global/types/translatablestring.h"
29 :
30 : #include "../types/types.h"
31 :
32 : namespace mu::engraving {
33 : //! Dummy element, used for drag&drop
34 : class ActionIcon final : public EngravingItem
35 : {
36 0 : OBJECT_ALLOCATOR(engraving, ActionIcon)
37 2376 : DECLARE_CLASSOF(ElementType::ACTION_ICON)
38 :
39 : public:
40 : ActionIcon(DummyParentOr<EngravingItem> score);
41 0 : ~ActionIcon() override = default;
42 :
43 : ActionIcon* clone() const override;
44 :
45 : void setActionType(ActionIconType val);
46 : ActionIconType actionType() const;
47 :
48 : const muse::TranslatableString& title() const;
49 : char16_t icon() const;
50 :
51 0 : const muse::draw::Font& iconFont() const { return m_iconFont; }
52 :
53 : PropertyValue getProperty(Pid) const override;
54 : bool setProperty(Pid, const PropertyValue&) override;
55 :
56 : private:
57 : ActionIconType m_actionType = ActionIconType::UNDEFINED;
58 : muse::TranslatableString m_title;
59 : muse::draw::Font m_iconFont;
60 : };
61 : }
|