tbx  0.7.5
Public Types | Public Member Functions | List of all members
tbx::res::ResProgInfo Class Reference

Class to represent a ProgInfo resource. More...

#include <resproginfo.h>

Inheritance diagram for tbx::res::ResProgInfo:
tbx::res::ResObject tbx::res::ResBase

Public Types

enum  { CLASS_ID = 0x82b40 }
 

Public Member Functions

 ResProgInfo (std::string name, bool has_web_button=false)
 Constructor and empty ResProgInfo. More...
 
 ResProgInfo (const ResProgInfo &other)
 Copy constructor. More...
 
 ResProgInfo (const ResObject &other)
 Construct from a ResObject. More...
 
ResProgInfooperator= (const ResProgInfo &other)
 Assignment. More...
 
ResProgInfooperator= (const ResObject &other)
 Assignment from ResObject. More...
 
unsigned int flags () const
 Get all flags as a word raw access. More...
 
void flags (unsigned int value)
 Set all flags as a word. More...
 
bool generate_about_to_be_shown () const
 Check if the about to be shown event should be generated. More...
 
void generate_about_to_be_shown (bool value)
 Set if the about to be shown event should be generated. More...
 
bool generate_dialogue_completed () const
 Check if the dialogue completed event should be generated. More...
 
void generate_dialogue_completed (bool value)
 Set if the dialogue completed event should be generated. More...
 
bool include_licence_type () const
 Check if licence type is included on the dialogue. More...
 
void include_licence_type (bool value)
 Set if licence type is included on the dialogue. More...
 
bool include_web_page_button () const
 Check if the web page button is included on the dialogue. More...
 
bool generate_web_page_click () const
 Check if the web page button generates a click event. More...
 
const char * title () const
 Get the title of the dialogue. More...
 
void title (const char *value, int max_length=-1)
 Set the title of the dialogue. More...
 
void title (const std::string &value, int max_length=-1)
 Set the title of the dialogue. More...
 
int max_title () const
 Get the maximum size the title can be.
 
const char * purpose () const
 Get the purpose.
 
void purpose (const char *value)
 Set the purpose of the application. More...
 
void purpose (const std::string &value)
 Set the purpose of the application. More...
 
const char * author () const
 Get the author.
 
void author (const char *value)
 Set the author of the application. More...
 
void author (const std::string &value)
 Set the author of the application. More...
 
int licence_type () const
 Get the licence type. More...
 
void licence_type (int type)
 Set the licence type. More...
 
const char * version () const
 Get the version.
 
void version (const char *value)
 Set the version of the application. More...
 
void version (const std::string &value)
 Set the version of the application. More...
 
const char * window () const
 Get the name of the window template that provides the window for this object. More...
 
void window (const char *value)
 Set the name of the window template that provides the window for this object. More...
 
void window (const std::string &value)
 Set the name of the window template that provides the window for this object. More...
 
const char * uri () const
 Get URI. More...
 
void uri (const char *value)
 Set URI. More...
 
void uri (const std::string &value)
 Set URI. More...
 
int web_event () const
 Get the event generated for web page click added with version 1.01. More...
 
void web_event (int event_id)
 Set the event generated for web page click added with version 1.01. More...
 
- Public Member Functions inherited from tbx::res::ResObject
 ResObject (const ResObject &other)
 Copy constructor.
 
virtual ~ResObject ()
 Destructor.
 
ResObjectoperator= (const ResObject &other)
 Assignment.
 
bool save (std::ostream &file)
 Save a resource object to a stream. More...
 
const ResObjectHeaderobject_header () const
 Return a pointer to the header information for this object.
 
const char * name () const
 Return pointer to name of object.
 
void name (std::string name)
 Set the name of the object.
 
int class_id () const
 Return class id of object.
 
int object_version () const
 Return version number * 100.
 
void object_version (int new_version)
 Set version for object.
 
unsigned int object_flags () const
 object flags - use methods below for named access to the bits of the flags
 
void object_flags (unsigned int flags)
 Set the object flags for this object. More...
 
bool create_on_load () const
 Get create on load flag. More...
 
void create_on_load (bool value)
 Set if the object should be automatically created when the Resource file is loaded. More...
 
bool show_on_create () const
 Get show on create flags. More...
 
void show_on_create (bool value)
 Set if the object to be automatically shown when it is created. More...
 
bool shared () const
 Get shared flag. More...
 
void shared (bool value)
 Set if the object is to be a shared object. More...
 
bool ancestor () const
 Get ancestor flags. More...
 
void ancestor (bool value)
 Set if the object should be an ancestor object. More...
 
void check_class_id (int class_id) const
 Check if this objects class id is as specified. More...
 
- Public Member Functions inherited from tbx::res::ResBase
 ResBase (const ResBase &other)
 Copy constructor. More...
 
virtual ~ResBase ()
 Destructor.
 
ResBaseoperator= (const ResBase &other)
 Assignment. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from tbx::res::ResObject
static ResObjectload (std::istream &file)
 Load a resource object from a stream. More...
 
static OsSpriteAreaPtr client_sprite_pointer ()
 Get pointer to client sprite area. More...
 
static void client_sprite_pointer (OsSpriteAreaPtr ptr)
 Set Sprite area to use for new and loaded objects.
 
- Protected Member Functions inherited from tbx::res::ResObject
 ResObject (std::string name, int class_id, int version, int object_size)
 Protected constructor for creating a subclass.
 
ResObjectHeaderobject_header ()
 Return a pointer to the header information for this object.
 
void make_writeable ()
 Make object writeable, call before any change. More...
 
ResData * component_data (char *new_body, int offset, int size) const
 Extract a copy of a components data from this object. More...
 
void insert_component (int offset, const ResImpl *comp_impl)
 Insert a component in an object. More...
 
void replace_component (int offset, int old_size, const ResImpl *comp_impl)
 Replace a component. More...
 
void erase_component (int offset, int size)
 Erase a component of the given size. More...
 
- Protected Member Functions inherited from tbx::res::ResBase
 ResBase (ResImpl *impl)
 Create from internal resource implementation. More...
 
const char * string (int offset) const
 Return a string at the given offset. More...
 
void string (int offset, const char *value)
 Set a string at the given offset. More...
 
void string (int offset, std::string value)
 Set a string at the given offset. More...
 
void string_with_length (int offset, const char *value, int length=-1)
 Assign a string where the length is at offset+4. More...
 
void string_with_length (int offset, const std::string &value, int length=-1)
 Assign a string where the length is at offset+4. More...
 
const char * message (int offset) const
 Get the message string at the given offset. More...
 
void message (int offset, const char *value)
 Set a message at the given offset. More...
 
void message (int offset, std::string value)
 Set a message at the given offset. More...
 
void message_with_length (int offset, const char *value, int length=-1)
 Assign a message where the length is at offset+4. More...
 
void message_with_length (int offset, const std::string &value, int length=-1)
 Assign a message where the length is at offset+4. More...
 
int int_value (int offset) const
 Get an integer value. More...
 
void int_value (int offset, int value)
 Set a number at the specified offset. More...
 
unsigned int uint_value (int offset) const
 Get an unsigned integer value. More...
 
void uint_value (int offset, unsigned int value)
 Set an unsigned number at the specified offset. More...
 
unsigned char byte_value (int offset) const
 Get a byte value. More...
 
void byte_value (int offset, unsigned char value)
 Set an unsigned byte (8 bit value) at the specified offset. More...
 
unsigned short ushort_value (int offset) const
 Get a unsigned short value. More...
 
void ushort_value (int offset, unsigned short value)
 Set an unsigned short (16 bit value) at the specified offset. More...
 
bool flag (int offset, int mask) const
 Check if any of the bits in a mask are set. More...
 
void flag (int offset, int mask, bool on)
 Set/clear the bits in mask. More...
 
int flag_value (int offset, int mask) const
 Get the bits for the given mask. More...
 
void flag_value (int offset, int mask, int value)
 Set bits in given mask clearing others. More...
 
void init_string (int offset, const char *value)
 Initialise a string in a constructor helper. More...
 
void init_message (int offset, const char *value)
 Initialise a message in a constructor helper. More...
 
void init_sprite_area_ref (int offset)
 Initialise a sprite area reference. More...
 
void init_object_ref (int offset)
 Initialise an object reference. More...
 
- Protected Attributes inherited from tbx::res::ResBase
ResImpl * _impl
 Internal Resource implementation.
 

Detailed Description

Class to represent a ProgInfo resource.

TODO: New version with web url

Constructor & Destructor Documentation

◆ ResProgInfo() [1/3]

tbx::res::ResProgInfo::ResProgInfo ( std::string  name,
bool  has_web_button = false 
)
inline

Constructor and empty ResProgInfo.

Parameters
nametemplate name of the object
has_web_buttonus newer (version 1.01 item with web page button)

◆ ResProgInfo() [2/3]

tbx::res::ResProgInfo::ResProgInfo ( const ResProgInfo other)
inline

Copy constructor.

Parameters
otherobject to create copy of

◆ ResProgInfo() [3/3]

tbx::res::ResProgInfo::ResProgInfo ( const ResObject other)
inline

Construct from a ResObject.

Parameters
otherobject to create copy of

Member Function Documentation

◆ author() [1/2]

void tbx::res::ResProgInfo::author ( const char *  value)
inline

Set the author of the application.

Parameters
valueauthor of the application

◆ author() [2/2]

void tbx::res::ResProgInfo::author ( const std::string &  value)
inline

Set the author of the application.

Parameters
valueauthor of the application

◆ flags() [1/2]

unsigned int tbx::res::ResProgInfo::flags ( ) const
inline

Get all flags as a word raw access.

Not normally used as there are named methods that allow access to the individual items in the flags

◆ flags() [2/2]

void tbx::res::ResProgInfo::flags ( unsigned int  value)
inline

Set all flags as a word.

Not normally used as there are named methods that allow access to the individual items in the flags

◆ generate_about_to_be_shown() [1/2]

bool tbx::res::ResProgInfo::generate_about_to_be_shown ( ) const
inline

Check if the about to be shown event should be generated.

Returns
true if the about to be shown event should be generated

◆ generate_about_to_be_shown() [2/2]

void tbx::res::ResProgInfo::generate_about_to_be_shown ( bool  value)
inline

Set if the about to be shown event should be generated.

Parameters
valueset to true if the about to be shown event should be generated

◆ generate_dialogue_completed() [1/2]

bool tbx::res::ResProgInfo::generate_dialogue_completed ( ) const
inline

Check if the dialogue completed event should be generated.

Returns
true if the dialogue completed event should be generated

◆ generate_dialogue_completed() [2/2]

void tbx::res::ResProgInfo::generate_dialogue_completed ( bool  value)
inline

Set if the dialogue completed event should be generated.

Parameters
valueset to true if the dialogue completed event should be generated

◆ generate_web_page_click()

bool tbx::res::ResProgInfo::generate_web_page_click ( ) const
inline

Check if the web page button generates a click event.

This property required version 1.01 or later of the ProgInfo Toolbox object.

Returns
true if web page button generates a click event

◆ include_licence_type() [1/2]

bool tbx::res::ResProgInfo::include_licence_type ( ) const
inline

Check if licence type is included on the dialogue.

Returns
true if licence type is included on the dialogue

◆ include_licence_type() [2/2]

void tbx::res::ResProgInfo::include_licence_type ( bool  value)
inline

Set if licence type is included on the dialogue.

Parameters
valueset to true to include licence type on the dialogue

◆ include_web_page_button()

bool tbx::res::ResProgInfo::include_web_page_button ( ) const
inline

Check if the web page button is included on the dialogue.

This property required version 1.01 or later of the ProgInfo Toolbox object.

Returns
true if web page button is included on the dialogue

◆ licence_type() [1/2]

int tbx::res::ResProgInfo::licence_type ( ) const
inline

Get the licence type.

Returns
the licence type

◆ licence_type() [2/2]

void tbx::res::ResProgInfo::licence_type ( int  type)
inline

Set the licence type.

Parameters
typethe new licence type

Can be one of the following values: 0 public domain 1 single user 2 single machine 3 site 4 network 5 authority

◆ operator=() [1/2]

ResProgInfo& tbx::res::ResProgInfo::operator= ( const ResProgInfo other)
inline

Assignment.

Parameters
otherobject to create copy of

◆ operator=() [2/2]

ResProgInfo& tbx::res::ResProgInfo::operator= ( const ResObject other)
inline

Assignment from ResObject.

Parameters
otherobject to create copy of

◆ purpose() [1/2]

void tbx::res::ResProgInfo::purpose ( const char *  value)
inline

Set the purpose of the application.

Parameters
valuepurpose of the application

◆ purpose() [2/2]

void tbx::res::ResProgInfo::purpose ( const std::string &  value)
inline

Set the purpose of the application.

Parameters
valuepurpose of the application

◆ title() [1/3]

const char* tbx::res::ResProgInfo::title ( ) const
inline

Get the title of the dialogue.

Returns
zero terminated string with title or 0 for the default title

◆ title() [2/3]

void tbx::res::ResProgInfo::title ( const char *  value,
int  max_length = -1 
)
inline

Set the title of the dialogue.

Parameters
valuezero terminated string with the title or 0 for the default
max_lengthmaximum length the title will be changed to. -1 (the default) to use the length of the title given.

◆ title() [3/3]

void tbx::res::ResProgInfo::title ( const std::string &  value,
int  max_length = -1 
)
inline

Set the title of the dialogue.

Parameters
valuenew title
max_lengthmaximum length the title will be changed to. -1 (the default) to use the length of the title given.

◆ uri() [1/3]

const char* tbx::res::ResProgInfo::uri ( ) const
inline

Get URI.

This method requires the Proginfo Toolbox object version 1.01 or later

Returns
pointer to zero terminated uri string or "" if prog info version < 1.01 or 0 if none.

◆ uri() [2/3]

void tbx::res::ResProgInfo::uri ( const char *  value)
inline

Set URI.

This method requires the Proginfo Toolbox object version 1.01 or later

Parameters
valuepointer to zero terminated uri string or 0 if none.
Exceptions
std::invalid_argumentif object version is < 1.01

◆ uri() [3/3]

void tbx::res::ResProgInfo::uri ( const std::string &  value)
inline

Set URI.

This method requires the Proginfo Toolbox object version 1.01 or later

Parameters
valuepointer to zero terminated uri string or 0 if none.
Exceptions
std::invalid_argumentif object version is < 1.01

◆ version() [1/2]

void tbx::res::ResProgInfo::version ( const char *  value)
inline

Set the version of the application.

Parameters
valuethe new version string

◆ version() [2/2]

void tbx::res::ResProgInfo::version ( const std::string &  value)
inline

Set the version of the application.

Parameters
valuethe new version string

◆ web_event() [1/2]

int tbx::res::ResProgInfo::web_event ( ) const
inline

Get the event generated for web page click added with version 1.01.

Returns
event ID

◆ web_event() [2/2]

void tbx::res::ResProgInfo::web_event ( int  event_id)
inline

Set the event generated for web page click added with version 1.01.

Parameters
event_idevent ID
Exceptions
std::invalid_argumentif object version is < 1.01

◆ window() [1/3]

const char* tbx::res::ResProgInfo::window ( ) const
inline

Get the name of the window template that provides the window for this object.

Returns
name of window to use or 0 if default internal window will be used

◆ window() [2/3]

void tbx::res::ResProgInfo::window ( const char *  value)
inline

Set the name of the window template that provides the window for this object.

Parameters
valueThe name of window to use or 0 if default internal window will be used

◆ window() [3/3]

void tbx::res::ResProgInfo::window ( const std::string &  value)
inline

Set the name of the window template that provides the window for this object.

Parameters
valueThe name of window to use or 0 if default internal window will be used

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