33#include <NDEVR/SoftwareService.h>
34#include <NDEVR/ItemDownloader.h>
35#include <NDEVR/ApplicationResource.h>
36#include <NDEVR/File.h>
37#include <NDEVR/String.h>
38#include <NDEVR/Time.h>
39#include <NDEVR/TimeSpan.h>
40#include <NDEVR/INIFactory.h>
The default object to store data of any type that should persist through sessions of the application.
ReleaseType
The release maturity level of the application build.
The equivelent of std::vector but with a bit more control.
Logic for reading or writing to a file as well as navigating filesystems or other common file operati...
Contains methods for easily reading and writing to an INI file including efficient casting,...
Software Service Managers take a Software service to modify the behavior of the software.
Base interface for services that extend or modify software behavior through modules.
The core String View class for the NDEVR API.
The core String class for the NDEVR API.
Stores a time span, or difference between two times, with an optional start time.
Represents a timestamp with utilities for manipulation and conversion.
Provides place to set an update checker for checking for software updates.
static void SetApplicationUpdateChecker(UpdateChecker *checker)
Sets the global application update checker.
static Time CompileTime()
Returns the compile time of the application.
static UpdateChecker * ApplicationUpdateChecker()
Returns the global application update checker.
Provides logic for checking a source, typically online, for an update to the software.
ApplicationResource::ReleaseType recommendedReleaseType() const
Returns the recommended release type based on user preference and availability.
void checkForUpdateCompleteSlot()
Slot invoked when the update check network request completes.
void setReleaseTypes(const Buffer< ApplicationResource::ReleaseType > &types)
Sets the available release types for the update checker.
Time lastUpdateCheckTime() const
Returns the time of the last update check.
virtual INIFactory getINI()
Returns an INI factory configured for update settings.
virtual String updateName() const
Returns the file name of the available update.
Time m_last_application_update_check
The time of the last update check.
virtual bool requestInstallUpdate(bool wait_for_completion=false)
Requests installation of the downloaded update.
void checkForUpdateCompletedSignal(UpdateStatus update)
Signal emitted when an update check completes.
void appStartupCheck()
Performs an update check at application startup if enough time has elapsed.
void showUpdateDialogIfNeeded()
Shows a dialog prompting the user to update if one is available.
virtual String defaultURLPathName() const
Returns the default URL path segment used for update requests.
void setUpdateStatus(UpdateStatus status)
Sets the current update status and emits statusChangedSignal.
static ApplicationOption< ApplicationResource::ReleaseType > release_check_type
The user's preferred release type for update checks.
File updateFile() const
Returns the local file path of the downloaded update.
TimeSpan m_max_no_update_time
The maximum allowed time between automatic update checks.
void setMaxNoUpdateTime(const TimeSpan &max_no_update_check_time)
Sets the maximum time between automatic update checks.
String m_current_version
The current application version string.
String m_update_file_name
The file name of the available update.
virtual void requestCheckForUpdate(const StringView ¤t_version=StringView())=0
Initiates an asynchronous check for available updates.
virtual bool updateSupported() const
Returns whether software updates are supported on this platform.
QPointer< ItemDownloader > m_downloader
The downloader managing the update file transfer.
virtual bool updateRequiresApplicationClose() const
Returns whether the update requires closing the application first.
String m_update_url
The download URL for the available update.
virtual String updateVersion() const
Returns the version string of the available update.
File m_download_location
The local file path for downloaded updates.
String m_update_version
The version string of the available update.
UpdateStatus
The possible states of the update check/download lifecycle.
@ e_need_to_check
An update check has not yet been performed.
@ e_update_available_to_download
A new version is available for download.
@ e_update_available_to_install
A downloaded update is ready to install.
@ e_unsupported
Updates are not supported on this platform.
@ e_could_not_connect
Failed to connect to the update server.
@ e_no_new_updates
The software is up to date.
void releaseTypesChangedSignal()
Signal emitted when the available release types change.
virtual void onCheckForUpdateComplete()
Virtual callback invoked when an update check completes.
virtual String updateURLPage() const =0
Returns the URL of the update information page.
uint08 totalDownloadSize() const
Returns the total size of the update download.
virtual String updateURLDownload() const
Returns the direct download URL for the update.
UpdateChecker()
Constructs an UpdateChecker with default settings.
void statusChangedSignal()
Signal emitted when the update status changes.
UpdateStatus updateStatus() const
Returns the current update status.
fltp08 downloadPercent() const
Returns the download progress as a percentage.
virtual void processUpdateString(const String &s)
Parses an update response string to extract version and URL information.
virtual void createUpdateFile(const String &installer_url, File output_location)
Creates an update file from the given installer URL.
Buffer< ApplicationResource::ReleaseType > m_release_types
The available release types.
virtual bool requstDownloadUpdate()
Requests download of the available update.
UpdateChecker(StringView update_version)
Constructs an UpdateChecker with a known current version.
uint08 currentDownloadSize() const
Returns the number of bytes downloaded so far.
void percentChangedSignal()
Signal emitted when download progress changes.
const Buffer< ApplicationResource::ReleaseType > & availableReleaseTypes() const
Returns the list of available release types for this application.
void onUpdateDownloadCompleteSlot()
Slot invoked when the update file download completes.
void updateDownloadCompletedSignal(const File &location)
Signal emitted when an update download completes.
The primary namespace for the NDEVR SDK.
uint64_t uint08
-Defines an alias representing an 8 byte, unsigned integer
double fltp08
Defines an alias representing an 8 byte floating-point number.