Rocket::Core::PropertySpecification Class Reference

#include <PropertySpecification.h>


Public Types

enum  ShorthandType { FALL_THROUGH, REPLICATE, BOX, AUTO }

Public Member Functions

PropertyDefinitionRegisterProperty (const String &property_name, const String &default_value, bool inherited, bool forces_layout)
const PropertyDefinitionGetProperty (const String &property_name) const
void GetRegisteredProperties (PropertyNameList &properties) const
bool RegisterShorthand (const String &shorthand_name, const String &property_names, ShorthandType type=AUTO)
const PropertyShorthandDefinitionGetShorthand (const String &shorthand_name) const
bool ParsePropertyDeclaration (PropertyDictionary &dictionary, const String &property_name, const String &property_value, const String &source_file="", int source_line_number=0) const
void SetPropertyDefaults (PropertyDictionary &dictionary) const

Detailed Description

A property specification stores a group of property definitions.

Author:
Peter Curry

Member Function Documentation

PropertyDefinition & Rocket::Core::PropertySpecification::RegisterProperty ( const String property_name,
const String default_value,
bool  inherited,
bool  forces_layout 
)

Registers a property with a new definition.

Parameters:
[in] property_name The name to register the new property under.
[in] default_value The default value to be used for an element if it has no other definition provided.
[in] inherited True if this property is inherited from parent to child, false otherwise.
[in] forces_layout True if this property requires its parent to be reformatted if changed.
Returns:
The new property definition, ready to have parsers attached.

const PropertyDefinition * Rocket::Core::PropertySpecification::GetProperty ( const String property_name  )  const

Returns a property definition.

Parameters:
[in] property_name The name of the desired property.
Returns:
The appropriate property definition if it could be found, NULL otherwise.

void Rocket::Core::PropertySpecification::GetRegisteredProperties ( PropertyNameList &  properties  )  const

Fetches a list of the names of all registered property definitions.

Parameters:
properties[in] The list to store the property names.

bool Rocket::Core::PropertySpecification::RegisterShorthand ( const String shorthand_name,
const String property_names,
ShorthandType  type = AUTO 
)

Registers a shorthand property definition.

Parameters:
[in] shorthand_name The name to register the new shorthand property under.
[in] properties A comma-separated list of the properties this definition is shorthand for. The order in which they are specified here is the order in which the values will be processed.
[in] type The type of shorthand to declare.
True if all the property names exist, false otherwise.

const PropertyShorthandDefinition * Rocket::Core::PropertySpecification::GetShorthand ( const String shorthand_name  )  const

Returns a shorthand definition.

Parameters:
[in] shorthand_name The name of the desired shorthand.
Returns:
The appropriate shorthand definition if it could be found, NULL otherwise.

bool Rocket::Core::PropertySpecification::ParsePropertyDeclaration ( PropertyDictionary dictionary,
const String property_name,
const String property_value,
const String source_file = "",
int  source_line_number = 0 
) const

Parses a property declaration, setting any parsed and validated properties on the given dictionary.

Parameters:
dictionary The property dictionary which will hold all declared properties.
property_name The name of the declared property.
property_value The values the property is being set to.
Returns:
True if all properties were parsed successfully, false otherwise.

void Rocket::Core::PropertySpecification::SetPropertyDefaults ( PropertyDictionary dictionary  )  const

Sets all undefined properties in the dictionary to their defaults.

Parameters:
dictionary[in] The dictionary to set the default values on.


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