The Battle for Wesnoth  1.19.0-dev
Classes | Typedefs | Enumerations | Functions
state.hpp File Reference
#include "addon/info.hpp"
#include <map>
Include dependency graph for state.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  addon_tracking_info
 Stores additional status information about add-ons. More...
 

Typedefs

typedef std::map< std::string, addon_tracking_infoaddons_tracking_list
 

Enumerations

enum  ADDON_STATUS {
  ADDON_NONE , ADDON_INSTALLED , ADDON_INSTALLED_UPGRADABLE , ADDON_INSTALLED_OUTDATED ,
  ADDON_INSTALLED_LOCAL_ONLY , ADDON_INSTALLED_BROKEN , ADDON_NOT_TRACKED
}
 Defines various add-on installation statuses. More...
 
enum  ADDON_STATUS_FILTER {
  FILTER_ALL , FILTER_INSTALLED , FILTER_UPGRADABLE , FILTER_PUBLISHABLE ,
  FILTER_NOT_INSTALLED , FILTER_COUNT
}
 Add-on installation status filters for the user interface. More...
 

Functions

bool is_installed_addon_status (ADDON_STATUS s)
 
addon_tracking_info get_addon_tracking_info (const addon_info &addon)
 Get information about an add-on comparing its local state with the add-ons server entry. More...
 

Typedef Documentation

◆ addons_tracking_list

typedef std::map<std::string, addon_tracking_info> addons_tracking_list

Definition at line 64 of file state.hpp.

Enumeration Type Documentation

◆ ADDON_STATUS

Defines various add-on installation statuses.

Enumerator
ADDON_NONE 

Add-on is not installed.

ADDON_INSTALLED 

Version in the server matches local installation.

ADDON_INSTALLED_UPGRADABLE 

Version in the server is newer than local installation.

ADDON_INSTALLED_OUTDATED 

Version in the server is older than local installation.

ADDON_INSTALLED_LOCAL_ONLY 

No version in the server.

ADDON_INSTALLED_BROKEN 

Dependencies not satisfied.

Todo:
This option isn't currently implemented!
ADDON_NOT_TRACKED 

No tracking information available.

Definition at line 22 of file state.hpp.

◆ ADDON_STATUS_FILTER

Add-on installation status filters for the user interface.

These are not currently an exact match with the ADDON_STATUS enum type in order to keep the UI aspect simple for the user. This might change later.

Enumerator
FILTER_ALL 
FILTER_INSTALLED 
FILTER_UPGRADABLE 
FILTER_PUBLISHABLE 
FILTER_NOT_INSTALLED 
FILTER_COUNT 

Definition at line 84 of file state.hpp.

Function Documentation

◆ get_addon_tracking_info()

addon_tracking_info get_addon_tracking_info ( const addon_info addon)

Get information about an add-on comparing its local state with the add-ons server entry.

The add-on doesn't need to be locally installed; this is part of the retrieved information.

Parameters
addonThe add-ons server entry information.
Returns
The local tracking status information.

Definition at line 25 of file state.cpp.

References ADDON_INSTALLED, ADDON_INSTALLED_LOCAL_ONLY, ADDON_INSTALLED_OUTDATED, ADDON_INSTALLED_UPGRADABLE, ADDON_NONE, addon_info::current_version, get_addon_pbl_info(), get_addon_version_info(), config::has_attribute(), have_addon_in_vcs_tree(), have_addon_pbl_info(), addon_info::id, is_addon_installed(), addon_info::local_only, t, and addon_info::versions.

Referenced by addons_client::do_resolve_addon_dependencies(), gui2::addon_list::get_remote_addon_id(), gui2::dialogs::addon_manager::load_addon_list(), and gui2::addon_list::set_addons().

◆ is_installed_addon_status()

bool is_installed_addon_status ( ADDON_STATUS  s)
inline