|
libRocket
|
#include <Element.h>
Public Member Functions | |
| Element (const String &tag) | |
| virtual | ~Element () |
| void | Update () |
| void | Render () |
| Element * | Clone () const |
| Clones this element, returning a new, unparented element. More... | |
| virtual StyleSheet * | GetStyleSheet () const |
| const ElementDefinition * | GetDefinition () |
| String | GetAddress (bool include_pseudo_classes=false) const |
| void | SetOffset (const Vector2f &offset, Element *offset_parent, bool offset_fixed=false) |
| Vector2f | GetRelativeOffset (Box::Area area=Box::CONTENT) |
| Vector2f | GetAbsoluteOffset (Box::Area area=Box::CONTENT) |
| void | SetClientArea (Box::Area client_area) |
| Box::Area | GetClientArea () const |
| void | SetContentBox (const Vector2f &content_offset, const Vector2f &content_box) |
| void | SetBox (const Box &box) |
| void | AddBox (const Box &box) |
| const Box & | GetBox (int index=0) |
| int | GetNumBoxes () |
| virtual float | GetBaseline () const |
| virtual bool | GetIntrinsicDimensions (Vector2f &dimensions) |
| virtual bool | IsPointWithinElement (const Vector2f &point) |
| bool | IsVisible () const |
| float | GetZIndex () const |
| FontFaceHandle * | GetFontFaceHandle () const |
| Element * | GetFocusLeafNode () |
| Context * | GetContext () |
| int | GetClippingIgnoreDepth () |
| Returns true if this element requires clipping. More... | |
| bool | IsClippingEnabled () |
| Returns true if this element has clipping enabled. More... | |
| RenderInterface * | GetRenderInterface () |
| void | SetInstancer (ElementInstancer *instancer) |
| virtual void | ProcessEvent (Event &event) |
| void | UpdateLayout () |
| Update the element's layout if required. More... | |
Classes | |
| void | SetClass (const String &class_name, bool activate) |
| bool | IsClassSet (const String &class_name) const |
| void | SetClassNames (const String &class_names) |
| String | GetClassNames () const |
Properties | |
| bool | SetProperty (const String &name, const String &value) |
| bool | SetProperty (const String &name, const Property &property) |
| void | RemoveProperty (const String &name) |
| const Property * | GetProperty (const String &name) |
| template<typename T > | |
| T | GetProperty (const String &name) |
| const Property * | GetLocalProperty (const String &name) |
| float | ResolveProperty (const String &name, float base_value) |
| float | ResolveProperty (const Property *property, float base_value) |
| void | GetBorderWidthProperties (const Property **border_top_width, const Property **border_bottom_width, const Property **border_left_width, const Property **border_right_width) |
| Returns 'border-width' properties from element's style or local cache. More... | |
| void | GetMarginProperties (const Property **margin_top, const Property **margin_bottom, const Property **margin_left, const Property **margin_right) |
| Returns 'margin' properties from element's style or local cache. More... | |
| void | GetPaddingProperties (const Property **padding_top, const Property **padding_bottom, const Property **padding_left, const Property **padding_right) |
| Returns 'padding' properties from element's style or local cache. More... | |
| void | GetDimensionProperties (const Property **width, const Property **height) |
| Returns 'width' and 'height' properties from element's style or local cache. More... | |
| void | GetLocalDimensionProperties (const Property **width, const Property **height) |
| void | GetOverflow (int *overflow_x, int *overflow_y) |
| Returns 'overflow' properties' values from element's style or local cache. More... | |
| int | GetPosition () |
| Returns 'position' property value from element's style or local cache. More... | |
| int | GetFloat () |
| Returns 'float' property value from element's style or local cache. More... | |
| int | GetDisplay () |
| Returns 'display' property value from element's style or local cache. More... | |
| int | GetWhitespace () |
| Returns 'white-space' property value from element's style or local cache. More... | |
| const Property * | GetLineHeightProperty () |
| Returns 'line-height' property value from element's style or local cache. More... | |
| int | GetTextAlign () |
| Returns 'text-align' property value from element's style or local cache. More... | |
| int | GetTextTransform () |
| Returns 'text-transform' property value from element's style or local cache. More... | |
| const Property * | GetVerticalAlignProperty () |
| Returns 'vertical-align' property value from element's style or local cache. More... | |
| bool | IterateProperties (int &index, PseudoClassList &pseudo_classes, String &name, const Property *&property) const |
Pseudo-classes | |
| void | SetPseudoClass (const String &pseudo_class, bool activate) |
| bool | IsPseudoClassSet (const String &pseudo_class) const |
| bool | ArePseudoClassesSet (const PseudoClassList &pseudo_classes) const |
| const PseudoClassList & | GetActivePseudoClasses () const |
Attributes | |
| template<typename T > | |
| void | SetAttribute (const String &name, const T &value) |
| Variant * | GetAttribute (const String &name) const |
| template<typename T > | |
| T | GetAttribute (const String &name, const T &default_value) const |
| bool | HasAttribute (const String &name) |
| void | RemoveAttribute (const String &name) |
| void | SetAttributes (const ElementAttributes *attributes) |
| template<typename T > | |
| bool | IterateAttributes (int &index, String &name, T &value) const |
| int | GetNumAttributes () const |
Decorators | |
| bool | IterateDecorators (int &index, PseudoClassList &pseudo_classes, String &name, Decorator *&decorator, DecoratorDataHandle &decorator_data) |
DOM Properties | |
| const String & | GetTagName () const |
| const String & | GetId () const |
| void | SetId (const String &id) |
| float | GetAbsoluteLeft () |
| float | GetAbsoluteTop () |
| float | GetClientLeft () |
| float | GetClientTop () |
| float | GetClientWidth () |
| float | GetClientHeight () |
| Element * | GetOffsetParent () |
| float | GetOffsetLeft () |
| float | GetOffsetTop () |
| float | GetOffsetWidth () |
| float | GetOffsetHeight () |
| float | GetScrollLeft () |
| void | SetScrollLeft (float scroll_left) |
| float | GetScrollTop () |
| void | SetScrollTop (float scroll_top) |
| float | GetScrollWidth () |
| float | GetScrollHeight () |
| ElementStyle * | GetStyle () |
| virtual ElementDocument * | GetOwnerDocument () |
| Element * | GetParentNode () const |
| Element * | GetNextSibling () const |
| Element * | GetPreviousSibling () const |
| Element * | GetFirstChild () const |
| Element * | GetLastChild () const |
| Element * | GetChild (int index) const |
| int | GetNumChildren (bool include_non_dom_elements=false) const |
| virtual void | GetInnerRML (String &content) const |
| String | GetInnerRML () const |
| void | SetInnerRML (const String &rml) |
DOM Methods | |
| bool | Focus () |
| void | Blur () |
| Removes focus from from this element. More... | |
| void | Click () |
| Fakes a mouse click on this element. More... | |
| void | AddEventListener (const String &event, EventListener *listener, bool in_capture_phase=false) |
| void | RemoveEventListener (const String &event, EventListener *listener, bool in_capture_phase=false) |
| bool | DispatchEvent (const String &event, const Dictionary ¶meters, bool interruptible=false) |
| void | ScrollIntoView (bool align_with_top=true) |
| void | AppendChild (Element *element, bool dom_element=true) |
| void | InsertBefore (Element *element, Element *adjacent_element) |
| bool | ReplaceChild (Element *inserted_element, Element *replaced_element) |
| bool | RemoveChild (Element *element) |
| bool | HasChildNodes () const |
| Element * | GetElementById (const String &id) |
| void | GetElementsByTagName (ElementList &elements, const String &tag) |
| void | GetElementsByClassName (ElementList &elements, const String &class_name) |
Internal Functions | |
| EventDispatcher * | GetEventDispatcher () const |
| ElementBackground * | GetElementBackground () const |
| ElementBorder * | GetElementBorder () const |
| ElementDecoration * | GetElementDecoration () const |
| ElementScroll * | GetElementScroll () const |
Public Member Functions inherited from Rocket::Core::ScriptInterface | |
| virtual | ~ScriptInterface () |
| virtual ScriptObject | GetScriptObject () const |
Public Member Functions inherited from Rocket::Core::ReferenceCountable | |
| ReferenceCountable (int initial_count=1) | |
| virtual | ~ReferenceCountable () |
| Destructor. The reference count must be 0 when this is invoked. More... | |
| virtual int | GetReferenceCount () |
| Returns the number of references outstanding against this object. More... | |
| virtual void | AddReference () |
| Increases the reference count. If this pushes the count above 0, OnReferenceActivate() will be called. More... | |
| virtual void | RemoveReference () |
| Decreases the reference count. If this pushes the count to 0, OnReferenceDeactivate() will be called. More... | |
| ReferenceCountable & | operator= (const ReferenceCountable ©) |
| Catches incorrect copy attempts. More... | |
Protected Member Functions | |
| void | ForceLocalStackingContext () |
| virtual void | OnUpdate () |
| Called during the update loop after children are updated. More... | |
| virtual void | OnRender () |
| Called during render after backgrounds, borders, decorators, but before children, are rendered. More... | |
| virtual void | OnLayout () |
| Called during a layout operation, when the element is being positioned and sized. More... | |
| virtual void | OnAttributeChange (const AttributeNameList &changed_attributes) |
| virtual void | OnPropertyChange (const PropertyNameList &changed_properties) |
| virtual void | OnChildAdd (Element *child) |
| Called when a child node has been added somewhere in the hierarchy. More... | |
| virtual void | OnChildRemove (Element *child) |
| Called when a child node has been removed somewhere in the hierarchy. More... | |
| virtual void | DirtyLayout () |
| Forces a re-layout of this element, and any other elements required. More... | |
| virtual bool | IsLayoutDirty () |
| Returns true if the element has been marked as needing a re-layout. More... | |
| virtual void | LockLayout (bool lock) |
| Increment/Decrement the layout lock. More... | |
| virtual void | DirtyFont () |
| Forces a reevaluation of applicable font effects. More... | |
| virtual void | GetRML (String &content) |
| virtual void | OnReferenceDeactivate () |
| A hook method called when the reference count drops to 0. More... | |
Protected Member Functions inherited from Rocket::Core::ReferenceCountable | |
| virtual void | OnReferenceActivate () |
| A hook method called when the reference count climbs from 0. More... | |
Friends | |
| class | Context |
| class | ElementStyle |
| class | LayoutEngine |
| class | LayoutInlineBox |
Additional Inherited Members | |
Static Public Member Functions inherited from Rocket::Core::ReferenceCountable | |
| static void | DumpLeakReport () |
| If any reference countable objects are still allocated, this function will write a leak report to the log. More... | |
A generic element in the DOM tree.
| Rocket::Core::Element::Element | ( | const String & | tag | ) |
Constructs a new libRocket element. This should not be called directly; use the Factory instead.
| [in] | tag | The tag the element was declared as in RML. |
|
virtual |
| void Rocket::Core::Element::AddBox | ( | const Box & | box | ) |
Adds a box to the end of the list describing this element's geometry.
| [in] | box | The auxiliary box for the element. |
| void Rocket::Core::Element::AddEventListener | ( | const String & | event, |
| EventListener * | listener, | ||
| bool | in_capture_phase = false |
||
| ) |
Adds an event listener to this element.
| [in] | event | Event to attach to. |
| [in] | listener | The listener object to be attached. |
| [in] | in_capture_phase | True to attach in the capture phase, false in bubble phase. |
| void Rocket::Core::Element::AppendChild | ( | Element * | element, |
| bool | dom_element = true |
||
| ) |
Append a child to this element.
| [in] | element | The element to append as a child. |
| [in] | dom_element | True if the element is to be part of the DOM, false otherwise. Only set this to false if you know what you're doing! |
| bool Rocket::Core::Element::ArePseudoClassesSet | ( | const PseudoClassList & | pseudo_classes | ) | const |
Checks if a complete set of pseudo-classes are set on the element.
| [in] | pseudo_classes | The set of pseudo-classes to check for. |
| void Rocket::Core::Element::Blur | ( | ) |
Removes focus from from this element.
| void Rocket::Core::Element::Click | ( | ) |
Fakes a mouse click on this element.
| Element* Rocket::Core::Element::Clone | ( | ) | const |
Clones this element, returning a new, unparented element.
|
protectedvirtual |
Forces a reevaluation of applicable font effects.
|
protectedvirtual |
Forces a re-layout of this element, and any other elements required.
Reimplemented in Rocket::Core::ElementDocument.
| bool Rocket::Core::Element::DispatchEvent | ( | const String & | event, |
| const Dictionary & | parameters, | ||
| bool | interruptible = false |
||
| ) |
Sends an event to this element.
| [in] | event | Name of the event in string form. |
| [in] | parameters | The event parameters. |
| [in] | interruptible | True if the propagation of the event be stopped. |
| bool Rocket::Core::Element::Focus | ( | ) |
Gives focus to the current element.
|
protected |
Forces the element to generate a local stacking context, regardless of the value of its z-index property.
| float Rocket::Core::Element::GetAbsoluteLeft | ( | ) |
Gets the horizontal offset from the context's left edge to element's left border edge.
| Vector2f Rocket::Core::Element::GetAbsoluteOffset | ( | Box::Area | area = Box::CONTENT | ) |
Returns the position of the top-left corner of one of the areas of this element's primary box, relative to the element root.
| [in] | area | The desired area position. |
| float Rocket::Core::Element::GetAbsoluteTop | ( | ) |
Gets the vertical offset from the context's top edge to element's top border edge.
| const PseudoClassList& Rocket::Core::Element::GetActivePseudoClasses | ( | ) | const |
Gets a list of the current active pseudo-classes.
| String Rocket::Core::Element::GetAddress | ( | bool | include_pseudo_classes = false | ) | const |
Fills a string with the full address of this element.
| [in] | include_pseudo_classes | True if the address is to include the pseudo-classes of the leaf element. |
Gets the specified attribute.
| [in] | name | Name of the attribute to retrieve. |
| T Rocket::Core::Element::GetAttribute | ( | const String & | name, |
| const T & | default_value | ||
| ) | const |
Gets the specified attribute, with default value.
| [in] | name | Name of the attribute to retrieve. |
| [in] | default_value | Value to return if the attribute doesn't exist. |
|
virtual |
Returns the baseline of the element, in pixels offset from the bottom of the element's content area.
| void Rocket::Core::Element::GetBorderWidthProperties | ( | const Property ** | border_top_width, |
| const Property ** | border_bottom_width, | ||
| const Property ** | border_left_width, | ||
| const Property ** | border_right_width | ||
| ) |
Returns 'border-width' properties from element's style or local cache.
| const Box& Rocket::Core::Element::GetBox | ( | int | index = 0 | ) |
Returns one of the boxes describing the size of the element.
| [in] | index | The index of the desired box. If this is outside of the bounds of the element's list of boxes, it will be clamped. |
| Element* Rocket::Core::Element::GetChild | ( | int | index | ) | const |
Get the child element at the given index.
| [in] | index | Index of child to get. |
| String Rocket::Core::Element::GetClassNames | ( | ) | const |
Return the active class list.
| Box::Area Rocket::Core::Element::GetClientArea | ( | ) | const |
Returns the area the element uses as its client area.
| float Rocket::Core::Element::GetClientHeight | ( | ) |
Gets the height of the element's client area. This is usually the padded area less the horizontal scrollbar height, but may be the content area for some replaced elements.
| float Rocket::Core::Element::GetClientLeft | ( | ) |
Gets the horizontal offset from the element's left border edge to the left edge of its client area. This is usually the edge of the padding, but may be the content area for some replaced elements.
| float Rocket::Core::Element::GetClientTop | ( | ) |
Gets the vertical offset from the element's top border edge to the top edge of its client area. This is usually the edge of the padding, but may be the content area for some replaced elements.
| float Rocket::Core::Element::GetClientWidth | ( | ) |
Gets the width of the element's client area. This is usually the padded area less the vertical scrollbar width, but may be the content area for some replaced elements.
| int Rocket::Core::Element::GetClippingIgnoreDepth | ( | ) |
Returns true if this element requires clipping.
| Context* Rocket::Core::Element::GetContext | ( | ) |
Returns the element's context.
| const ElementDefinition* Rocket::Core::Element::GetDefinition | ( | ) |
Returns the element's definition, updating if necessary.
| void Rocket::Core::Element::GetDimensionProperties | ( | const Property ** | width, |
| const Property ** | height | ||
| ) |
Returns 'width' and 'height' properties from element's style or local cache.
| int Rocket::Core::Element::GetDisplay | ( | ) |
Returns 'display' property value from element's style or local cache.
| ElementBackground* Rocket::Core::Element::GetElementBackground | ( | ) | const |
Access the element background.
| ElementBorder* Rocket::Core::Element::GetElementBorder | ( | ) | const |
Access the element border.
Get a child element by its ID.
| [in] | id | Id of the the child element |
| ElementDecoration* Rocket::Core::Element::GetElementDecoration | ( | ) | const |
Access the element decorators.
| void Rocket::Core::Element::GetElementsByClassName | ( | ElementList & | elements, |
| const String & | class_name | ||
| ) |
Get all descendant elements with the given class set on them.
| [out] | elements | Resulting elements. |
| [in] | tag | Tag to search for. |
| void Rocket::Core::Element::GetElementsByTagName | ( | ElementList & | elements, |
| const String & | tag | ||
| ) |
Get all descendant elements with the given tag.
| [out] | elements | Resulting elements. |
| [in] | tag | Tag to search for. |
| ElementScroll* Rocket::Core::Element::GetElementScroll | ( | ) | const |
Returns the element's scrollbar functionality.
| EventDispatcher* Rocket::Core::Element::GetEventDispatcher | ( | ) | const |
Access the event dispatcher for this element.
| Element* Rocket::Core::Element::GetFirstChild | ( | ) | const |
Returns the first child of this element.
| int Rocket::Core::Element::GetFloat | ( | ) |
Returns 'float' property value from element's style or local cache.
| Element* Rocket::Core::Element::GetFocusLeafNode | ( | ) |
Gets the outer-most focus element down the tree from this node.
| FontFaceHandle* Rocket::Core::Element::GetFontFaceHandle | ( | ) | const |
Returns the element's font face handle.
| const String& Rocket::Core::Element::GetId | ( | ) | const |
Gets the id of the element.
|
virtual |
Gets the markup and content of the element.
| [out] | content | The content of the element. |
Reimplemented in Rocket::Controls::ElementDataGrid, and Rocket::Controls::ElementFormControlTextArea.
| String Rocket::Core::Element::GetInnerRML | ( | ) | const |
Gets the markup and content of the element.
|
virtual |
Gets the intrinsic dimensions of this element, if it is of a type that has an inherent size. This size will only be overriden by a styled width or height.
| [in] | dimensions | The dimensions to size, if appropriate. |
Reimplemented in Rocket::Controls::ElementFormControlSelect, Rocket::Controls::ElementFormControlTextArea, and Rocket::Controls::ElementFormControlInput.
| Element* Rocket::Core::Element::GetLastChild | ( | ) | const |
Gets the last child of this element.
| const Property* Rocket::Core::Element::GetLineHeightProperty | ( | ) |
Returns 'line-height' property value from element's style or local cache.
| void Rocket::Core::Element::GetLocalDimensionProperties | ( | const Property ** | width, |
| const Property ** | height | ||
| ) |
Returns local 'width' and 'height' properties from element's style or local cache, ignoring default values.
Returns one of this element's properties. If this element is not defined this property, NULL will be returned.
| [in] | name | The name of the property to fetch the value for. |
| void Rocket::Core::Element::GetMarginProperties | ( | const Property ** | margin_top, |
| const Property ** | margin_bottom, | ||
| const Property ** | margin_left, | ||
| const Property ** | margin_right | ||
| ) |
Returns 'margin' properties from element's style or local cache.
| Element* Rocket::Core::Element::GetNextSibling | ( | ) | const |
Gets the element immediately following this one in the tree.
| int Rocket::Core::Element::GetNumAttributes | ( | ) | const |
Returns the number of attributes on the element.
| int Rocket::Core::Element::GetNumBoxes | ( | ) |
Returns the number of boxes making up this element's geometry.
| int Rocket::Core::Element::GetNumChildren | ( | bool | include_non_dom_elements = false | ) | const |
Get the current number of children in this element
| [in] | include_non_dom_elements | True if the caller wants to include the non DOM children. Only set this to true if you know what you're doing! |
| float Rocket::Core::Element::GetOffsetHeight | ( | ) |
Gets the height of the element, including the client area, padding, borders and scrollbars, but not margins.
| float Rocket::Core::Element::GetOffsetLeft | ( | ) |
Gets the distance from this element's left border to its offset parent's left border.
| Element* Rocket::Core::Element::GetOffsetParent | ( | ) |
Returns the element from which all offset calculations are currently computed.
| float Rocket::Core::Element::GetOffsetTop | ( | ) |
Gets the distance from this element's top border to its offset parent's top border.
| float Rocket::Core::Element::GetOffsetWidth | ( | ) |
Gets the width of the element, including the client area, padding, borders and scrollbars, but not margins.
| void Rocket::Core::Element::GetOverflow | ( | int * | overflow_x, |
| int * | overflow_y | ||
| ) |
Returns 'overflow' properties' values from element's style or local cache.
|
virtual |
Gets the document this element belongs to.
Reimplemented in Rocket::Core::ElementDocument.
| void Rocket::Core::Element::GetPaddingProperties | ( | const Property ** | padding_top, |
| const Property ** | padding_bottom, | ||
| const Property ** | padding_left, | ||
| const Property ** | padding_right | ||
| ) |
Returns 'padding' properties from element's style or local cache.
| Element* Rocket::Core::Element::GetParentNode | ( | ) | const |
Gets this element's parent node.
| int Rocket::Core::Element::GetPosition | ( | ) |
Returns 'position' property value from element's style or local cache.
| Element* Rocket::Core::Element::GetPreviousSibling | ( | ) | const |
Gets the element immediately preceding this one in the tree.
Returns one of this element's properties. If this element is not defined this property, or a parent cannot be found that we can inherit the property from, the default value will be returned.
| [in] | name | The name of the property to fetch the value for. |
| T Rocket::Core::Element::GetProperty | ( | const String & | name | ) |
Returns the values of one of this element's properties.
| [in] | name | The name of the property to get. |
| Vector2f Rocket::Core::Element::GetRelativeOffset | ( | Box::Area | area = Box::CONTENT | ) |
Returns the position of the top-left corner of one of the areas of this element's primary box, relative to its offset parent's top-left border corner.
| [in] | area | The desired area position. |
| RenderInterface* Rocket::Core::Element::GetRenderInterface | ( | ) |
Gets the render interface owned by this element's context.
|
protectedvirtual |
Returns the RML of this element and all children.
| [out] | content | The content of this element and those under it, in XML form. |
| float Rocket::Core::Element::GetScrollHeight | ( | ) |
Gets the height of the scrollable content of the element; it includes the element padding but not its margin.
| float Rocket::Core::Element::GetScrollLeft | ( | ) |
Gets the left scroll offset of the element.
| float Rocket::Core::Element::GetScrollTop | ( | ) |
Gets the top scroll offset of the element.
| float Rocket::Core::Element::GetScrollWidth | ( | ) |
Gets the width of the scrollable content of the element; it includes the element padding but not its margin.
| ElementStyle* Rocket::Core::Element::GetStyle | ( | ) |
Gets the object representing the declarations of an element's style attributes.
|
virtual |
Returns the active style sheet for this element. This may be NULL.
Reimplemented in Rocket::Core::ElementDocument.
| const String& Rocket::Core::Element::GetTagName | ( | ) | const |
Gets the name of the element.
| int Rocket::Core::Element::GetTextAlign | ( | ) |
Returns 'text-align' property value from element's style or local cache.
| int Rocket::Core::Element::GetTextTransform | ( | ) |
Returns 'text-transform' property value from element's style or local cache.
| const Property* Rocket::Core::Element::GetVerticalAlignProperty | ( | ) |
Returns 'vertical-align' property value from element's style or local cache.
| int Rocket::Core::Element::GetWhitespace | ( | ) |
Returns 'white-space' property value from element's style or local cache.
| float Rocket::Core::Element::GetZIndex | ( | ) | const |
Returns the z-index of the element.
| bool Rocket::Core::Element::HasAttribute | ( | const String & | name | ) |
Checks if the element has a certain attribute.
| [in] | name | The name of the attribute to check for. |
| bool Rocket::Core::Element::HasChildNodes | ( | ) | const |
Returns whether or not this element has any DOM children.
Adds a child to this element, directly after the adjacent element. The new element inherits the DOM/non-DOM status from the adjacent element.
| [in] | element | Element to insert into the this element. |
| [in] | adjacent_element | The element to insert directly before. |
| bool Rocket::Core::Element::IsClassSet | ( | const String & | class_name | ) | const |
Checks if a class is set on the element.
| [in] | class_name | The name of the class to check for. |
| bool Rocket::Core::Element::IsClippingEnabled | ( | ) |
Returns true if this element has clipping enabled.
|
protectedvirtual |
Returns true if the element has been marked as needing a re-layout.
Reimplemented in Rocket::Core::ElementDocument.
|
virtual |
Checks if a given point in screen coordinates lies within the bordered area of this element.
| [in] | point | The point to test. |
| bool Rocket::Core::Element::IsPseudoClassSet | ( | const String & | pseudo_class | ) | const |
Checks if a specific pseudo-class has been set on the element.
| [in] | pseudo_class | The name of the pseudo-class to check for. |
| bool Rocket::Core::Element::IsVisible | ( | ) | const |
Returns the visibility of the element.
| bool Rocket::Core::Element::IterateAttributes | ( | int & | index, |
| String & | name, | ||
| T & | value | ||
| ) | const |
Iterates over the attributes.
| [in,out] | index | Index to fetch. This is incremented after the fetch. |
| [out] | name | Name of the attribute at the specified index |
| [out] | value | Value of the attribute at the specified index. |
| bool Rocket::Core::Element::IterateDecorators | ( | int & | index, |
| PseudoClassList & | pseudo_classes, | ||
| String & | name, | ||
| Decorator *& | decorator, | ||
| DecoratorDataHandle & | decorator_data | ||
| ) |
Iterates over all decorators attached to the element. Note that all decorators are iterated over, not just active ones.
| [in,out] | index | Index to fetch. This is incremented after the fetch. |
| [out] | pseudo_classes | The pseudo-classes the decorator required to be active before it renders. |
| [out] | name | The name of the decorator at the specified index. |
| [out] | decorator | The decorator at the specified index. |
| [out] | decorator_data | This element's handle to any data is has stored against the decorator. |
| bool Rocket::Core::Element::IterateProperties | ( | int & | index, |
| PseudoClassList & | pseudo_classes, | ||
| String & | name, | ||
| const Property *& | property | ||
| ) | const |
Iterates over the properties defined on this element.
| [in,out] | index | Index of the property to fetch. This is incremented to the next valid index after the fetch. Indices are not necessarily incremental. |
| [out] | pseudo_classes | The pseudo-classes the property is defined by. |
| [out] | name | The name of the property at the specified index. |
| [out] | property | The property at the specified index. |
|
protectedvirtual |
Increment/Decrement the layout lock.
Reimplemented in Rocket::Core::ElementDocument.
|
protectedvirtual |
Called when attributes on the element are changed.
| [in] | changed_attributes | The attributes changed on the element. |
Reimplemented in Rocket::Controls::ElementFormControlTextArea, Rocket::Controls::ElementFormControl, Rocket::Controls::ElementFormControlInput, and Rocket::Controls::ElementFormControlDataSelect.
|
protectedvirtual |
Called when a child node has been added somewhere in the hierarchy.
Reimplemented in Rocket::Controls::ElementTabSet, and Rocket::Controls::ElementFormControlInput.
|
protectedvirtual |
Called when a child node has been removed somewhere in the hierarchy.
Reimplemented in Rocket::Controls::ElementTabSet, and Rocket::Controls::ElementFormControlInput.
|
protectedvirtual |
Called during a layout operation, when the element is being positioned and sized.
Reimplemented in Rocket::Controls::ElementFormControlTextArea, and Rocket::Controls::ElementFormControlSelect.
|
protectedvirtual |
Called when properties on the element are changed.
| [in] | changed_properties | The properties changed on the element. |
Reimplemented in Rocket::Core::ElementDocument, Rocket::Controls::ElementFormControlTextArea, and Rocket::Controls::ElementFormControlInput.
|
protectedvirtual |
A hook method called when the reference count drops to 0.
Reimplemented from Rocket::Core::ReferenceCountable.
|
protectedvirtual |
Called during render after backgrounds, borders, decorators, but before children, are rendered.
Reimplemented in Rocket::Controls::ElementFormControlTextArea, Rocket::Controls::ElementFormControlSelect, and Rocket::Controls::ElementFormControlInput.
|
protectedvirtual |
Called during the update loop after children are updated.
Reimplemented in Rocket::Core::ElementDocument, Rocket::Controls::ElementDataGrid, Rocket::Controls::ElementFormControlTextArea, Rocket::Controls::ElementFormControlSelect, Rocket::Controls::ElementFormControlInput, and Rocket::Controls::ElementFormControlDataSelect.
|
virtual |
Called for every event sent to this element or one of its descendants.
| [in] | event | The event to process. |
Reimplemented in Rocket::Core::ElementDocument, Rocket::Controls::ElementDataGrid, Rocket::Controls::ElementFormControlInput, Rocket::Controls::ElementTabSet, Rocket::Controls::ElementDataGridCell, and Rocket::Controls::ElementDataGridExpandButton.
| void Rocket::Core::Element::RemoveAttribute | ( | const String & | name | ) |
Removes the attribute from the element.
| [in] | name | Name of the attribute. |
| bool Rocket::Core::Element::RemoveChild | ( | Element * | element | ) |
Remove a child element from this element.
| [in] | The | element to remove. |
| void Rocket::Core::Element::RemoveEventListener | ( | const String & | event, |
| EventListener * | listener, | ||
| bool | in_capture_phase = false |
||
| ) |
Removes an event listener from this element.
| [in] | event | Event to detach from. |
| [in] | listener | The listener object to be detached. |
| [in] | in_capture_phase | True to detach from the capture phase, false from the bubble phase. |
| void Rocket::Core::Element::RemoveProperty | ( | const String & | name | ) |
Removes a local property override on the element; its value will revert to that defined in the style sheet.
| [in] | name | The name of the local property definition to remove. |
| void Rocket::Core::Element::Render | ( | ) |
Replaces the second node with the first node.
| [in] | inserted_element | The element that will be inserted and replace the other element. |
| [in] | replaced_element | The existing element that will be replaced. If this doesn't exist, inserted_element will be appended. |
| float Rocket::Core::Element::ResolveProperty | ( | const String & | name, |
| float | base_value | ||
| ) |
Resolves one of this element's properties. If the value is a number or px, this is returned. If it's a percentage then it is resolved based on the second argument (the base value).
| [in] | name | The name of the property to resolve the value for. |
| [in] | base_value | The value that is scaled by the percentage value, if it is a percentage. |
| float Rocket::Core::Element::ResolveProperty | ( | const Property * | property, |
| float | base_value | ||
| ) |
Resolves one of this element's non-inherited properties. If the value is a number or px, this is returned. If it's a percentage then it is resolved based on the second argument (the base value).
| [in] | name | The property to resolve the value for. |
| [in] | base_value | The value that is scaled by the percentage value, if it is a percentage. |
| void Rocket::Core::Element::ScrollIntoView | ( | bool | align_with_top = true | ) |
Scrolls the parent element's contents so that this element is visible.
| [in] | align_with_top | If true, the element will align itself to the top of the parent element's window. If false, the element will be aligned to the bottom of the parent element's window. |
| void Rocket::Core::Element::SetAttribute | ( | const String & | name, |
| const T & | value | ||
| ) |
Sets an attribute on the element.
| [in] | name | Name of the attribute. |
| [in] | value | Value of the attribute. |
| void Rocket::Core::Element::SetAttributes | ( | const ElementAttributes * | attributes | ) |
Set a group of attributes.
| [in] | attributes | Attributes to set. |
| void Rocket::Core::Element::SetBox | ( | const Box & | box | ) |
Sets the box describing the size of the element, and removes all others.
| [in] | box | The new dimensions box for the element. |
| void Rocket::Core::Element::SetClass | ( | const String & | class_name, |
| bool | activate | ||
| ) |
Sets or removes a class on the element.
| [in] | class_name | The name of the class to add or remove from the class list. |
| [in] | activate | True if the class is to be added, false to be removed. |
| void Rocket::Core::Element::SetClassNames | ( | const String & | class_names | ) |
Specifies the entire list of classes for this element. This will replace any others specified.
| [in] | class_names | The list of class names to set on the style, separated by spaces. |
| void Rocket::Core::Element::SetClientArea | ( | Box::Area | client_area | ) |
Sets an alternate area to use as the client area.
| [in] | client_area | The box area to use as the element's client area. |
| void Rocket::Core::Element::SetContentBox | ( | const Vector2f & | content_offset, |
| const Vector2f & | content_box | ||
| ) |
Sets the dimensions of the element's internal content. This is the tightest fitting box surrounding all of this element's logical children, plus the element's padding.
| [in] | content_offset | The offset of the box's internal content. |
| [in] | content_box | The dimensions of the box's internal content. |
| void Rocket::Core::Element::SetId | ( | const String & | id | ) |
Sets the id of the element.
| [in] | id | The new id of the element. |
| void Rocket::Core::Element::SetInnerRML | ( | const String & | rml | ) |
Sets the markup and content of the element. All existing children will be replaced.
| [in] | rml | The new content of the element. |
| void Rocket::Core::Element::SetInstancer | ( | ElementInstancer * | instancer | ) |
Sets the instancer to use for releasing this element.
| [in] | instancer | Instancer to set on this element. |
| void Rocket::Core::Element::SetOffset | ( | const Vector2f & | offset, |
| Element * | offset_parent, | ||
| bool | offset_fixed = false |
||
| ) |
Sets the position of this element, as a two-dimensional offset from another element.
| [in] | offset | The offset (in pixels) of our primary box's top-left border corner from our offset parent's top-left border corner. |
| [in] | offset_parent | The element this element is being positioned relative to. |
| [in] | offset_fixed | True if the element is fixed in place (and will not scroll), false if not. |
Sets a local property override on the element.
| [in] | name | The name of the new property. |
| [in] | value | The new property to set. |
Sets a local property override on the element to a pre-parsed value.
| [in] | name | The name of the new property. |
| [in] | property | The parsed property to set. |
| void Rocket::Core::Element::SetPseudoClass | ( | const String & | pseudo_class, |
| bool | activate | ||
| ) |
Sets or removes a pseudo-class on the element.
| [in] | pseudo_class | The pseudo class to activate or deactivate. |
| [in] | activate | True if the pseudo-class is to be activated, false to be deactivated. |
| void Rocket::Core::Element::SetScrollLeft | ( | float | scroll_left | ) |
Sets the left scroll offset of the element.
| [in] | scroll_left | The element's new left scroll offset. |
| void Rocket::Core::Element::SetScrollTop | ( | float | scroll_top | ) |
Sets the top scroll offset of the element.
| [in] | scroll_top | The element's new top scroll offset. |
| void Rocket::Core::Element::Update | ( | ) |
| void Rocket::Core::Element::UpdateLayout | ( | ) |
Update the element's layout if required.
|
friend |
|
friend |
|
friend |
|
friend |
1.8.8