Line data Source code
1 : /*
2 : * SPDX-License-Identifier: GPL-3.0-only
3 : * MuseScore-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 : #ifndef MUSE_UI_INAVIGATIONCONTROLLER_H
23 : #define MUSE_UI_INAVIGATIONCONTROLLER_H
24 :
25 : #include "modularity/imoduleinterface.h"
26 : #include "inavigation.h"
27 : #include "async/notification.h"
28 :
29 : namespace muse::ui {
30 : class INavigationController : MODULE_CONTEXT_INTERFACE
31 : {
32 0 : INTERFACE_ID(INavigationController)
33 :
34 : public:
35 34 : virtual ~INavigationController() = default;
36 :
37 : virtual void reg(INavigationSection* section) = 0;
38 : virtual void unreg(INavigationSection* section) = 0;
39 :
40 : virtual bool requestActivateByName(const std::string& section, const std::string& panel, const std::string& controlName) = 0;
41 : virtual bool requestActivateByIndex(const std::string& section, const std::string& panel, const INavigation::Index& controlIndex) = 0;
42 :
43 : virtual void resetNavigation() = 0;
44 :
45 : virtual INavigationSection* activeSection() const = 0;
46 : virtual INavigationPanel* activePanel() const = 0;
47 : virtual INavigationControl* activeControl() const = 0;
48 :
49 : virtual const std::set<INavigationSection*>& sections() const = 0;
50 : virtual const INavigationSection* findSection(const std::string& sectionName) const = 0;
51 : virtual const INavigationPanel* findPanel(const std::string& sectionName, const std::string& panelName) const = 0;
52 : virtual const INavigationControl* findControl(const std::string& sectionName, const std::string& panelName,
53 : const std::string& controlName) const = 0;
54 :
55 : virtual void setDefaultNavigationControl(INavigationControl* control) = 0;
56 : virtual void setPrioritySection(INavigationSection* section) = 0;
57 :
58 : virtual async::Notification navigationChanged() const = 0;
59 :
60 : virtual bool isHighlight() const = 0;
61 : virtual void setIsHighlight(bool isHighlight) = 0;
62 : virtual async::Notification highlightChanged() const = 0;
63 :
64 : virtual void setIsResetOnMousePress(bool arg) = 0;
65 :
66 : virtual void dump() const = 0;
67 : };
68 : }
69 :
70 : #endif // MUSE_UI_INAVIGATIONCONTROLLER_H
|