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 2389 : DECLARE_CLASSOF(ElementType::ACTION_ICON)
38 :
39 : public:
40 : ActionIcon(DummyParent* parent);
41 0 : ~ActionIcon() override = default;
42 :
43 : ActionIcon* clone() const override;
44 : void setOwnershipParent(EngravingObject*) = delete;
45 :
46 : void setActionType(ActionIconType val);
47 : ActionIconType actionType() const;
48 :
49 : const muse::TranslatableString& title() const;
50 : char16_t icon() const;
51 :
52 0 : const muse::draw::Font& iconFont() const { return m_iconFont; }
53 :
54 : PropertyValue getProperty(Pid) const override;
55 : bool setProperty(Pid, const PropertyValue&) override;
56 :
57 : private:
58 : ActionIconType m_actionType = ActionIconType::UNDEFINED;
59 : muse::TranslatableString m_title;
60 : muse::draw::Font m_iconFont;
61 : };
62 : }
|