ScummVM
Common::UpdateManager Class Reference

The UpdateManager allows configuring of the automatic update checking for systems that support it: More...

#include <updates.h>

Public Types

enum  UpdateState { kUpdateStateDisabled = 0, kUpdateStateEnabled = 1, kUpdateStateNotSupported = 2 }
 
enum  UpdateInterval { kUpdateIntervalNotSupported = 0, kUpdateIntervalOneDay = 86400, kUpdateIntervalOneWeek = 604800, kUpdateIntervalOneMonth = 2628000 }
 

Public Member Functions

 UpdateManager ()
 
virtual ~UpdateManager ()
 
virtual void checkForUpdates ()
 Checks manually if an update is available, showing progress UI to the user. More...
 
virtual void setAutomaticallyChecksForUpdates (UpdateState state)
 Sets the automatic update checking state. More...
 
virtual UpdateState getAutomaticallyChecksForUpdates ()
 Gets the automatic update checking state. More...
 
virtual void setUpdateCheckInterval (int interval)
 Sets the update checking interval. More...
 
virtual int getUpdateCheckInterval ()
 Gets the update check interval. More...
 
virtual bool getLastUpdateCheckTimeAndDate (TimeDate &t)
 Gets last update check time. More...
 

Static Public Member Functions

static const intgetUpdateIntervals ()
 Returns list of supported uptate intervals. More...
 
static const char * updateIntervalToString (int interval)
 Returns string representation of a given interval. More...
 
static int normalizeInterval (int interval)
 Rounds up the given interval to acceptable value. More...
 

Detailed Description

The UpdateManager allows configuring of the automatic update checking for systems that support it:

  • using Sparkle on Mac OS X
  • using WinSparkle on Windows

Most of the update checking is completely automated and this class only gives access to basic settings. It is mostly used by the GUI to set widgets state on the update page and for manually checking for updates

Definition at line 41 of file updates.h.

Member Enumeration Documentation

◆ UpdateInterval

Enumerator
kUpdateIntervalNotSupported 
kUpdateIntervalOneDay 
kUpdateIntervalOneWeek 
kUpdateIntervalOneMonth 

Definition at line 49 of file updates.h.

◆ UpdateState

Enumerator
kUpdateStateDisabled 
kUpdateStateEnabled 
kUpdateStateNotSupported 

Definition at line 43 of file updates.h.

Constructor & Destructor Documentation

◆ UpdateManager()

Common::UpdateManager::UpdateManager ( )
inline

Definition at line 56 of file updates.h.

◆ ~UpdateManager()

virtual Common::UpdateManager::~UpdateManager ( )
inlinevirtual

Definition at line 57 of file updates.h.

Member Function Documentation

◆ checkForUpdates()

virtual void Common::UpdateManager::checkForUpdates ( )
inlinevirtual

Checks manually if an update is available, showing progress UI to the user.

By default, update checks are done silently on start. This allows to manually start an update check.

Definition at line 65 of file updates.h.

◆ getAutomaticallyChecksForUpdates()

virtual UpdateState Common::UpdateManager::getAutomaticallyChecksForUpdates ( )
inlinevirtual

Gets the automatic update checking state.

Returns
kUpdateStateDisabled if automatic update checking is disabled, kUpdateStateEnabled if automatic update checking is enabled, kUpdateStateNotSupported if automatic update checking is not available

Definition at line 81 of file updates.h.

◆ getLastUpdateCheckTimeAndDate()

virtual bool Common::UpdateManager::getLastUpdateCheckTimeAndDate ( TimeDate t)
inlinevirtual

Gets last update check time.

Parameters
tTimeDate struct to fill out
Returns
flag indicating success

Definition at line 103 of file updates.h.

◆ getUpdateCheckInterval()

virtual int Common::UpdateManager::getUpdateCheckInterval ( )
inlinevirtual

Gets the update check interval.

Returns
the update check interval.

Definition at line 95 of file updates.h.

◆ getUpdateIntervals()

const int * Common::UpdateManager::getUpdateIntervals ( )
static

Returns list of supported uptate intervals.

Ending with '-1' which is not acceptable value.

Returns
list of integer values representing update intervals in seconds.

Definition at line 37 of file updates.cpp.

◆ normalizeInterval()

int Common::UpdateManager::normalizeInterval ( int  interval)
static

Rounds up the given interval to acceptable value.

Parameters
intervalThe interval.
Returns
rounded up interval

Definition at line 41 of file updates.cpp.

◆ setAutomaticallyChecksForUpdates()

virtual void Common::UpdateManager::setAutomaticallyChecksForUpdates ( UpdateState  state)
inlinevirtual

Sets the automatic update checking state.

Parameters
stateThe state.

Definition at line 72 of file updates.h.

◆ setUpdateCheckInterval()

virtual void Common::UpdateManager::setUpdateCheckInterval ( int  interval)
inlinevirtual

Sets the update checking interval.

Parameters
intervalThe interval.

Definition at line 88 of file updates.h.

◆ updateIntervalToString()

const char * Common::UpdateManager::updateIntervalToString ( int  interval)
static

Returns string representation of a given interval.

Parameters
intervalThe interval.
Returns
pointer to localized string of given interval.

Definition at line 53 of file updates.cpp.


The documentation for this class was generated from the following files: