The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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_info
addons_tracking_list
 

Enumerations

enum  ADDON_STATUS {
  ADDON_NONE, ADDON_INSTALLED, ADDON_INSTALLED_UPGRADABLE, ADDON_INSTALLED_OUTDATED,
  ADDON_INSTALLED_BROKEN, ADDON_NOT_TRACKED
}
 Defines various add-on installation statuses. More...
 
enum  ADDON_STATUS_FILTER {
  FILTER_ALL, FILTER_INSTALLED, FILTER_UPGRADABLE, FILTER_NOT_INSTALLED,
  FILTER_COUNT
}
 Add-on installation status filters for the user interface. More...
 
enum  ADDON_SORT { SORT_NAMES, SORT_UPDATED, SORT_CREATED }
 Add-on fallback/default sorting criteria for the user interface. More...
 
enum  ADDON_SORT_DIRECTION { DIRECTION_ASCENDING, DIRECTION_DESCENDING }
 Add-on fallback/default sorting direction. 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

Definition at line 62 of file state.hpp.

Enumeration Type Documentation

enum ADDON_SORT

Add-on fallback/default sorting criteria for the user interface.

Enumerator
SORT_NAMES 

Sort by add-on name.

SORT_UPDATED 

Sort by last upload time.

SORT_CREATED 

Sort by creation time.

Definition at line 93 of file state.hpp.

Add-on fallback/default sorting direction.

Enumerator
DIRECTION_ASCENDING 

Ascending sort.

DIRECTION_DESCENDING 

Descending sort.

Definition at line 102 of file state.hpp.

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_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.

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_NOT_INSTALLED 
FILTER_COUNT 

Definition at line 82 of file state.hpp.

Function Documentation

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 26 of file state.cpp.

References ADDON_INSTALLED, ADDON_INSTALLED_OUTDATED, ADDON_INSTALLED_UPGRADABLE, ADDON_NONE, addon_tracking_info::can_publish, get_addon_pbl_info(), get_addon_version_info(), config::has_attribute(), have_addon_in_vcs_tree(), have_addon_pbl_info(), addon_info::id, addon_tracking_info::in_version_control, addon_tracking_info::installed_version, is_addon_installed(), addon_tracking_info::remote_version, addon_tracking_info::state, and addon_info::version.

Referenced by gui2::taddon_list::pre_show().

bool is_installed_addon_status ( ADDON_STATUS  s)
inline

Definition at line 38 of file state.hpp.

References ADDON_INSTALLED, and ADDON_NOT_TRACKED.