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 "async/channel.h"
26 : #include "async/notification.h"
27 : #include "draw/types/geometry.h"
28 : #include "modularity/ioc.h"
29 :
30 : #include "inotation_fwd.h" // IWYU pragma: export
31 : #include "types/viewmode.h"
32 :
33 : class QString;
34 :
35 : namespace mu::project {
36 : class INotationProject;
37 : }
38 :
39 : namespace mu::notation {
40 : class INotation
41 : {
42 : public:
43 92 : virtual ~INotation() = default;
44 :
45 : virtual const muse::modularity::ContextPtr& iocContext() const = 0;
46 :
47 : virtual project::INotationProject* project() const = 0;
48 : virtual IMasterNotationPtr masterNotation() const = 0;
49 :
50 : /// For MasterScores: the filename without extension
51 : /// For Scores: the excerpt name
52 : virtual QString name() const = 0;
53 :
54 : /// Filename without extension
55 : virtual QString projectName() const = 0;
56 : virtual QString projectNameAndPartName() const = 0;
57 :
58 : /// Title from score meta information; uses filename as fallback
59 : virtual QString workTitle() const = 0;
60 : virtual QString projectWorkTitle() const = 0;
61 : virtual QString projectWorkTitleAndPartName() const = 0;
62 :
63 : virtual bool isOpen() const = 0;
64 : virtual void setIsOpen(bool opened) = 0;
65 : virtual muse::async::Notification openChanged() const = 0;
66 :
67 : virtual bool hasVisibleParts() const = 0;
68 :
69 : virtual bool isMaster() const = 0;
70 :
71 : // draw
72 : virtual ViewMode viewMode() const = 0;
73 : virtual void setViewMode(const ViewMode& viewMode) = 0;
74 : virtual muse::async::Notification viewModeChanged() const = 0;
75 :
76 : virtual INotationPaintingPtr painting() const = 0;
77 : virtual INotationViewStatePtr viewState() const = 0;
78 :
79 : // solo-mute state
80 : virtual INotationSoloMuteStatePtr soloMuteState() const = 0;
81 :
82 : // input (mouse)
83 : virtual INotationInteractionPtr interaction() const = 0;
84 :
85 : // input (midi)
86 : virtual INotationMidiInputPtr midiInput() const = 0;
87 :
88 : // undo stack
89 : virtual INotationUndoStackPtr undoStack() const = 0;
90 :
91 : // styles
92 : virtual INotationStylePtr style() const = 0;
93 :
94 : // elements
95 : virtual INotationElementsPtr elements() const = 0;
96 :
97 : // accessibility
98 : virtual INotationAccessibilityPtr accessibility() const = 0;
99 :
100 : // parts
101 : virtual INotationPartsPtr parts() const = 0;
102 :
103 : // notify
104 : virtual muse::async::Channel<muse::RectF> notationChanged() const = 0;
105 : };
106 :
107 : using INotationPtr = std::shared_ptr<INotation>;
108 : }
|