Debian Codegraph @

Source/Core/UICommon/AutoUpdate.h

raw symbols SCIP
1 // Copyright 2018 Dolphin Emulator Project
2 // SPDX-License-Identifier: GPL-2.0-or-later
3
4 #pragma once
5
6 #include <string>
7 #include <string_view>
8
9 // Refer to docs/autoupdate_overview.md for a detailed overview of the autoupdate process
10
11 // This class defines all the logic for Dolphin auto-update checking. UI-specific elements have to
12 // be defined in a backend specific subclass.
13 class AutoUpdateChecker
14 {
15 public:
16 enum class CheckType
17 {
18 Automatic,
19 Manual,
20 };
21 // Initiates a check for updates in the background. Calls the OnUpdateAvailable callback if an
22 // update is available, does "nothing" otherwise.
23 void CheckForUpdate(std::string_view update_track, std::string_view hash_override,
24 CheckType check_type);
25
26 static bool SystemSupportsAutoUpdates();
27
28 struct NewVersionInformation
29 {
30 // Name (5.0-1234) and revision hash of the new version.
31 std::string new_shortrev;
32 std::string new_hash;
33
34 // The full changelog in HTML format.
35 std::string changelog_html;
36
37 // Internals, to be passed to the updater binary.
38 std::string this_manifest_url;
39 std::string next_manifest_url;
40 std::string content_store_url;
41 };
42
43 // Starts the updater process, which will wait in the background until the current process exits.
44 enum class RestartMode
45 {
46 NO_RESTART_AFTER_UPDATE = 0,
47 RESTART_AFTER_UPDATE,
48 };
49 void TriggerUpdate(const NewVersionInformation& info, RestartMode restart_mode);
50
51 protected:
52 virtual void OnUpdateAvailable(const NewVersionInformation& info) = 0;
53 };