libRocket
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Protected Member Functions | Friends | List of all members
Rocket::Controls::ElementDataGridRow Class Reference

#include <ElementDataGridRow.h>

Inheritance diagram for Rocket::Controls::ElementDataGridRow:
Rocket::Core::Element Rocket::Controls::DataSourceListener Rocket::Core::ScriptInterface Rocket::Core::ReferenceCountable

Public Member Functions

 ElementDataGridRow (const Rocket::Core::String &tag)
 
virtual ~ElementDataGridRow ()
 
void Initialise (ElementDataGrid *parent_grid, ElementDataGridRow *parent_row=NULL, int child_index=-1, ElementDataGridRow *header_row=NULL, int depth=-1)
 
void SetChildIndex (int child_index)
 
int GetDepth ()
 
void SetDataSource (const Rocket::Core::String &data_source_name)
 
bool UpdateChildren ()
 
int GetNumLoadedChildren ()
 Returns the number of children that aren't dirty (have been loaded) More...
 
void RefreshRows ()
 
bool IsRowExpanded ()
 Returns whether this row is expanded or not. More...
 
void ExpandRow ()
 Shows all of this row's descendants. More...
 
void CollapseRow ()
 Hides all of this row's descendants. More...
 
void ToggleRow ()
 Expands the row if collapsed, or collapses the row if expanded. More...
 
int GetParentRelativeIndex ()
 Returns the index of this row, relative to its parent. More...
 
int GetTableRelativeIndex ()
 Returns the index of this row, relative to the table rather than its parent. More...
 
ElementDataGridRow * GetParentRow ()
 Returns the parent row of this row. More...
 
ElementDataGrid * GetParentGrid ()
 Returns the grid that this row belongs to. More...
 
- Public Member Functions inherited from Rocket::Core::Element
 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...
 
void SetClass (const String &class_name, bool activate)
 
bool IsClassSet (const String &class_name) const
 
void SetClassNames (const String &class_names)
 
String GetClassNames () const
 
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
 
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
 
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
 
bool IterateDecorators (int &index, PseudoClassList &pseudo_classes, String &name, Decorator *&decorator, DecoratorDataHandle &decorator_data)
 
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)
 
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 &parameters, 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)
 
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 &copy)
 Catches incorrect copy attempts. More...
 
- Public Member Functions inherited from Rocket::Controls::DataSourceListener
 DataSourceListener ()
 
virtual ~DataSourceListener ()
 

Protected Member Functions

virtual void OnDataSourceDestroy (DataSource *data_source)
 
virtual void OnRowAdd (DataSource *data_source, const Rocket::Core::String &table, int first_row_added, int num_rows_added)
 
virtual void OnRowRemove (DataSource *data_source, const Rocket::Core::String &table, int first_row_removed, int num_rows_removed)
 
virtual void OnRowChange (DataSource *data_source, const Rocket::Core::String &table, int first_row_changed, int num_rows_changed)
 
virtual void OnRowChange (DataSource *data_source, const Rocket::Core::String &table)
 
- Protected Member Functions inherited from Rocket::Core::Element
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...
 
- Protected Member Functions inherited from Rocket::Controls::DataSourceListener
bool ParseDataSource (DataSource *&data_source, Rocket::Core::String &table_name, const Rocket::Core::String &data_source_name)
 

Friends

class ElementDataGrid
 

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...
 

Detailed Description

Class for rows inside a data table. Used for both the header and the individual rows.

Author
Robert Curry

Constructor & Destructor Documentation

Rocket::Controls::ElementDataGridRow::ElementDataGridRow ( const Rocket::Core::String &  tag)
virtual Rocket::Controls::ElementDataGridRow::~ElementDataGridRow ( )
virtual

Member Function Documentation

void Rocket::Controls::ElementDataGridRow::CollapseRow ( )

Hides all of this row's descendants.

void Rocket::Controls::ElementDataGridRow::ExpandRow ( )

Shows all of this row's descendants.

int Rocket::Controls::ElementDataGridRow::GetDepth ( )
int Rocket::Controls::ElementDataGridRow::GetNumLoadedChildren ( )

Returns the number of children that aren't dirty (have been loaded)

ElementDataGrid* Rocket::Controls::ElementDataGridRow::GetParentGrid ( )

Returns the grid that this row belongs to.

int Rocket::Controls::ElementDataGridRow::GetParentRelativeIndex ( )

Returns the index of this row, relative to its parent.

ElementDataGridRow* Rocket::Controls::ElementDataGridRow::GetParentRow ( )

Returns the parent row of this row.

int Rocket::Controls::ElementDataGridRow::GetTableRelativeIndex ( )

Returns the index of this row, relative to the table rather than its parent.

void Rocket::Controls::ElementDataGridRow::Initialise ( ElementDataGrid *  parent_grid,
ElementDataGridRow *  parent_row = NULL,
int  child_index = -1,
ElementDataGridRow *  header_row = NULL,
int  depth = -1 
)
bool Rocket::Controls::ElementDataGridRow::IsRowExpanded ( )

Returns whether this row is expanded or not.

virtual void Rocket::Controls::ElementDataGridRow::OnDataSourceDestroy ( DataSource *  data_source)
protectedvirtual

Notification of the destruction of an observed data source.

Parameters
[in]data_sourceData source being destroyed.

Reimplemented from Rocket::Controls::DataSourceListener.

virtual void Rocket::Controls::ElementDataGridRow::OnRowAdd ( DataSource *  data_source,
const Rocket::Core::String &  table,
int  first_row_added,
int  num_rows_added 
)
protectedvirtual

Notification of the addition of one or more rows to an observed data source's table.

Parameters
[in]data_sourceData source being changed.
[in]tableThe name of the changing table within the data source.
[in]first_row_addedIndex of the first new row.
[in]num_rows_addedNumber of new sequential rows being added.

Reimplemented from Rocket::Controls::DataSourceListener.

virtual void Rocket::Controls::ElementDataGridRow::OnRowChange ( DataSource *  data_source,
const Rocket::Core::String &  table,
int  first_row_changed,
int  num_rows_changed 
)
protectedvirtual

Notification of the changing of one or more rows from an observed data source's table.

Parameters
[in]data_sourceData source being changed.
[in]tableThe name of the changing table within the data source.
[in]first_row_removedIndex of the first changed row.
[in]num_rows_removedNumber of new sequential rows being changed.

Reimplemented from Rocket::Controls::DataSourceListener.

virtual void Rocket::Controls::ElementDataGridRow::OnRowChange ( DataSource *  data_source,
const Rocket::Core::String &  table 
)
protectedvirtual

Notification of the change of all of the data of an observed data source's table.

Parameters
[in]data_sourceData source being changed.
[in]tableThe name of the changing table within the data source.

Reimplemented from Rocket::Controls::DataSourceListener.

virtual void Rocket::Controls::ElementDataGridRow::OnRowRemove ( DataSource *  data_source,
const Rocket::Core::String &  table,
int  first_row_removed,
int  num_rows_removed 
)
protectedvirtual

Notification of the removal of one or more rows from an observed data source's table.

Parameters
[in]data_sourceData source being changed.
[in]tableThe name of the changing table within the data source.
[in]first_row_removedIndex of the first removed row.
[in]num_rows_removedNumber of new sequential rows being removed.

Reimplemented from Rocket::Controls::DataSourceListener.

void Rocket::Controls::ElementDataGridRow::RefreshRows ( )
void Rocket::Controls::ElementDataGridRow::SetChildIndex ( int  child_index)
void Rocket::Controls::ElementDataGridRow::SetDataSource ( const Rocket::Core::String &  data_source_name)
void Rocket::Controls::ElementDataGridRow::ToggleRow ( )

Expands the row if collapsed, or collapses the row if expanded.

bool Rocket::Controls::ElementDataGridRow::UpdateChildren ( )

Checks dirty children and cells, and loads them if necessary.

Returns
True if any children were updated.

Friends And Related Function Documentation

friend class ElementDataGrid
friend

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