27 #ifndef _CEGUIFalPropertyLinkDefinition_h_ 28 #define _CEGUIFalPropertyLinkDefinition_h_ 30 #include "CEGUI/falagard/FalagardPropertyBase.h" 31 #include "CEGUI/falagard/XMLHandler.h" 32 #include "CEGUI/IteratorBase.h" 35 #if defined (_MSC_VER) 36 # pragma warning(push) 37 # pragma warning(disable : 4251) 59 const String& targetProperty,
const String& initialValue,
61 bool redrawOnWrite,
bool layoutOnWrite,
66 redrawOnWrite, layoutOnWrite,
67 fireEvent, eventNamespace)
71 if (!widgetName.
empty() || !targetProperty.
empty())
81 d_targets.push_back(std::make_pair(widget,property));
94 bool isTargetProperty(
const String& widget,
const String& property)
const 96 LinkTargetCollection::const_iterator i =
d_targets.begin();
99 if (property == i->second && widget == i->first)
121 typename Helper::safe_method_return_type
124 const LinkTargetCollection::const_iterator i(
d_targets.begin());
126 const Window*
const target_wnd =
135 return Helper::fromString(target_wnd->getProperty(i->second.empty() ?
141 typename Helper::pass_type value)
143 updateLinkTargets(receiver, value);
151 typename Helper::pass_type value)
const 153 LinkTargetCollection::const_iterator i =
d_targets.begin();
163 target_wnd->
setProperty(propertyName, propertyValue);
173 writeFalagardXMLAttributes(xml_stream);
174 writeDefinitionXMLAdditionalAttributes(xml_stream);
178 void writeDefinitionXMLAdditionalAttributes(
XMLSerializer& xml_stream)
const 188 void writeFalagardXMLAttributes(
XMLSerializer& xml_stream)
const 195 LinkTargetCollection::const_iterator i(
d_targets.begin());
200 if (!i->first.empty())
203 if (!i->second.empty())
213 if (!i->first.empty())
216 if (!i->second.empty())
230 return static_cast<const Window*>(receiver);
234 return static_cast<const Window*
>(receiver)->getParent();
236 return static_cast<const Window*
>(receiver)->getChild(name);
244 return const_cast<Window*
>(
245 getTargetWindow(static_cast<const PropertyReceiver*>(receiver), name));
249 typedef std::pair<String,String> StringPair;
259 LinkTargetIterator getLinkTargetIterator()
const 261 return LinkTargetIterator(d_targets.begin(),d_targets.end());
267 #if defined (_MSC_VER) 268 # pragma warning(pop) static const String TargetPropertyAttribute
Attribute name that stores a name of a target property.
Definition: cegui/include/CEGUI/falagard/XMLHandler.h:172
void setProperty(const String &name, const String &value)
Sets the current value of a Property.
Definition: cegui/src/PropertySet.cpp:132
static const String TypeAttribute
Attribute name that stores a type string.
Definition: cegui/include/CEGUI/falagard/XMLHandler.h:152
XMLSerializer & attribute(const String &name, const String &value)
After an opening tag you can populate attribute list with this function.
Definition: XMLSerializer.cpp:104
static const String PropertyLinkDefinitionHelpDefaultValue
Default value for the "type" attribute of PropertyLinkDefinition elements.
Definition: cegui/include/CEGUI/falagard/XMLHandler.h:86
Main namespace for Crazy Eddie's GUI Library.
Definition: cegui/include/CEGUI/Affector.h:42
bool empty(void) const
Returns true if the String is empty.
Definition: cegui/include/CEGUI/String.h:633
void banPropertyFromXML(const String &property_name)
Adds the named property to the XML ban list for this window Essentially a property that is banned fro...
Definition: cegui/src/Window.cpp:2881
static const String ParentIdentifier
String value representing a parent link identifier.
Definition: cegui/include/CEGUI/falagard/XMLHandler.h:93
iterator for vectors
Definition: cegui/include/CEGUI/IteratorBase.h:287
static const String WidgetAttribute
Attribute name that stores the name of a widget (suffix).
Definition: cegui/include/CEGUI/falagard/XMLHandler.h:163
base class for properties able to do native set/get
Definition: cegui/include/CEGUI/TypedProperty.h:49
static const String HelpStringAttribute
Attribute name that stores a help string.
Definition: cegui/include/CEGUI/falagard/XMLHandler.h:179
Window * getTargetWindow(PropertyReceiver *receiver, const String &name) const
Return a pointer to the target window with the given name.
Definition: debian/tmp/usr/include/cegui-0.8.5/CEGUI/falagard/PropertyLinkDefinition.h:241
XMLSerializer & closeTag(void)
Close the current tag.
Definition: XMLSerializer.cpp:75
Class representing a property that links to another property defined on an attached child widget...
Definition: cegui/include/CEGUI/falagard/PropertyLinkDefinition.h:51
Dummy base class to ensure correct casting of receivers.
Definition: cegui/include/CEGUI/Property.h:45
void clearLinkTargets()
clear all link targets from this link definition.
Definition: debian/tmp/usr/include/cegui-0.8.5/CEGUI/falagard/PropertyLinkDefinition.h:86
std::vector< StringPair CEGUI_VECTOR_ALLOC(StringPair)> LinkTargetCollection
type used for the collection of targets.
Definition: debian/tmp/usr/include/cegui-0.8.5/CEGUI/falagard/PropertyLinkDefinition.h:251
An abstract base class providing common functionality and specifying the required interface for deriv...
Definition: cegui/include/CEGUI/Window.h:149
XMLSerializer & openTag(const String &name)
Start a new tag in the xml document.
Definition: XMLSerializer.cpp:51
static const String PropertyAttribute
Attribute name that stores the name of a property.
Definition: cegui/include/CEGUI/falagard/XMLHandler.h:175
const String S_parentIdentifier
Definition: debian/tmp/usr/include/cegui-0.8.5/CEGUI/falagard/PropertyLinkDefinition.h:43
Helper class used to convert various data types to and from the format expected in Property strings...
Definition: cegui/include/CEGUI/ForwardRefs.h:84
void initialisePropertyReceiver(PropertyReceiver *receiver) const
function to allow initialisation of a PropertyReceiver.
Definition: debian/tmp/usr/include/cegui-0.8.5/CEGUI/falagard/PropertyLinkDefinition.h:107
const Window * getTargetWindow(const PropertyReceiver *receiver, const String &name) const
Return a pointer to the target window with the given name.
Definition: cegui/include/CEGUI/falagard/PropertyLinkDefinition.h:226
static const String GenericDataType
Default or unspecified value for the "dataType" attribute.
Definition: cegui/include/CEGUI/falagard/XMLHandler.h:89
static const String PropertyLinkDefinitionElement
Tag name for property link elements.
Definition: cegui/include/CEGUI/falagard/XMLHandler.h:130
An abstract class that defines the interface to access object properties by name. ...
Definition: cegui/include/CEGUI/Property.h:60
Definition: cegui/include/CEGUI/falagard/FalagardPropertyBase.h:36
Class used to create XML Document.
Definition: cegui/include/CEGUI/XMLSerializer.h:85
void addLinkTarget(const String &widget, const String &property)
add a new link target to property on widget (name).
Definition: cegui/include/CEGUI/falagard/PropertyLinkDefinition.h:79
LinkTargetCollection d_targets
collection of targets for this PropertyLinkDefinition.
Definition: cegui/include/CEGUI/falagard/PropertyLinkDefinition.h:254
void writeDefinitionXMLElementType(XMLSerializer &xml_stream) const
Write out the text of the XML element type. Note that you should not write the opening '<' character...
Definition: debian/tmp/usr/include/cegui-0.8.5/CEGUI/falagard/PropertyLinkDefinition.h:170
static const String PropertyLinkTargetElement
Tag name for property link target elements.
Definition: cegui/include/CEGUI/falagard/XMLHandler.h:131
String class used within the GUI system.
Definition: cegui/include/CEGUI/String.h:62