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 <QColor>
26 : #include <QStringList>
27 : #include <QUrl>
28 :
29 : #include "modularity/imoduleinterface.h"
30 : #include "async/channel.h"
31 : #include "async/notification.h"
32 : #include "io/path.h"
33 : #include "types/bytearray.h"
34 :
35 : #include "inotationproject_fwd.h"
36 : #include "types/migrationtypes.h"
37 : #include "types/projecttypes.h"
38 : #include "types/savelocation.h"
39 :
40 : namespace mu::project {
41 : class IProjectConfiguration : MODULE_GLOBAL_INTERFACE
42 : {
43 16 : INTERFACE_ID(IProjectConfiguration)
44 :
45 : public:
46 346 : virtual ~IProjectConfiguration() = default;
47 :
48 : virtual muse::io::path_t recentFilesJsonPath() const = 0;
49 : virtual muse::ByteArray compatRecentFilesData() const = 0;
50 :
51 : virtual muse::io::path_t myFirstProjectPath() const = 0;
52 :
53 : virtual muse::io::paths_t availableTemplateDirs() const = 0;
54 : virtual muse::io::path_t templateCategoriesJsonPath(const muse::io::path_t& templatesDir) const = 0;
55 :
56 : virtual muse::io::path_t userTemplatesPath() const = 0;
57 : virtual void setUserTemplatesPath(const muse::io::path_t& path) = 0;
58 : virtual muse::async::Channel<muse::io::path_t> userTemplatesPathChanged() const = 0;
59 :
60 : virtual muse::io::path_t lastOpenedProjectsPath() const = 0;
61 : virtual void setLastOpenedProjectsPath(const muse::io::path_t& path) = 0;
62 :
63 : virtual muse::io::path_t lastSavedProjectsPath() const = 0;
64 : virtual void setLastSavedProjectsPath(const muse::io::path_t& path) = 0;
65 :
66 : virtual muse::io::path_t userProjectsPath() const = 0;
67 : virtual void setUserProjectsPath(const muse::io::path_t& path) = 0;
68 : virtual muse::async::Channel<muse::io::path_t> userProjectsPathChanged() const = 0;
69 : virtual muse::io::path_t defaultUserProjectsPath() const = 0;
70 :
71 : //! NOTE: best-guess directory to start browsing from in the convert-to-score "open file" dialog
72 : virtual muse::io::path_t defaultConvertFilePath() const = 0;
73 : virtual void setLastOpenedConvertFilePath(const muse::io::path_t& path) = 0;
74 :
75 : virtual bool shouldAskSaveLocationType() const = 0;
76 : virtual void setShouldAskSaveLocationType(bool shouldAsk) = 0;
77 :
78 : virtual bool isCloudProject(const muse::io::path_t& projectPath) const = 0;
79 : virtual bool isLegacyCloudProject(const muse::io::path_t& projectPath) const = 0;
80 : virtual muse::io::path_t cloudProjectPath(int scoreId) const = 0;
81 : virtual int cloudScoreIdFromPath(const muse::io::path_t& projectPath) const = 0;
82 :
83 : virtual muse::io::path_t cloudProjectSavingPath(int scoreId = 0) const = 0;
84 :
85 : virtual muse::io::path_t defaultSavingFilePath(INotationProjectPtr project, const std::string& filenameAddition = "",
86 : const std::string& suffix = "") const = 0;
87 :
88 : virtual SaveLocationType lastUsedSaveLocationType() const = 0;
89 : virtual void setLastUsedSaveLocationType(SaveLocationType type) = 0;
90 :
91 : virtual bool shouldWarnBeforePublish() const = 0;
92 : virtual void setShouldWarnBeforePublish(bool shouldWarn) = 0;
93 :
94 : virtual bool shouldWarnBeforeSavingPubliclyToCloud() const = 0;
95 : virtual void setShouldWarnBeforeSavingPubliclyToCloud(bool shouldWarn) = 0;
96 :
97 : virtual int homeScoresPageTabIndex() const = 0;
98 : virtual void setHomeScoresPageTabIndex(int index) = 0;
99 :
100 : enum class HomeScoresPageViewType {
101 : Grid,
102 : List
103 : };
104 :
105 : virtual HomeScoresPageViewType homeScoresPageViewType() const = 0;
106 : virtual void setHomeScoresPageViewType(HomeScoresPageViewType type) = 0;
107 :
108 : virtual QColor templatePreviewBackgroundColor() const = 0;
109 : virtual muse::async::Notification templatePreviewBackgroundChanged() const = 0;
110 :
111 : enum class PreferredScoreCreationMode {
112 : FromInstruments,
113 : FromTemplate
114 : };
115 :
116 : virtual PreferredScoreCreationMode preferredScoreCreationMode() const = 0;
117 : virtual void setPreferredScoreCreationMode(PreferredScoreCreationMode mode) = 0;
118 :
119 : virtual MigrationOptions migrationOptions(MigrationType type) const = 0;
120 : virtual void setMigrationOptions(MigrationType type, const MigrationOptions& opt, bool persistent = true) = 0;
121 :
122 : virtual bool isAutoSaveEnabled() const = 0;
123 : virtual void setAutoSaveEnabled(bool enabled) = 0;
124 : virtual muse::async::Channel<bool> autoSaveEnabledChanged() const = 0;
125 :
126 : virtual int autoSaveIntervalMinutes() const = 0;
127 : virtual void setAutoSaveInterval(int minutes) = 0;
128 : virtual muse::async::Channel<int> autoSaveIntervalChanged() const = 0;
129 :
130 : virtual bool alsoShareAudioCom() const = 0;
131 : virtual void setAlsoShareAudioCom(bool share) = 0;
132 : virtual muse::async::Channel<bool> alsoShareAudioComChanged() const = 0;
133 :
134 : virtual bool showAlsoShareAudioComDialog() const = 0;
135 : virtual void setShowAlsoShareAudioComDialog(bool show) = 0;
136 :
137 : virtual bool hasAskedAlsoShareAudioCom() const = 0;
138 : virtual void setHasAskedAlsoShareAudioCom(bool has) = 0;
139 :
140 : virtual muse::io::path_t newProjectTemporaryPath() const = 0;
141 :
142 : virtual bool shouldDestinationFolderBeOpenedOnExport() const = 0;
143 : virtual void setShouldDestinationFolderBeOpenedOnExport(bool shouldDestinationFolderBeOpenedOnExport) = 0;
144 :
145 : virtual QUrl supportForumUrl() const = 0;
146 :
147 : virtual QUrl dotComBugReportUrl() const = 0;
148 :
149 : virtual QUrl scoreUploadingGuidelinesUrl() const = 0;
150 : virtual QUrl termsOfUseUrl() const = 0;
151 :
152 : virtual bool openDetailedProjectUploadedDialog() const = 0;
153 : virtual void setOpenDetailedProjectUploadedDialog(bool show) = 0;
154 :
155 : virtual bool hasAskedAudioGenerationSettings() const = 0;
156 : virtual void setHasAskedAudioGenerationSettings(bool has) = 0;
157 :
158 : virtual GenerateAudioTimePeriodType generateAudioTimePeriodType() const = 0;
159 : virtual void setGenerateAudioTimePeriodType(GenerateAudioTimePeriodType type) = 0;
160 : virtual muse::async::Channel<int> generateAudioTimePeriodTypeChanged() const = 0;
161 :
162 : virtual int numberOfSavesToGenerateAudio() const = 0;
163 : virtual void setNumberOfSavesToGenerateAudio(int number) = 0;
164 : virtual muse::async::Channel<int> numberOfSavesToGenerateAudioChanged() const = 0;
165 :
166 : virtual muse::io::path_t temporaryMp3FilePathTemplate() const = 0;
167 :
168 : virtual muse::io::path_t projectBackupPath(const muse::io::path_t& projectPath) const = 0;
169 :
170 : virtual bool showCloudIsNotAvailableWarning() const = 0;
171 : virtual void setShowCloudIsNotAvailableWarning(bool show) = 0;
172 :
173 : virtual bool disableVersionChecking() const = 0;
174 : virtual void setDisableVersionChecking(bool disable) = 0;
175 :
176 : virtual bool createBackupBeforeSaving() const = 0;
177 : virtual void setCreateBackupBeforeSaving(bool create) = 0;
178 :
179 : virtual bool showConvertFileProcessingDialog() const = 0;
180 : virtual void setShowConvertFileProcessingDialog(bool show) = 0;
181 :
182 : virtual muse::io::path_t watchedConvertsJsonPath() const = 0;
183 : };
184 : }
|