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) 2025 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 <memory>
26 :
27 : #include "modularity/imodulesetup.h"
28 :
29 : namespace muse::update {
30 : class AppUpdateScenario;
31 : class AppUpdateService;
32 : class UpdateConfiguration;
33 : class UpdateActionController;
34 : class IUpdateInstaller;
35 : class UpdateModule : public modularity::IModuleSetup
36 : {
37 : public:
38 : std::string moduleName() const override;
39 : void registerExports() override;
40 : void resolveImports() override;
41 : void onInit(const IApplication::RunMode& mode) override;
42 :
43 : modularity::IContextSetup* newContext(const muse::modularity::ContextPtr& ctx) const override;
44 :
45 : private:
46 : std::shared_ptr<UpdateConfiguration> m_configuration;
47 : std::shared_ptr<IUpdateInstaller> m_updateInstaller;
48 : };
49 :
50 : class UpdateContext : public modularity::IContextSetup
51 : {
52 : public:
53 0 : UpdateContext(const muse::modularity::ContextPtr& ctx)
54 0 : : modularity::IContextSetup(ctx) {}
55 :
56 : void registerExports() override;
57 : void resolveImports() override;
58 : void onInit(const IApplication::RunMode& mode) override;
59 : void onDelayedInit() override;
60 :
61 : private:
62 : std::shared_ptr<AppUpdateScenario> m_appUpdateScenario;
63 : std::shared_ptr<AppUpdateService> m_appUpdateService;
64 : std::shared_ptr<UpdateActionController> m_actionController;
65 : };
66 : }
|