Emergency 2017 Dokumentation  v3.0.1
em5::GuiHelper Class Reference

EMERGENCY 5 static GUI helper class. More...

#include <GuiHelper.h>

Static Public Member Functions

static Rocket::Core::String getValueById (Rocket::Core::ElementDocument &document, const Rocket::Core::String &id)
 
static void setValueById (Rocket::Core::ElementDocument &document, const Rocket::Core::String &id, const Rocket::Core::String &value)
 
static void showElementWithVisibility (Rocket::Core::Element &element, bool show)
 
static void showElementByIdWithVisibility (Rocket::Core::ElementDocument &document, const Rocket::Core::String &id, bool show)
 
static void showElementWithDisplay (Rocket::Core::Element &element, bool show)
 
static void showElementByIdWithDisplay (Rocket::Core::ElementDocument &document, const Rocket::Core::String &id, bool show)
 
static void showElementByIdWithHiddenClass (Rocket::Core::ElementDocument &document, const Rocket::Core::String &id, bool show)
 
static Rocket::Core::Element * createElement (Rocket::Core::Element *parentElement, const Rocket::Core::String &tagName, const Rocket::Core::XMLAttributes &attributes)
 
static Rocket::Core::ElementText * getOrCreateTextElement (Rocket::Core::Element *parentElement, bool clearChildsWhenNoTextFoundAsFirstChild=true)
 
static std::string numberStringWithSeparator (uint32 number)
 Convert a number to string with separator. More...
 
static std::string convertStringToUsableFilename (const std::string &filename)
 Replace the signs "/ \ : * ? " < > |" with "_". More...
 
static std::string fixedLength (int value, uint32 digits)
 Convert a uint32 to string with a fix string size. More...
 
static std::string insertWhiteSpaces (uint32 maximumWordLength, const std::string &string)
 Insert white spaces in strings. More...
 
static std::string useHTMLEntities (const std::string &string)
 Replace HTML tags with the corresponding entity. More...
 
static std::string getHexColorWhiteAlpha (float alpha)
 Get a hex color string representation (including '#' at the beginning) from white color with alpha. More...
 
static const qsf::Color3getSystemColor3 ()
 Return the EMERGENCY 5 light blue color usually used everywhere inside the GUI. More...
 
static const qsf::Color4getActionPriorityColorByEntity (const qsf::Entity &entity)
 Return the EMERGENCY 5 action priority color showing e.g. a general unit action state (green, orange, yellow) More...
 
static void selectListElement (const qsf::GuiDocument &document, const std::string &listElementName, Rocket::Core::Element *selectedElement)
 Iterate through all child elements and set the pseudo class "selected" to false, except for the current element which will be set to true. More...
 
static std::string getTimeAsGuiString (const qsf::Time &time)
 Return the given time as string usable inside a GUI. More...
 
static std::string getDisplayNameForMap (const qsf::AssetProxy &mapAssetProxy)
 
static std::string getPreviewImageForMap (const qsf::AssetProxy &mapAssetProxy)
 
static std::string equipmentNameToFilename (const std::string &equipmentName)
 

Static Public Attributes

static const qsf::Color4 IDLE_ACTION_COLOR
 
static const qsf::Color4 BUSY_ACTION_COLOR
 
static const qsf::Color4 BUSY_BLOCKED_ACTION_COLOR
 
static const qsf::Color4 CALCULATING_PATH
 

Detailed Description

EMERGENCY 5 static GUI helper class.

Definition at line 56 of file GuiHelper.h.

Member Function Documentation

static std::string em5::GuiHelper::convertStringToUsableFilename ( const std::string &  filename)
static

Replace the signs "/ \ : * ? " < > |" with "_".

static Rocket::Core::Element* em5::GuiHelper::createElement ( Rocket::Core::Element *  parentElement,
const Rocket::Core::String &  tagName,
const Rocket::Core::XMLAttributes &  attributes 
)
static
static std::string em5::GuiHelper::equipmentNameToFilename ( const std::string &  equipmentName)
static
static std::string em5::GuiHelper::fixedLength ( int  value,
uint32  digits 
)
static

Convert a uint32 to string with a fix string size.

static const qsf::Color4& em5::GuiHelper::getActionPriorityColorByEntity ( const qsf::Entity entity)
static

Return the EMERGENCY 5 action priority color showing e.g. a general unit action state (green, orange, yellow)

static std::string em5::GuiHelper::getDisplayNameForMap ( const qsf::AssetProxy mapAssetProxy)
static
static std::string em5::GuiHelper::getHexColorWhiteAlpha ( float  alpha)
static

Get a hex color string representation (including '#' at the beginning) from white color with alpha.

static Rocket::Core::ElementText* em5::GuiHelper::getOrCreateTextElement ( Rocket::Core::Element *  parentElement,
bool  clearChildsWhenNoTextFoundAsFirstChild = true 
)
static
static std::string em5::GuiHelper::getPreviewImageForMap ( const qsf::AssetProxy mapAssetProxy)
static
static const qsf::Color3& em5::GuiHelper::getSystemColor3 ( )
static

Return the EMERGENCY 5 light blue color usually used everywhere inside the GUI.

static std::string em5::GuiHelper::getTimeAsGuiString ( const qsf::Time time)
static

Return the given time as string usable inside a GUI.

Returns
Time as string usable inside a GUI ("%2d:%02d:%02d" if hours is not zero, else "%02d:%02d")
static Rocket::Core::String em5::GuiHelper::getValueById ( Rocket::Core::ElementDocument &  document,
const Rocket::Core::String &  id 
)
static
static std::string em5::GuiHelper::insertWhiteSpaces ( uint32  maximumWordLength,
const std::string &  string 
)
static

Insert white spaces in strings.

static std::string em5::GuiHelper::numberStringWithSeparator ( uint32  number)
static

Convert a number to string with separator.

Todo:
  • TODO(fw): Better move this into a helper class, as it's useful not only for GUI document classes
static void em5::GuiHelper::selectListElement ( const qsf::GuiDocument document,
const std::string &  listElementName,
Rocket::Core::Element *  selectedElement 
)
static

Iterate through all child elements and set the pseudo class "selected" to false, except for the current element which will be set to true.

Parameters
[in]documentDocument to work on
[in]listElementNameElement which acts as list
[in]selectedElementList element to select, can be a null pointer
static void em5::GuiHelper::setValueById ( Rocket::Core::ElementDocument &  document,
const Rocket::Core::String &  id,
const Rocket::Core::String &  value 
)
static
static void em5::GuiHelper::showElementByIdWithDisplay ( Rocket::Core::ElementDocument &  document,
const Rocket::Core::String &  id,
bool  show 
)
static
static void em5::GuiHelper::showElementByIdWithHiddenClass ( Rocket::Core::ElementDocument &  document,
const Rocket::Core::String &  id,
bool  show 
)
static
static void em5::GuiHelper::showElementByIdWithVisibility ( Rocket::Core::ElementDocument &  document,
const Rocket::Core::String &  id,
bool  show 
)
static
static void em5::GuiHelper::showElementWithDisplay ( Rocket::Core::Element &  element,
bool  show 
)
static
static void em5::GuiHelper::showElementWithVisibility ( Rocket::Core::Element &  element,
bool  show 
)
static
static std::string em5::GuiHelper::useHTMLEntities ( const std::string &  string)
static

Replace HTML tags with the corresponding entity.

Member Data Documentation

const qsf::Color4 em5::GuiHelper::BUSY_ACTION_COLOR
static

Definition at line 65 of file GuiHelper.h.

const qsf::Color4 em5::GuiHelper::BUSY_BLOCKED_ACTION_COLOR
static

Definition at line 66 of file GuiHelper.h.

const qsf::Color4 em5::GuiHelper::CALCULATING_PATH
static

Definition at line 67 of file GuiHelper.h.

const qsf::Color4 em5::GuiHelper::IDLE_ACTION_COLOR
static

Definition at line 64 of file GuiHelper.h.


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