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) 2024 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 : #pragma once
23 :
24 : #include <memory>
25 : #include <string>
26 :
27 : #include "global/async/asyncable.h"
28 :
29 : #include "modularity/imodulesetup.h"
30 :
31 : namespace muse::extensions {
32 : class ExtensionsConfiguration;
33 : class ExtensionsRegister;
34 : class ExtensionsModule : public modularity::IModuleSetup, public async::Asyncable
35 : {
36 : public:
37 :
38 : std::string moduleName() const override;
39 : void registerExports() override;
40 : void resolveImports() override;
41 : void registerApi() override;
42 : void onInit(const IApplication::RunMode& mode) override;
43 :
44 : modularity::IContextSetup* newContext(const muse::modularity::ContextPtr& ctx) const override;
45 :
46 : private:
47 :
48 : std::shared_ptr<ExtensionsConfiguration> m_configuration;
49 : std::shared_ptr<ExtensionsRegister> m_extensionsRegister;
50 : };
51 :
52 : class ExtensionsProvider;
53 : class ExtensionsActionController;
54 : class ExtensionsContext : public modularity::IContextSetup
55 : {
56 : public:
57 0 : ExtensionsContext(const muse::modularity::ContextPtr& ctx)
58 0 : : modularity::IContextSetup(ctx) {}
59 :
60 : void registerExports() override;
61 : void resolveImports() override;
62 : void onInit(const IApplication::RunMode& mode) override;
63 :
64 : private:
65 : std::shared_ptr<ExtensionsActionController> m_actionController;
66 : std::shared_ptr<ExtensionsProvider> m_provider;
67 : };
68 : }
|