Molybden API
Loading...
Searching...
No Matches
app_update.hpp
1// Copyright (c) 2000-2024 TeamDev. All rights reserved.
2// TeamDev PROPRIETARY and CONFIDENTIAL.
3// Use is subject to license terms.
4
5#ifndef MOLYBDEN_APP_UPDATE_HPP
6#define MOLYBDEN_APP_UPDATE_HPP
7
8#include <memory>
9#include <string>
10
11#include "molybden/app/app_update_events.hpp"
12
13namespace molybden {
14
15class App;
16
24 std::shared_ptr<App> app;
25
29 std::shared_ptr<AppUpdate> app_update;
30
35 std::string error_message;
36};
37
38using CheckForUpdateCallback =
39 std::function<void(const CheckForUpdateResult& args)>;
40
44class AppUpdate : public AppUpdateEvents {
45 public:
49 virtual std::shared_ptr<App> app() = 0;
50
54 virtual std::string version() = 0;
55
70 virtual void install() = 0;
71
75 virtual void dismiss() = 0;
76
77 virtual ~AppUpdate() = default;
78};
79
80} // namespace molybden
81
82#endif // MOLYBDEN_APP_UPDATE_HPP
A class that contains all application update events.
Definition app_update_events.hpp:59
An application update available for download and installation.
Definition app_update.hpp:44
virtual void dismiss()=0
Dismisses the application update if it is not needed.
virtual void install()=0
Downloads and installs the application update.
virtual std::shared_ptr< App > app()=0
The current application.
virtual std::string version()=0
The application version in this update.
The check for update result.
Definition app_update.hpp:20
std::string error_message
The error message text if the update check has been failed or an empty string if there's no error.
Definition app_update.hpp:35
std::shared_ptr< App > app
The current application.
Definition app_update.hpp:24
std::shared_ptr< AppUpdate > app_update
The available application update or an empty object if there's no update.
Definition app_update.hpp:29