Guiliani  Version 2.4 revision 5970 (build 3)
CGUITableView Class Reference

A view for instances of CGUITableModel. More...

#include <GUITableView.h>

Inheritance diagram for CGUITableView:

Classes

struct  ColumnInfo
 Contains information about one column. More...
 
class  CViewItemGeneratorContainer
 A helper class for CGUITableView. More...
 
struct  RowInfo
 Contains information about one row. More...
 

Public Types

typedef eC_TListDoubleLinked< eC_UInt > AutoResizeColumnList
 The auto resize column list holds the indices of column auto resize candidates.
 
typedef eC_TListDoubleLinked< CGUIViewIndexSelectionList
 The Selection list holds the indices of all selected objects.
 
enum  SelectionMode_t { NO_SELECTION, SINGLE_SELECTION, MULTI_SELECTION, SELECT_ROW }
 Enumeration used for the SelectionMode. More...
 
enum  TriggerEvent_t {
  TRIGGER_NONE = 0, TRIGGER_CLICK = 1, TRIGGER_DOUBLE_CLICK = 2, TRIGGER_LONG_CLICK = 4,
  TRIGGER_GK_ACTION = 16
}
 Triggers that can be used to select or edit an item.
 
- Public Types inherited from CGUIScrollView
enum  ScrollBarPolicy { AUTOMATIC, ALWAYS_VISIBLE, NEVER_VISIBLE }
 Scrollbar policies. These specify under which circumstances a scrollbar is visible. More...
 
- Public Types inherited from CGUIObject
enum  FourWayFocus_t { FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUS_DOWN }
 

Public Member Functions

 CGUITableView (CGUICompositeObject *const pParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUITableView (CGUICompositeObject *const pParent, const CGUIRect &rkRect, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUITableView ()
 
 ~CGUITableView ()
 
eC_Bool AddObject (CGUIObject *pObject)
 
eC_Bool AppendColumn (eC_UInt uiModelColumnIndex, eC_Value vWidth, eC_Value vMinWidth=10, TriggerEvent_t eSelectionTrigger=TRIGGER_CLICK, TriggerEvent_t eEditTrigger=TRIGGER_DOUBLE_CLICK)
 
void ClearSelection (const eC_Bool bNotifyObservers=true)
 
eC_Bool DeselectRow (const eC_UInt uiRow)
 
virtual eC_Bool DoClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoDoubleClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoDraw ()
 
virtual eC_Bool DoKeyDown (const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers)
 
virtual eC_Bool DoLongClick (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
void EnableGrid (eC_Bool bHorizontal, eC_Bool bVertical)
 
void EnsureItemIsVisible (const CGUIViewIndex &rkViewIndex)
 
void EnsureRecentlySelectedIsVisible ()
 
CGUIRect GetCellRect (const CGUIViewIndex &rkViewIndex)
 
eC_UInt GetColumnCount ()
 
eC_Value GetColumnWidth (eC_UInt uiColumn) const
 
eC_UInt GetGridColor () const
 
eC_Value GetGridLineWidth () const
 
eC_UInt GetHeaderColor () const
 
eC_Value GetHeaderHeight () const
 
eC_UInt GetHeaderTextColor () const
 
FontResource_t GetHeaderTextFont () const
 
CGUITableModelGetModel ()
 
CGUIModelIndex GetModelIndex (const CGUIViewIndex &rkIndex) const
 
eC_Value GetRowHeight () const
 
const SelectionListGetSelection ()
 
CGUIViewIndex GetViewIndex (const CGUIModelIndex &rkIndex) const
 
eC_Bool HideRow (const eC_UInt uiRowIndex, const eC_Bool bHide=true)
 
eC_Bool HideRows (const eC_UInt uiStartRowIndex, const eC_UInt uiEndRowIndex, eC_Bool bHide=true)
 
virtual eC_Bool InsertColumn (eC_UInt uiColumnIndex, eC_UInt uiModelColumnIndex, eC_Value vWidth, eC_Value vMinWidth=10, TriggerEvent_t eSelectionTrigger=TRIGGER_CLICK, TriggerEvent_t eEditTrigger=TRIGGER_DOUBLE_CLICK)
 
eC_Bool IsItemSelected (const CGUIViewIndex &rkIndex)
 
eC_Bool IsRowHidden (const eC_UInt uiRowIndex) const
 
eC_Bool ModelColumnContainedInView (const eC_UInt uiModelColumnIndex) const
 
virtual void ReadFromStream ()
 
void RegenerateViewItem (const CGUIViewIndex &rkIndex)
 
void RegenerateViewItems (const eC_UInt cuiColumn)
 
void RegenerateViewItemsFromColumn (const eC_UInt cuiColumn)
 
void RemoveAutoResizedColumn (const eC_UInt cuiColumn)
 
virtual eC_Bool RemoveColumn (eC_UInt uiColumnIndex)
 
eC_Bool SelectColumn (const eC_UInt uiColumn)
 
eC_Bool SelectItem (const CGUIViewIndex &rkIndex)
 
eC_Bool SelectItems (const SelectionList &rkItemList)
 
eC_Bool SelectRow (const eC_UInt uiRow)
 
void SetAutoResizedColumn (const eC_UInt cuiColumn)
 
eC_Bool SetColumnWidth (eC_UInt uiColumn, eC_Value vWidth, const eC_Bool cbAdjust=true)
 
void SetDefaultColumnViewGenerator (const eC_UInt uiColumn, CGUIViewItemGenerator *pkViewItemGenerator)
 
void SetDefaultViewGenerator (CGUIViewItemGenerator *pkViewItemGenerator)
 
void SetGridColor (eC_UInt uiColor)
 
void SetGridLineWidth (eC_Value vGridLineWidth)
 
void SetHeaderColor (eC_UInt uiColor)
 
void SetHeaderHeight (eC_Value vHeaderHeight)
 
void SetHeaderTextColor (eC_UInt uiColor)
 
void SetHeaderTextFont (const FontResource_t &eHeaderTextFont)
 
void SetHeight (const eC_Value &crvHeight)
 
void SetModel (CGUITableModel *pkModel)
 
eC_Bool SetRowHeight (const eC_Value &crvRowHeight)
 
void SetSelectionMode (SelectionMode_t eSelectionMode)
 
void SetViewGenerator (const CGUIViewIndex &rkIndex, CGUIViewItemGenerator *pkViewItemGenerator)
 
void SetViewItemsGap (const eC_Value &crvViewItemsGap)
 
void SetViewItemsGapVertical (const eC_Value &crvViewItemsGapVertical)
 
void SetWidth (const eC_Value &crvWidth)
 
virtual void WriteToStream (const eC_Bool bWriteClassID=false)
 
- Public Member Functions inherited from CGUIScrollView
 CGUIScrollView (CGUICompositeObject *const pParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIScrollView (CGUICompositeObject *const pParent, const CGUIRect &kRect, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIScrollView (const CGUIScrollView &rkSource)
 
 CGUIScrollView ()
 
virtual void AdjustScrollBars ()
 
virtual void DoAnimate (const eC_Value &vTimes=eC_FromInt(1))
 
virtual eC_Bool DoScrollDown (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
virtual eC_Bool DoScrollLeft (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
virtual eC_Bool DoScrollRight (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
virtual eC_Bool DoScrollUp (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
virtual CGUICompositeObjectGetClipper () const
 
virtual CGUICompositeObjectGetContainer () const
 
virtual void GetFocus ()
 
CGUIScrollBarGetHorizontalScrollbar ()
 
CGUIScrollBarGetVerticalScrollbar ()
 
virtual eC_Bool IsHorizontalScrollBarAtBottom () const
 
virtual eC_Bool IsVerticalScrollBarAtRight () const
 
CGUIScrollViewoperator= (const CGUIScrollView &rkSource)
 
virtual void RemoveObject (CGUIObject *pObject)
 Removes an object from the scrolled container. More...
 
virtual void RestoreScrollPosition ()
 
virtual void SaveScrollPosition ()
 Stores the scroll positions (values of both scroll bars)
 
virtual void ScrollToFocussedObject ()
 
virtual void ScrollToObject (CGUIObject *pkObject)
 
void SetAutoAdjustContainerSize (const eC_Bool bAutoAdjustContainerSize)
 
void SetAutoAdjustScrollViewLayout (const eC_Bool bAutoAdjustScrollViewLayout)
 
virtual void SetHorizontalScrollBarAtBottom (const eC_Bool bIsAtBottom)
 
virtual void SetHorizontalScrollbarPolicy (const ScrollBarPolicy ePolicy)
 
virtual void SetScrollingInertia (const eC_Value vInertia)
 
virtual void SetScrollingViewport (const eC_Value vX, const eC_Value vY)
 
virtual void SetVerticalScrollBarAtRight (const eC_Bool bIsAtRight)
 
virtual void SetVerticalScrollbarPolicy (const ScrollBarPolicy ePolicy)
 
virtual void StartScrollingAnimation ()
 Called when the Scrollview wishes to start scrolling. Overriding methods should call the base class implementation.
 
virtual void StopScrollingAnimation ()
 Called when the scrolling animation is over. Overriding methods should call the base class implementation.
 
- Public Member Functions inherited from CGUICompositeObject
 CGUICompositeObject ()
 
 CGUICompositeObject (CGUICompositeObject *const pParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUICompositeObject (CGUICompositeObject *const pParent, const CGUIRect &kRect, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUICompositeObject (const CGUICompositeObject &kSource)
 
virtual ~CGUICompositeObject ()
 This destructor is automatically virtual, as the base class destructor is virtual.
 
eC_Bool BringToFront (const CGUIObject *pkObject)
 
eC_Bool CanBeCyclicFocussed () const
 
virtual eC_Bool DoPostDraw ()
 
void DrawOnTop (CGUIObject *pkObject)
 
void DrawOnTopOf (CGUIObject *const pkObject, CGUIObject *const pDrawOnTopOf)
 
virtual CGUIObjectFindObject (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
void Flip (const eC_Bool &rbVertical)
 
eC_Bool FocusAny ()
 
virtual eC_Bool FocusNext (CGUIObject *const pRefObj=NULL, const eC_Bool &bSubTreeOfRefObjDone=false)
 
virtual eC_Bool FocusPrevious (CGUIObject *const pRefObj=NULL, const eC_Bool &bSubTreeOfRefObjDone=false)
 
const CGUIObjectGetAndCheckObjectByID (ObjectHandle_t eObjID, const eC_String &kObjectName) const
 
CGUIObjectGetAndCheckObjectByID (ObjectHandle_t eObjID, const eC_String &kObjectName)
 
CGUIObjectGetChild (const eC_UInt uIndex) const
 
CGUIObjectGetChild (const eC_UInt uIndex)
 
const ObjectPtrListGetChildObjectsList () const
 
const ObjectPtrListGetDrawOrderList () const
 
eC_Int GetIndexOfChild (const CGUIObject *pkObject) const
 
eC_UInt GetNumberOfChildren () const
 
CGUIObjectGetObjectByID (const ObjectHandle_t &eID, const eC_Bool &bOnlyVisible=false)
 
const CGUIObjectGetObjectByID (const ObjectHandle_t &eID, const eC_Bool &bOnlyVisible=false) const
 
eC_Bool InsertChildAt (const eC_UInt cuiIndex, CGUIObject *pkChild)
 
void InvalidateChildren ()
 Invalidates all chidren, but not this parent.
 
eC_Bool IsAncestorOf (const CGUIObject *pkObject) const
 
virtual eC_Bool IsCompositeObject () const
 
eC_Bool LowerOneLevel (const CGUIObject *pkObject)
 
CGUICompositeObjectoperator= (const CGUICompositeObject &kSource)
 
eC_Bool RaiseOneLevel (const CGUIObject *pkObject)
 
virtual void RefreshLayout (CGUILayouter::eMovedEdges_t eMovedEdges) const
 
void RemoveAllChildren ()
 
void Rotate (const eC_UInt &ruiDegrees, const eC_Bool &rbFirst=false)
 
eC_Bool SendToBack (const CGUIObject *pkObject)
 
virtual void SetClickThrough (const eC_Bool &bClickThrough)
 
virtual void SetClickThrough (const eC_Bool &bClickThrough, const eC_Bool &bChildrenClickThrough)
 
void SetCyclicFocus (const eC_Bool &bCyclicFocus)
 
virtual void SetDisabled (const eC_Bool &bDisabled)
 
virtual void SetDisabled (const eC_Bool &bDisabled, const eC_Bool &bChildrenDisabled)
 
virtual void SetFocussable (const eC_Bool &bFocussable)
 
virtual void SetFocussable (const eC_Bool &bFocussable, const eC_Bool &bChildrenFocussable)
 
virtual void SetGrayedOut (const eC_Bool &bGrayedOut)
 
virtual void SetGrayedOut (const eC_Bool &bGrayedOut, const eC_Bool &bChildrenGrayedOut)
 
virtual void SetInvisible (const eC_Bool &bInvisible)
 
virtual void SetInvisible (const eC_Bool &bInvisible, const eC_Bool &bChildrenInvisible)
 
- Public Member Functions inherited from CGUIObject
 CGUIObject (CGUICompositeObject *const pParent, const eC_Value &vX, const eC_Value &vY, const eC_Value &vWidth, const eC_Value &vHeight, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIObject (CGUICompositeObject *const pParent, const CGUIRect &kRect, const ObjectHandle_t &eID=NO_HANDLE)
 
 CGUIObject ()
 
 CGUIObject (const CGUIObject &kSource)
 
virtual ~CGUIObject ()
 
void AddValueObserver (CGUIObserver *pObserver)
 
eC_Bool CalculateInvalidatedRect (CGUIRect &rRect) const
 
virtual eC_Bool ClaimFocus ()
 
virtual void CreateSnapshot (eC_UInt uiBackColor=0x00)
 
eC_Bool DataPoolConnectorExists () const
 
void DeleteSnapshot ()
 
virtual void DisableSnapshotDrawing (eC_Bool bDeleteSnapshot=true)
 
virtual eC_Bool DoDrawSnapshot ()
 
virtual void EnableSnapshotDrawing ()
 
CGUIRect GetAbsRect () const
 
eC_Value GetAbsXPos () const
 
eC_Value GetAbsXPosCenter () const
 
eC_Value GetAbsXPosREdge () const
 
eC_Value GetAbsYPos () const
 
eC_Value GetAbsYPosBEdge () const
 
eC_Value GetAbsYPosCenter () const
 
eC_UByte GetAlpha () const
 
CGUIBehaviourDecoratorGetBehaviour ()
 
const CGUIBehaviourDecoratorGetBehaviour () const
 
GUIBitmapPlaneID_t GetBitmapID () const
 
CGUIBitmapPlaneGetBitmapPlane () const
 
CGUIRect GetCurrentAbsRect () const
 
eC_Value GetCurrentAbsXPos () const
 
eC_Value GetCurrentAbsXPosCenter () const
 
eC_Value GetCurrentAbsXPosREdge () const
 
eC_Value GetCurrentAbsYPos () const
 
eC_Value GetCurrentAbsYPosBEdge () const
 
eC_Value GetCurrentAbsYPosCenter () const
 
CDataPoolConnectorGetDataPoolConnector ()
 
eC_Value GetDistanceBottom () const
 
eC_Value GetDistanceRight () const
 
eC_Value GetHalfHeight () const
 
eC_Value GetHalfWidth () const
 
eC_Value GetHeight () const
 
ObjectHandle_t GetID () const
 
CGUILayouterGetLayouter ()
 
const CGUILayouterGetLayouter () const
 
ObjectHandle_t GetNeighborBottomID () const
 
ObjectHandle_t GetNeighborLeftID () const
 
ObjectHandle_t GetNeighborRightID () const
 
ObjectHandle_t GetNeighborTopID () const
 
CGUIObjectGetObjectByID (const ObjectHandle_t &eID, const eC_Bool &bOnlyVisible=false)
 
const CGUIObjectGetObjectByID (const ObjectHandle_t &eID, const eC_Bool &bOnlyVisible=false) const
 
CGUIRect GetOriginRect () const
 
CGUICompositeObjectGetParent ()
 
const CGUICompositeObjectGetParent () const
 
CGUIRect GetRelRect () const
 
eC_Value GetRelXPos () const
 
eC_Value GetRelXPosCenter () const
 
eC_Value GetRelXPosREdge () const
 
eC_Value GetRelYPos () const
 
eC_Value GetRelYPosBEdge () const
 
eC_Value GetRelYPosCenter () const
 
eC_Value GetWidth () const
 
void InvalidateArea ()
 
eC_Bool IsClickable () const
 
eC_Bool IsClickThrough () const
 
eC_Bool IsDescendantOf (const CGUIObject *const pAncestor) const
 
eC_Bool IsDisabled () const
 
eC_Bool IsDragable () const
 
eC_Bool IsDragged () const
 
eC_Bool IsDrawingSnapshot () const
 
eC_Bool IsFocussable () const
 
eC_Bool IsFocussed () const
 
eC_Bool IsGrayedOut () const
 
virtual eC_Bool IsHighlightable () const
 
eC_Bool IsHighlighted () const
 
eC_Bool IsInvisible () const
 
eC_Bool IsPressed () const
 
eC_Bool IsStopFocus () const
 
void NotifyValueObservers (const CGUIValue &kValue, const eC_UInt uiX=0, const eC_UInt uiY=0)
 
CGUIObjectoperator= (const CGUIObject &kSource)
 
void RemoveValueObserver (CGUIObserver *pObserver)
 
void RenderToBitmap (eC_UInt uiBitmapID, eC_Value vXOffset=eC_FromInt(0), eC_Value vYOffset=eC_FromInt(0))
 
eC_Bool RequestFocus ()
 
void SetAlpha (eC_UByte ubAlpha)
 
void SetBehaviour (CGUIBehaviourDecorator *pBehaviour)
 
void SetClickThrough (const eC_Bool &bClickThrough)
 
void SetID (const ObjectHandle_t &eID)
 
void SetLayouter (CGUILayouter *pLayouter)
 
void SetNeighborBottomID (const ObjectHandle_t eNewNeighborBottomID)
 
void SetNeighborIDs (const ObjectHandle_t eNewNeighborLeftID, const ObjectHandle_t eNewNeighborRightID, const ObjectHandle_t eNewNeighborTopID, const ObjectHandle_t eNewNeighborBottomID)
 
void SetNeighborLeftID (const ObjectHandle_t eNewNeighborLeftID)
 
void SetNeighborRightID (const ObjectHandle_t eNewNeighborRightID)
 
void SetNeighborTopID (const ObjectHandle_t eNewNeighborTopID)
 
virtual void SetParent (CGUICompositeObject *const pParent)
 
void SetRelRect (const CGUIRect &kNewRect)
 
virtual void SetRelXPos (const eC_Value &vX)
 
void SetRelXPosCenter (const eC_Value &vXCenter)
 
void SetRelXPosREdge (const eC_Value &vX)
 
virtual void SetRelYPos (const eC_Value &vY)
 
void SetRelYPosBEdge (const eC_Value &vY)
 
void SetRelYPosCenter (const eC_Value &vYCenter)
 
void SetStopFocus (const eC_Bool &bDontFocusToParent)
 
virtual eC_Bool SetValue (const CGUIValue &rkValue)
 
virtual eC_Bool SetValue (CDataPoolEntry &rkValue)
 
- Public Member Functions inherited from CGUIBehaviour
virtual eC_Bool DoUserEvent (CGUIEvent *const pEvent)
 
virtual void OnCreate ()
 
virtual void OnDelete ()
 
virtual void OnHide ()
 
virtual void OnShow ()
 
virtual eC_Bool DoButtonDown (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoButtonUp (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoDrag (const eC_Value &vDeltaX=eC_FromInt(-1), const eC_Value &vDeltaY=eC_FromInt(-1), const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoDragEnd (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoMouseEnter (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoMouseLeave (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual eC_Bool DoMouseMove (const eC_Value &vAbsX=eC_FromInt(-1), const eC_Value &vAbsY=eC_FromInt(-1))
 
virtual void LoseFocus ()
 
virtual eC_Bool Decrease ()
 
virtual eC_Bool Increase ()
 
virtual eC_Bool DoKeyUp (const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers)
 
virtual eC_Bool DoChar (const eC_UInt &uiKey, const GUIKeyIdentifier_t &eKeyIdentifier, const eC_UInt &uiModifiers)
 
- Public Member Functions inherited from CGUIStreamableObject
const eC_String & GetXMLTag () const
 
void SetXMLTag (const eC_String &kXMLTag)
 
- Public Member Functions inherited from CGUIAnimatable
virtual ~CGUIAnimatable ()
 Destructor. Removes all existing animation callbacks.
 
virtual eC_Bool IsAnimating () const
 
virtual void StartAnimation ()
 
virtual void StopAnimation ()
 

Protected Types

typedef eC_TListDoubleLinked< ColumnInfoColumnInfoList
 A column info list is a double-linked list of column info objects.
 
typedef eC_TListDoubleLinked< CGUIViewItem * > ColumnItemList
 list holds all view items of one column.
 
typedef eC_TListDoubleLinked< RowInfoRowInfoList
 A row info list is a double-linked list of row info objects.
 

Protected Member Functions

void AddHeaderItem (eC_UInt uiModelColumnIndex, eC_UInt uiIndex)
 
eC_Bool AddItemToSelection (const CGUIViewIndex &rkIndex)
 
void AdjustAutoresizedColumn ()
 
virtual void AdjustViewObjectContainer ()
 
virtual RowInfo CreateRowInfo (eC_UInt uiRow)
 
void EditItem (const CGUIViewIndex &rkIndexToEdit)
 
virtual CGUIViewItemGenerateViewItem (const CGUIViewIndex &kViewIndex)
 
eC_Value GetColumnXPos (const eC_UInt &uiColumnIndex)
 
CGUIHeaderItemGetHeaderItem (eC_UInt uiIndex)
 
eC_Value GetRowYPos (const eC_UInt &uiRowIndex)
 
CGUIViewIndex GetViewIndexByPosition (const eC_Value &vAbsX, const eC_Value &vAbsY)
 
CGUIViewItemGetViewItem (const CGUIViewIndex &rkIndex)
 
eC_Bool HandleSelection (const CGUIViewIndex &rkIndex, const eC_UInt uiModifiers)
 
eC_Bool HandleTriggerEvent (const eC_Value &vAbsX, const eC_Value &vAbsY, const TriggerEvent_t &eTriggerEvent, eC_UInt uiModifiers)
 
void InsertRows (eC_UInt uiStartRow, eC_UInt uiEndRow)
 
void InvalidateAreaOfHorizontalLine (const eC_UInt &uiRow)
 
eC_Bool IsItemSelected (CGUIViewItem *pkViewItem)
 
virtual void ItemEdited (const CGUIViewIndex &rkIndex, const CGUIValue &kNewValue)
 
eC_Bool ItemIsEditable (const CGUIViewIndex &rkIndex)
 
eC_Bool ItemIsSelectable (const CGUIViewIndex &rkIndex)
 
virtual void ModifyCellRect (CGUIRect &CellRect, CGUIViewItem *pItem)
 
void RemoveAllItemsFromSelection ()
 
void RemoveHeaderItem (eC_UInt uiIndex)
 
eC_Bool RemoveItemFromSelection (const CGUIViewIndex &rkIndex)
 
void RemoveRows (eC_UInt uiStartRow, eC_UInt uiEndRow)
 
virtual void RepositionViewItem (CGUIViewItem *pViewItem)
 
void RepositionViewItemIterative (CGUIViewItem *pViewItem, const RowInfo *pkRowInfo, eC_UInt &uiNofVisibleRows)
 
virtual void RepositionViewItems (const eC_UInt cuiColumn)
 
virtual void RepositionViewItemsFromColumn (const eC_UInt cuiColumn)
 
virtual void RepositionViewItemsFromRow (const eC_UInt uiRow)
 
eC_Bool SelectBlock (const CGUIViewIndex &rkFromIndex, const CGUIViewIndex &rkToIndex)
 
virtual void SelectionUpdated ()
 
void StopEditing (eC_Bool bMoveFocusToViewItem=true)
 
eC_Bool ToggleSelection (const CGUIViewIndex &rkIndex)
 
eC_Bool ToggleSelectionForRow (const eC_UInt uiRow)
 
void UpdateHeaderItems ()
 
void UpdateViewItem (const CGUIModelIndex &crkModelIndex, const CGUIValue &crkNewValue)
 
virtual void ViewItemUpdated (const CGUIViewIndex &rkIndex, const CGUIValue &kNewValue)
 
- Protected Member Functions inherited from CGUIScrollView
virtual void AdjustClipperSize ()
 
virtual void AdjustContainerSize ()
 
void Init ()
 General initialization.
 
- Protected Member Functions inherited from CGUICompositeObject
virtual eC_Bool FourWayNext (FourWayFocus_t eFocusDirection)
 
ObjectPtrListGetChildObjectsList ()
 
virtual void HandleDraw (const CGUIRect &ClipRect)
 
- Protected Member Functions inherited from CGUIObject
virtual eC_Bool CreateBitmapPlane ()
 
- Protected Member Functions inherited from CGUIStreamableObject
eC_UInt ReadStreamingHeader (const eC_UInt &uiClassVersion, const eC_UInt &uiClassMinVersion=0) const
 
void WriteStreamingFooter (const eC_Bool &bWriteClassID) const
 
void WriteStreamingHeader (const eC_Bool &bWriteClassID, const eC_Char *const pkClassIDTag, const eC_Int &iClassID, const eC_UInt &uiClassVersion) const
 

Protected Attributes

ColumnInfoList m_kColInfos
 Holds information about the columns and the ViewItem list.
 
CViewItemGeneratorContainer m_kGeneratorContainer
 Container for all ViewItemGenerators that are set for the view, a column or a cell.
 
RowInfoList m_kRowInfos
 Holds information about the rows.
 
CSafeGUIObjectPtr m_pkCurrentEditorObject
 The current editor object.
 
CGUIViewItemm_pkEditedViewItem
 The currently edited view item.
 
CGUIRepositionCompositeObjectm_pkHeader
 Container for header items.
 
CGUITableModelm_pkModel
 Current model for this view.
 
- Protected Attributes inherited from CGUIScrollView
eC_Bool m_bAutoAdjustContainerSize
 
eC_Bool m_bAutoAdjustScrollViewLayout
 
eC_Bool m_bIsHorizontalScrollBarAtBottom
 Position of horizontal scrollbar (true=bottom, false=top)
 
eC_Bool m_bIsVerticalScrollBarAtRight
 Position of vertical scrollbar (true=right, false=left)
 
ScrollBarPolicy m_eHorizontalScrollBarPolicy
 Scrollbar policy defining whether a horizontal scrollbar is visible or not.
 
ScrollBarPolicy m_eVerticalScrollBarPolicy
 Scrollbar policy defining whether a vertical scrollbar is visible or not.
 
eC_Int m_iHorScrollPos
 Stored position of the horizontal scroll bar.
 
eC_Int m_iVerScrollPos
 Stored position of the vertical scroll bar.
 
CGUICompositeObjectm_pkClipper
 
CGUIScrollBarm_pkHorScrollBar
 
CGUIScrollBarm_pkVerScrollBar
 
eC_Value m_vScrollingInertia
 Inertia value for soft scrolling. Legal values are positive and greater than 1.
 
eC_Value m_vViewportXBorder
 Horizontal (in X direction) gap between visible area and the area outside of which scrolling will occur.
 
eC_Value m_vViewportYBorder
 Vertical (in Y direction) gap between visible area and the area outside of which scrolling will occur.
 

Friends

class CGUIHeaderItem
 
class CGUITableModel
 The model needs to call the protected Insert/Remove/Update methods. More...
 
class CGUIViewItem
 

Additional Inherited Members

- Static Public Attributes inherited from CGUICompositeObject
static const eC_Char XMLTAG_CHILDREN [] = "Children"
 XML comment tag to be used before writing children to a stream.
 
static const eC_Char XMLTAG_ENDCHILDREN [] = "/Children"
 XML comment tag to be used after writing children to a stream.
 
- Static Public Attributes inherited from CGUIObject
static const eC_Char XMLTAG_ALPHA [] = "Alpha"
 XML tag to be used writing alpha-value into a stream.
 
static const eC_Char XMLTAG_CLICKTHROUGH [] = "ClickThrough"
 XML tag to be used writing clickthrough-state into a stream.
 
static const eC_Char XMLTAG_CONTROLCLASSID [] = "ControlClassID"
 XML tag to be used when writing a control class ID into a stream.
 
static const eC_Char XMLTAG_DISABLED [] = "Disabled"
 XML tag to be used writing disabled-state into a stream.
 
static const eC_Char XMLTAG_FOCUSSABLE [] = "Focussable"
 XML tag to be used writing focussable-state into a stream.
 
static const eC_Char XMLTAG_GRAYEDOUT [] = "GrayedOut"
 XML tag to be used writing grayedout-state into a stream.
 
static const eC_Char XMLTAG_HEIGHT [] = "Height"
 XML tag to be used writing height into a stream.
 
static const eC_Char XMLTAG_INVISIBLE [] = "Invisible"
 XML tag to be used writing invisible-state into a stream.
 
static const eC_Char XMLTAG_OBJECTID [] = "ObjectID"
 XML tag to be used writing object id into a stream.
 
static const eC_Char XMLTAG_OVERRIDDENNEIGHBORS [] = "OverriddenNeighbors"
 XML tag to be used writing overridden neighbors into a stream.
 
static const eC_Char XMLTAG_WIDTH [] = "Width"
 XML tag to be used writing width into a stream.
 
static const eC_Char XMLTAG_XPOS [] = "XPos"
 XML tag to be used writing x-position into a stream.
 
static const eC_Char XMLTAG_YPOS [] = "YPos"
 XML tag to be used writing y-position into a stream.
 
- Static Public Attributes inherited from CGUIBehaviour
static const eC_Char XMLTAG_BEHAVIOURCLASSID [] = "BehaviourClassID"
 XML tag to be used when writing a behaviour class ID into a stream.
 
- Static Public Attributes inherited from CGUIStreamableObject
static const eC_Char XMLTAG_CLASSVERSION [] = "ClassVersion"
 

Detailed Description

A view for instances of CGUITableModel.

table_view.png
The "table view" control is used for the presentation of charts. Dynamic count of columns and rows are supported (Class: CGUITableView).

The table view provides a dynamic view upon a table model. It manages the actual GUI objects that display the data of a table.

Since it is a specialization of CGUIScrollView, its contents are automatically scrolled. Specifically, the vertical scroll bar only scrolls the table's rows without the header.

Typical usage is as follows:

  • Create an instance of this class.
  • Set ViewItemGenerators to specify the visual representation of the data.
  • Append view columns (AppendColumn or InsertColumn).
  • Attach a model by calling SetModel. At this point, all data that is already present in the model is shown in the view, and later changes to the model are also reflected in the view.

The GUIObjects for each cell are provided by CGUIViewItems. A ViewItem provides a ViewObject that is added to the table view. The type of the object that will be created is determined by the ViewItem. The ViewItem is also responsible to inform the View when the Value of the ViewObject was edited and provides an interface to set a new value in the ViewObject. When a cell is selected, the ViewItem is informed to be able to set the ViewObject (GUIObject) to a selected representation (if needed). The TableView itself does not draw a "Selection Frame" around a selected cell. The ViewObject itself is responsible for its selected representation.

ViewItems are generated by CGUIViewItemGenerators. Depending of the ViewIndex the ViewItemGenerator has to create the desired ViewItem. If the ViewItem itself is not editable (

See also
CGUIViewItem::IsEditable), the generator might provide an EditorObject which is displayed by the TableView if the editing mode for a cell is active.

Example:

// Create a table view.
CGUITableView* pkTableView = new CGUITableView(this,
eC_FromInt(0), eC_FromInt(0),
eC_FromInt(250), eC_FromInt(200),
OBJ_TABLEVIEW);
// Add columns to the view and map it to the model columns.
pkTableView->AppendColumn(0, eC_FromInt(20));
pkTableView->AppendColumn(1, eC_FromInt(150));
pkTableView->AppendColumn(2, eC_FromInt(80));
// In the first column check boxes shall be displayed, so set a ViewItemGeneratorCheckBox.
// Create a table model.
CGUITableModel* pkModel = new CGUITableModel();
pkModel->AddColumn("Flag");
pkModel->AddColumn("Name");
pkModel->AddColumn("Value");
// Set the model to be displayed by the view.
pkTableView->SetModel(pkModel);
// Add a row to the model.
eC_UInt uiRow = pkModel->AppendRow();
pkModel->SetItem(uiRow, 0, new CGUIModelItem(true));
pkModel->SetItem(uiRow, 1, new CGUIModelItem("first row"));
pkModel->SetItem(uiRow, 2, new CGUIModelItem(CGUIValue(1.0)));
uiRow = pkModel->AppendRow();
pkModel->SetItem(uiRow, 0, new CGUIModelItem(false));
pkModel->SetItem(uiRow, 1, new CGUIModelItem("second row"));
pkModel->SetItem(uiRow, 2, new CGUIModelItem(CGUIValue(2.0)));
// Set some view attributes.
pkTableView->SetHeaderColor(0xFFFF0000);
pkTableView->SetGridLineWidth(eC_FromInt(1));
pkTableView->EnableGrid(true, true);

Member Enumeration Documentation

◆ SelectionMode_t

Enumeration used for the SelectionMode.

Enumerator
NO_SELECTION 

No items in the view can be selected.

SINGLE_SELECTION 

Only one cell in the view can be selected.

MULTI_SELECTION 

Free selection of cells is possible.

SELECT_ROW 

If one item in a row is selected / de-selected, the tableview will select / de-select the complete row. Multi Row selection is possible.

Constructor & Destructor Documentation

◆ CGUITableView() [1/3]

CGUITableView::CGUITableView ( CGUICompositeObject *const  pParent,
const eC_Value &  vX,
const eC_Value &  vY,
const eC_Value &  vWidth,
const eC_Value &  vHeight,
const ObjectHandle_t eID = NO_HANDLE 
)

Constructs a new table view.

Parameters
pParentPointer to the designated parent object.
vXX position relative to parent object.
vYY position relative to parent object.
vWidthWidth of the table view.
vHeightHeight of the table view.
eIDObject handle of this table view.

◆ CGUITableView() [2/3]

CGUITableView::CGUITableView ( CGUICompositeObject *const  pParent,
const CGUIRect rkRect,
const ObjectHandle_t eID = NO_HANDLE 
)

Constructs a new table view.

Parameters
pParentPointer to the designated parent object.
rkRectBounding rectangle relative to parent.
eIDObject handle of this table view.

◆ ~CGUITableView()

CGUITableView::~CGUITableView ( )

Destructor

◆ CGUITableView() [3/3]

CGUITableView::CGUITableView ( )

Standard constructor. Only to be called by factory. No user code should call this constructor, not even in streaming mode (that is, when GUILIANI_STREAM_GUI is defined)!

Member Function Documentation

◆ AddHeaderItem()

void CGUITableView::AddHeaderItem ( eC_UInt  uiModelColumnIndex,
eC_UInt  uiIndex 
)
protected

Helper for adding a header item.

Parameters
uiModelColumnIndexIndex of the column in the model.
uiIndexIndex of the view column (position of the header item).

◆ AddItemToSelection()

eC_Bool CGUITableView::AddItemToSelection ( const CGUIViewIndex rkIndex)
protected

Internal helper for selection handling. Adds a ViewItem to the selection list and sets it selected. This method does not trigger SelectionUpdated().

See also
RemoveItemFromSelection.
Parameters
rkIndexThe Index of the ViewItem to set selected.
Returns
True if the item was successfully added, otherwise False.

◆ AddObject()

eC_Bool CGUITableView::AddObject ( CGUIObject pObject)
virtual

Make sure that the header is a child of the table view and is not added to the container of the scroll view. So the header is not scrolled by the ScrollView. All other objects are added into the ViewObjectContainer.

Parameters
pObjectThe object to add
Returns
True if successful, False otherwise

Reimplemented from CGUIScrollView.

◆ AdjustAutoresizedColumn()

void CGUITableView::AdjustAutoresizedColumn ( )
protected

Helper function for SetWidth() and SetAutoResizedColumn()

◆ AdjustViewObjectContainer()

void CGUITableView::AdjustViewObjectContainer ( )
protectedvirtual

Resizes the ViewObjectContainer and calls CGUISrollView::AdjustScrollBar

◆ AppendColumn()

eC_Bool CGUITableView::AppendColumn ( eC_UInt  uiModelColumnIndex,
eC_Value  vWidth,
eC_Value  vMinWidth = 10,
TriggerEvent_t  eSelectionTrigger = TRIGGER_CLICK,
TriggerEvent_t  eEditTrigger = TRIGGER_DOUBLE_CLICK 
)

Establishes a mapping from a model column to a display (view) column. A column is appended at the right end of the view table. It displays the data of the model column with the given index.

Parameters
uiModelColumnIndexIndex of the column in the model whose items are displayed in the new column.
vWidthInitial width of the new column.
vMinWidthThe minimum width of the column. If a column is resized, this width is used as a limit. The default value is 10 pixel. Note if vMinWidth is greater than vWidth the column resize mode is disabled.
eSelectionTriggerDetermines with which trigger a ViewItem shall be selected, which means it is added to the selection list.
eEditTriggerDetermines with which trigger the table view will start the edit mode. If the ViewItem itself is not editable, the table view needs to start the edit mode, which it will only do if eEditTrigger is triggered.

Note that view items which are editable themselves can always update the view. For example if a CheckBox is clicked, the View will be informed about the new value even if the trigger for editing is a double click.

See also
EditItem.
Returns
True if the column was successfully appended, otherwise False.

◆ ClearSelection()

void CGUITableView::ClearSelection ( const eC_Bool  bNotifyObservers = true)

Deselects all ViewItems that are currently selected.

Parameters
bNotifyObserversSpecifies whether a notification for SelectionObservers is triggered. Defaults to TRUE.
See also
CGUIViewItem::SetSelected.

◆ CreateRowInfo()

CGUITableView::RowInfo CGUITableView::CreateRowInfo ( eC_UInt  uiRow)
protectedvirtual

Creates and initializes a new RowInfo

Parameters
uiRow
Returns
RowInfo

Reimplemented in CGUITreeView.

◆ DeselectRow()

eC_Bool CGUITableView::DeselectRow ( const eC_UInt  uiRow)

Deselects a row.

Parameters
uiRowThe row to select.
Returns
False if at least one of the row's items could not be deselected, otherwise True.

◆ DoClick()

eC_Bool CGUITableView::DoClick ( const eC_Value &  vAbsX = eC_FromInt(-1),
const eC_Value &  vAbsY = eC_FromInt(-1) 
)
virtual

Called when the object receives a click event. A click can e.g., be the result of a mouse click, a finger press/release sequence on touchscreens, or be triggered by a GK_ACTION keyboard event.

Note
DoClick() should work on the absolute positions of this object, that were set at the time of the passed redraw, as the user expects to click on what he sees and not to click on an object in a newer and probably intermediate state that he currently does not see. Thus, to calculate the relative position (where the mouse button was pressed and released at the same position for in a certain time span, relative to the origin of this object) from the vAbsY argument you must do it like this: vMyRelYPos = vAbsY - GetAbsYPos().
Parameters
vAbsXX-position in screen coordinates where the click occurred
vAbsYY-position in screen coordinates where the click occurred
Returns
True The event has been handled.
False The event has not been handled. In this base implementation it always returns False.

Reimplemented from CGUIBehaviour.

◆ DoDoubleClick()

eC_Bool CGUITableView::DoDoubleClick ( const eC_Value &  vAbsX = eC_FromInt(-1),
const eC_Value &  vAbsY = eC_FromInt(-1) 
)
virtual

Called when an object is clicked twice within a given time span.

See also
CGUIEventHandler::SetDoubleClickTime()
Note
DoDoubleClick() should work on the absolute positions of this object, that were set at the time of the passed redraw, as the user expects to click on what he sees and not to click on the object in a newer and probably intermediate state that he currently does not see in this state. Thus, to calculate the relative position (where the two clicks were done relative to the origin of this object) from the vAbsY argument you must do it like this: vMyRelYPos = vAbsY - GetAbsYPos().
Parameters
vAbsXX-position in screen coordinates where the click occurred
vAbsYY-position in screen coordinates where the click occurred
Returns
True The event has been handled.
False The event has not been handled. In this base implementation it always returns False.

Reimplemented from CGUIBehaviour.

◆ DoDraw()

eC_Bool CGUITableView::DoDraw ( )
virtual

Visualizes the object. It is forbidden to call SetRelXPos, SetRelYPos, SetWidth or SetHeight in DoDraw, i.e., it is not allowed to change the layout.

Returns
True if anything was drawn, False otherwise

Reimplemented from CGUIObject.

◆ DoKeyDown()

eC_Bool CGUITableView::DoKeyDown ( const GUIKeyIdentifier_t eKeyIdentifier,
const eC_UInt &  uiModifiers 
)
virtual

Called in reaction to a ET_KEYDOWN event, which means in general that a non-character key was pressed. For that reason you will only get the Guiliani-Key identifier (possibly with modifiers) in this slot and not the character of the pressed key.

Parameters
eKeyIdentifierThe Guiliani key identifier.
uiModifiersThe key modifiers bitfield.
Returns
True If the event has been handled.
false Else.

Reimplemented from CGUIBehaviour.

◆ DoLongClick()

eC_Bool CGUITableView::DoLongClick ( const eC_Value &  vAbsX = eC_FromInt(-1),
const eC_Value &  vAbsY = eC_FromInt(-1) 
)
virtual

Called when an object is pressed for a longer period of time.

See also
CGUIEventHandler::SetLongClickTime()
Note
DoLongClick() should work on the absolute positions of this object, that were set at the time of the passed redraw, as the user expects to click on what he sees and not to click on an object in a newer and probably intermediate state that he currently does not see. Thus, to calculate the relative position (where the mouse button was pressed and held down at the same position for a certain amount of time, relative to the origin of this object) from the vAbsY argument you must do it like this: vMyRelYPos = vAbsY - GetAbsYPos().
Parameters
vAbsXX-position in screen coordinates where the click occurred
vAbsYY-position in screen coordinates where the click occurred
Returns
True The event has been handled.
False The event has not been handled. In this base implementation it always returns False.

Reimplemented from CGUIBehaviour.

◆ EditItem()

void CGUITableView::EditItem ( const CGUIViewIndex rkIndexToEdit)
protected

Starts item editing. If the view item itself is not editable, an editor object is generated. The editor object is provided by the CGUIViewItemGenerator.

See also
CGUIViewITemGenerator GetEditorObject.
Parameters
rkIndexToEditThe index of the ViewItem that shall be edited.

◆ EnableGrid()

void CGUITableView::EnableGrid ( eC_Bool  bHorizontal,
eC_Bool  bVertical 
)

Enables drawing of grid lines between table cells.

Parameters
bHorizontalWhether horizontal lines are drawn.
bVerticalWhether vertical lines are drawn.

◆ EnsureItemIsVisible()

void CGUITableView::EnsureItemIsVisible ( const CGUIViewIndex rkViewIndex)

Update the scroll view to make the given index visible.

Parameters
rkViewIndexThe view index that should become visible.

◆ EnsureRecentlySelectedIsVisible()

void CGUITableView::EnsureRecentlySelectedIsVisible ( )

Update the scroll view to make the recently selected table item visible.

◆ GenerateViewItem()

CGUIViewItem * CGUITableView::GenerateViewItem ( const CGUIViewIndex kViewIndex)
protectedvirtual

Generates a view object for a cell using the associated generator.

Parameters
kViewIndex
Returns
view-item

Reimplemented in CGUITreeView.

◆ GetCellRect()

CGUIRect CGUITableView::GetCellRect ( const CGUIViewIndex rkViewIndex)

Returns the bounding rect for a table cell based on the view index.

Parameters
rkViewIndexThe ViewIndex.
Returns
the bounding rect of the table cell, relative to the ViewObjectContainer.

◆ GetColumnCount()

eC_UInt CGUITableView::GetColumnCount ( )
inline

Gets the current column count of the view.

Returns
const eC_UInt The column count of the view.

◆ GetColumnWidth()

eC_Value CGUITableView::GetColumnWidth ( eC_UInt  uiColumn) const

Returns the width of a view column.

Parameters
uiColumnIndex of the view column.
Returns
Width of the column, or 0 if the index is out of range.

◆ GetColumnXPos()

eC_Value CGUITableView::GetColumnXPos ( const eC_UInt &  uiColumnIndex)
protected

Returns the XPosition of a column. Used for item positioning.

Parameters
uiColumnIndex
Returns
The X position for the column (relative to the table position). -1 if the column index was invalid.

◆ GetGridColor()

eC_UInt CGUITableView::GetGridColor ( ) const
inline
Returns
The current color of the grid lines.

◆ GetGridLineWidth()

eC_Value CGUITableView::GetGridLineWidth ( ) const
inline
Returns
The current color of the grid lines.

◆ GetHeaderColor()

eC_UInt CGUITableView::GetHeaderColor ( ) const
inline
Returns
The current background color of the header items.

◆ GetHeaderHeight()

eC_Value CGUITableView::GetHeaderHeight ( ) const
inline

Get the height of the Header.

Returns
The height of the header area.

◆ GetHeaderItem()

CGUIHeaderItem * CGUITableView::GetHeaderItem ( eC_UInt  uiIndex)
protected

Helper for getting a header item.

Parameters
uiIndexIndex of the view column (position of the header item).
Returns
the header-item

◆ GetHeaderTextColor()

eC_UInt CGUITableView::GetHeaderTextColor ( ) const
inline
Returns
The current text-color of the header items.

◆ GetHeaderTextFont()

FontResource_t CGUITableView::GetHeaderTextFont ( ) const
inline
Returns
The current text-font of the header items.

◆ GetModel()

CGUITableModel* CGUITableView::GetModel ( )
inline

Get the pointer to the currently used table model.

Returns
The Pointer to the table model or NULL if no Model was set in the view.

◆ GetModelIndex()

CGUIModelIndex CGUITableView::GetModelIndex ( const CGUIViewIndex rkIndex) const

Map ViewIndex to ModelIndex

Parameters
rkIndexThe ViewIndex.
Returns
The ModelIndex.

◆ GetRowHeight()

eC_Value CGUITableView::GetRowHeight ( ) const
inline
Returns
The height of the table rows. Currently the same for each row.

◆ GetRowYPos()

eC_Value CGUITableView::GetRowYPos ( const eC_UInt &  uiRowIndex)
protected

Returns the YPosition of a row relative to the ViewItemContainer. Used for item positioning. Calculated based on RowHeight.

Parameters
uiRowIndexThe Index of the row.
Returns
The Y position of the row (relative to the table position). -1 if the row index was invalid.

◆ GetSelection()

const SelectionList& CGUITableView::GetSelection ( )
inline

Retrieve the selection list.

Returns
Reference to the selection list.

◆ GetViewIndex()

CGUIViewIndex CGUITableView::GetViewIndex ( const CGUIModelIndex rkIndex) const

Map ModelIndex to ViewIndex.

Parameters
rkIndexThe ModelIndex.
Returns
The ViewIndex.

◆ GetViewIndexByPosition()

CGUIViewIndex CGUITableView::GetViewIndexByPosition ( const eC_Value &  vAbsX,
const eC_Value &  vAbsY 
)
protected

Calculates the ViewIndex for a position. This is done based on column width and row height.

Parameters
vAbsXThe absolute X position.
vAbsYThe absolute Y position.
Returns
The ViewIndex of the ViewItem.

◆ GetViewItem()

CGUIViewItem * CGUITableView::GetViewItem ( const CGUIViewIndex rkIndex)
protected

Returns the ViewItem for a ViewIndex.

Parameters
rkIndexThe index of the ViewItem.
Returns
Pointer to the ViewItem or NULL if no ViewItem was generated (yet).

◆ HandleSelection()

eC_Bool CGUITableView::HandleSelection ( const CGUIViewIndex rkIndex,
const eC_UInt  uiModifiers 
)
protected

Helper function for DoClick and DoKeyDown to handle selection.

Parameters
rkIndexThe index of the clicked / pressed object.
uiModifiersThe currently active key modifiers.
Returns
True if the selection changed, False if not.

◆ HandleTriggerEvent()

eC_Bool CGUITableView::HandleTriggerEvent ( const eC_Value &  vAbsX,
const eC_Value &  vAbsY,
const TriggerEvent_t eTriggerEvent,
eC_UInt  uiModifiers 
)
protected

Helper function for click and keyboard events. Checks if the trigger is allowed and selects the item / starts editing.

Parameters
vAbsXx-position
vAbsYy-position
eTriggerEventtrigger
uiModifiersmodifiers
Returns
true on success

◆ HideRow()

eC_Bool CGUITableView::HideRow ( const eC_UInt  uiRowIndex,
const eC_Bool  bHide = true 
)

Hide a row or make it visible again. The row is no longer displayed when it is hidden. The following rows are moved up.

Parameters
uiRowIndexThe index of the row to hide / show again.
bHideTrue to hide a row, false to show it again.
Returns
True in case of success, False else.

◆ HideRows()

eC_Bool CGUITableView::HideRows ( const eC_UInt  uiStartRowIndex,
const eC_UInt  uiEndRowIndex,
eC_Bool  bHide = true 
)

Hide a range of rows or make them visible again.

See also
HideRow().
Parameters
uiStartRowIndexThe first row of the range.
uiEndRowIndexThe last row of the range (included).
bHideSet to true to hide rows, false to make them visible again.
Returns
True in case of success, False else.

◆ InsertColumn()

eC_Bool CGUITableView::InsertColumn ( eC_UInt  uiColumnIndex,
eC_UInt  uiModelColumnIndex,
eC_Value  vWidth,
eC_Value  vMinWidth = 10,
TriggerEvent_t  eSelectionTrigger = TRIGGER_CLICK,
TriggerEvent_t  eEditTrigger = TRIGGER_DOUBLE_CLICK 
)
virtual

Establishes a mapping from a model column to a display (view) column.

Parameters
uiColumnIndexThe column Index in the view.
uiModelColumnIndexIndex of the column in the model whose items are displayed in the new column.
vWidthInitial width of the new column.
vMinWidthThe minimum width of the column. If a column is resized, this width is used as a limit. The default value is 10 pixel. Note if vMinWidth is greater than vWidth the column resize mode is disabled.
eSelectionTriggerDetermines with which trigger a ViewItem shall be selected, which means it is added to the selection list.
eEditTriggerDetermines with which trigger the table view will start the edit mode. If the ViewItem itself is not editable, the table view needs to start the edit mode, which it will only do if eEditTrigger is triggered.

Note that view items which are editable themselves can always update the view. For example if a CheckBox is clicked, the View will be informed about the new value even if the trigger for editing is a double click.

See also
EditItem.
Returns
True if the column was successfully inserted, otherwise False.

Reimplemented in CGUITreeView.

◆ InsertRows()

void CGUITableView::InsertRows ( eC_UInt  uiStartRow,
eC_UInt  uiEndRow 
)
protected

Notifies this view that its model was changed. Do not call this method from user code.

Parameters
uiStartRowIndex of the first inserted row.
uiEndRowIndex of the row after the last inserted one.

◆ InvalidateAreaOfHorizontalLine()

void CGUITableView::InvalidateAreaOfHorizontalLine ( const eC_UInt &  uiRow)
protected

Helper function to make sure that grid lines are redrawn. Invalidates the grid line between uiRow -1 and uiRow.

Parameters
uiRow

◆ IsItemSelected() [1/2]

eC_Bool CGUITableView::IsItemSelected ( const CGUIViewIndex rkIndex)

Indicates if a cell is selected or not.

Parameters
rkIndexThe Index of the cell / the ViewItem to check.
Returns
True if selected, False else.

◆ IsItemSelected() [2/2]

eC_Bool CGUITableView::IsItemSelected ( CGUIViewItem pkViewItem)
protected

Retrieve the selection state of an item

Parameters
pkViewItemThe pkViewItem to check.
Returns
True if the item is currently in "selected mode", False else.

◆ IsRowHidden()

eC_Bool CGUITableView::IsRowHidden ( const eC_UInt  uiRowIndex) const

Check if a row is hidden or not.

Parameters
uiRowIndexThe index of the row to check.
Returns
True if the row is hidden, False if not.

◆ ItemEdited()

void CGUITableView::ItemEdited ( const CGUIViewIndex rkIndex,
const CGUIValue kNewValue 
)
protectedvirtual

Called by the ViewItems if the value has changed. The model will be updated with the new value.

Parameters
rkIndexThe ViewIndex of the updated Item.
kNewValueThe new Value.

◆ ItemIsEditable()

eC_Bool CGUITableView::ItemIsEditable ( const CGUIViewIndex rkIndex)
protected

Check if an item is editable.

Parameters
rkIndexThe index of the item to check.
Returns
True if the item is editable, False else.

◆ ItemIsSelectable()

eC_Bool CGUITableView::ItemIsSelectable ( const CGUIViewIndex rkIndex)
protected

Check if an item is selectable.

Parameters
rkIndexThe index of the item to check.
Returns
True if the item is selectable, False else.

◆ ModelColumnContainedInView()

eC_Bool CGUITableView::ModelColumnContainedInView ( const eC_UInt  uiModelColumnIndex) const

Check if a ModelColumn is contained in the view.

Parameters
uiModelColumnIndexThe Model column to check.
Returns
True if the column is contained, False else.
See also
InsertColumn.
AppendColumn.

◆ ModifyCellRect()

virtual void CGUITableView::ModifyCellRect ( CGUIRect CellRect,
CGUIViewItem pItem 
)
inlineprotectedvirtual

Implements Dependencies of View Item Rectangle from Model

Parameters
CellRectInput and Output parameter containing the original and then modified rectangle.
pItemThe corresponding ViewItem.

Reimplemented in CGUITreeView.

◆ ReadFromStream()

void CGUITableView::ReadFromStream ( )
virtual

Reads composite object attributes and children from stream. Reads attributes from the streaming file. Only for use with GUIFactoryManager.

See also
CGUIObject::ReadFromStream()
Exceptions
CGUIStreamingControlExceptionWhen catching a CGUIStreamingControlException from a child, this method adds the object from the exception, resets the object pointer to 'this', then re-throws.

Reimplemented from CGUIScrollView.

◆ RegenerateViewItem()

void CGUITableView::RegenerateViewItem ( const CGUIViewIndex rkIndex)

Regenerate a view item for a cell. This is needed when a new generator was set. The ViewItemGenerator will be triggered to generate a ViewItem. The old ViewItem and its ViewObject will be deleted.

Parameters
rkIndexThe ViewIndex of the ViewItem to regenerate.

◆ RegenerateViewItems()

void CGUITableView::RegenerateViewItems ( const eC_UInt  cuiColumn)

Regenerate all view items of the column with index of parameter cuiColumn. This is needed when a new generator was set. The ViewItemGenerator will be triggered to generate the ViewItems. The old ViewItem and its ViewObject will be deleted.

Parameters
cuiColumnThe column index for re-generation.

◆ RegenerateViewItemsFromColumn()

void CGUITableView::RegenerateViewItemsFromColumn ( const eC_UInt  cuiColumn)

Regenerate all view items of each column its index is equal to and greater than the index of parameter cuiColumn. The ViewItemGenerator will be triggered to generate the ViewItems. All old ViewItems and its ViewObject will be deleted.

Parameters
cuiColumnThe column index for starting re-generation.

◆ RemoveAllItemsFromSelection()

void CGUITableView::RemoveAllItemsFromSelection ( )
protected

Internal helper for selection handling. Clears the selection. This method does not trigger SelectionUpdated();

◆ RemoveAutoResizedColumn()

void CGUITableView::RemoveAutoResizedColumn ( const eC_UInt  cuiColumn)

Remove a column index from auto resize column list.

Parameters
cuiColumnThe column index to remove.
See also
AdjustAutoresizedColumn()

◆ RemoveColumn()

eC_Bool CGUITableView::RemoveColumn ( eC_UInt  uiColumnIndex)
virtual

Removes the column with given index from the view.

Parameters
uiColumnIndexThe index of the column to remove.
Returns
True if the column was successfully removed, else False.

Reimplemented in CGUITreeView.

◆ RemoveHeaderItem()

void CGUITableView::RemoveHeaderItem ( eC_UInt  uiIndex)
protected

Helper for removing a header item.

Parameters
uiIndexThe index of the view column (position of the header item).

◆ RemoveItemFromSelection()

eC_Bool CGUITableView::RemoveItemFromSelection ( const CGUIViewIndex rkIndex)
protected

Internal helper for selection handling. Removes item from the selection list and sets it unselected. This method does not trigger SelectionUpdated().

See also
CGUIViewItem::AddItemToSelection.
Parameters
rkIndexThe Index of the ViewItem to set unselected.
Returns
True if the item was successfully added, otherwise False.

◆ RemoveRows()

void CGUITableView::RemoveRows ( eC_UInt  uiStartRow,
eC_UInt  uiEndRow 
)
protected

Notifies this view that its model was changed. Do not call this method from user code.

Parameters
uiStartRowIndex of the first removed row.
uiEndRowIndex of the row after the last removed one.

◆ RepositionViewItem()

void CGUITableView::RepositionViewItem ( CGUIViewItem pViewItem)
protectedvirtual

Updates the position of a view object based on the ViewIndex and sets the TableView as parent.

Parameters
pViewItemThe ViewItem that shall be re-positioned.

◆ RepositionViewItemIterative()

void CGUITableView::RepositionViewItemIterative ( CGUIViewItem pViewItem,
const RowInfo pkRowInfo,
eC_UInt &  uiNofVisibleRows 
)
protected

Updates the position of a view object based on the ViewIndex and sets the TableView as parent. The method has enhanced performance to RepositionViewItem. However, it is needed to call the method iteratively with subsequent ViewItems and the previously calculated Number of visible rows.

eC_UInt uiNofVisibleRows = 0;
FOR_ALL_FORWARD(itRow, (*itCol).m_kViewItems)
{
RepositionViewItemIterative(*itRow, uiNofVisibleRows);
}
Parameters
pViewItemThe ViewItem that shall be re-positioned.
pkRowInfoInfo structure for row to process, might be NULL
[in,out]uiNofVisibleRowsNumber of visible rows

◆ RepositionViewItems()

void CGUITableView::RepositionViewItems ( const eC_UInt  cuiColumn)
protectedvirtual

Updates the position of all view items of the column with index of parameter uiColumn. Used for resizing of columns.

Parameters
cuiColumnThe column index for re-positioning.

◆ RepositionViewItemsFromColumn()

void CGUITableView::RepositionViewItemsFromColumn ( const eC_UInt  cuiColumn)
protectedvirtual

Updates the position of all view items of each column its index is equal to and greater than the parameter uiColumn. Used for resizing of columns.

Parameters
cuiColumnThe column index to start with re-positioning.

◆ RepositionViewItemsFromRow()

void CGUITableView::RepositionViewItemsFromRow ( const eC_UInt  uiRow)
protectedvirtual

Updates the position of all view items of each row >= uiRow. Used for resizing of columns.

Parameters
uiRowThe row index to start with re-positioning.

◆ SelectBlock()

eC_Bool CGUITableView::SelectBlock ( const CGUIViewIndex rkFromIndex,
const CGUIViewIndex rkToIndex 
)
protected

Selects a range of cells.

Parameters
rkFromIndexThe StartIndex of the selection.
rkToIndexThe index for the last item to select.
Returns
True if the selection was successful, False else.

◆ SelectColumn()

eC_Bool CGUITableView::SelectColumn ( const eC_UInt  uiColumn)

Select a column.

Note
This function does not clear the old selection before selecting the column.
Parameters
uiColumnThe column to select.
Returns
False if at lease one of the column's items could not be selected, otherwise True.

◆ SelectionUpdated()

virtual void CGUITableView::SelectionUpdated ( )
inlineprotectedvirtual

Callback that informs inherited classes about a selection update. Override this method to react on changed selection.

See also
GetSelection()

◆ SelectItem()

eC_Bool CGUITableView::SelectItem ( const CGUIViewIndex rkIndex)

If the item is selectable (ItemIsSelectable()) this method selects an item.

Note
This function does not clear the old selection before selecting the item.
Parameters
rkIndexThe Index of the Item to select.
Returns
True if the item was successfully selected, otherwise False.

◆ SelectItems()

eC_Bool CGUITableView::SelectItems ( const SelectionList rkItemList)

Select a list of items.

Note
This function does not clear the old selection before selecting the items.
See also
SelectItem
Parameters
rkItemListThe list of ViewItems to be selected.
Returns
False if at least one of the items could not be selected, otherwise True.

◆ SelectRow()

eC_Bool CGUITableView::SelectRow ( const eC_UInt  uiRow)

Select a row.

Note
This function does not clear the old selection before selecting the row.
Parameters
uiRowThe row to select.
Returns
False if at least one of the row's items could not be selected, otherwise True.

◆ SetAutoResizedColumn()

void CGUITableView::SetAutoResizedColumn ( const eC_UInt  cuiColumn)

Set a column index to auto resize column list. The columns within the list are automatically resized when the table is resized. Columns will never get smaller than their minimum size.

Parameters
cuiColumnThe column index to add.
See also
AdjustAutoresizedColumn()

◆ SetColumnWidth()

eC_Bool CGUITableView::SetColumnWidth ( eC_UInt  uiColumn,
eC_Value  vWidth,
const eC_Bool  cbAdjust = true 
)

Sets the width of a view column.

Parameters
uiColumnIndex of the column in the view.
vWidthNew width of the column.
cbAdjustEnable or disable automatic alignment. The default value is true.
Returns
True if the column width was successfully set, False else.

◆ SetDefaultColumnViewGenerator()

void CGUITableView::SetDefaultColumnViewGenerator ( const eC_UInt  uiColumn,
CGUIViewItemGenerator pkViewItemGenerator 
)

set a default view item generator for a column

Parameters
uiColumn
pkViewItemGenerator

◆ SetDefaultViewGenerator()

void CGUITableView::SetDefaultViewGenerator ( CGUIViewItemGenerator pkViewItemGenerator)

set a default view item generator for the table.

Parameters
pkViewItemGenerator

◆ SetGridColor()

void CGUITableView::SetGridColor ( eC_UInt  uiColor)

Changes the color of the grid lines.

Parameters
uiColorThe new color in ARGB format.

◆ SetGridLineWidth()

void CGUITableView::SetGridLineWidth ( eC_Value  vGridLineWidth)

Changes the width of the grid lines. The view is automatically adjusted.

Parameters
vGridLineWidthThe width of the grid lines in pixel.

◆ SetHeaderColor()

void CGUITableView::SetHeaderColor ( eC_UInt  uiColor)

Changes the background color of the header items.

Parameters
uiColorThe new color in ARGB format.

◆ SetHeaderHeight()

void CGUITableView::SetHeaderHeight ( eC_Value  vHeaderHeight)

Changes the height of the header area. The header is automatically adjusted.

Parameters
vHeaderHeightThe new height of the header area.

◆ SetHeaderTextColor()

void CGUITableView::SetHeaderTextColor ( eC_UInt  uiColor)

Changes the background color of the header items.

Parameters
uiColorThe new color in ARGB format.

◆ SetHeaderTextFont()

void CGUITableView::SetHeaderTextFont ( const FontResource_t eHeaderTextFont)

Changes the font of the header items.

Parameters
eHeaderTextFontThe new font in ARGB format.

◆ SetHeight()

void CGUITableView::SetHeight ( const eC_Value &  crvHeight)
virtual

Resizes the table and all columns within the auto resized list.

Parameters
crvHeightThe new height of the table.
See also
SetAutoResizedColumn()
AdjustAutoresizedColumn()

Reimplemented from CGUIScrollView.

◆ SetModel()

void CGUITableView::SetModel ( CGUITableModel pkModel)

Sets a model whose data is to be displayed by this view.

Parameters
pkModelPointer to the model to be displayed. Pass NULL to clear the view.

◆ SetRowHeight()

eC_Bool CGUITableView::SetRowHeight ( const eC_Value &  crvRowHeight)

Set the height of the table rows. Currently the same for each row. The view is automatically adjusted.

Parameters
crvRowHeightThe row height to set.
See also
GetRowHeight()
Returns
True if successful, False otherwise

◆ SetSelectionMode()

void CGUITableView::SetSelectionMode ( SelectionMode_t  eSelectionMode)
inline

Set the SelectionMode for the View. The selection mode is checked when a selection update based on user input is triggered. When using the public API to select items, the selection mode is not checked.

Parameters
eSelectionModeThe allowed selection.

◆ SetViewGenerator()

void CGUITableView::SetViewGenerator ( const CGUIViewIndex rkIndex,
CGUIViewItemGenerator pkViewItemGenerator 
)

set a view item generator for a cell.

Parameters
rkIndex
pkViewItemGenerator

◆ SetViewItemsGap()

void CGUITableView::SetViewItemsGap ( const eC_Value &  crvViewItemsGap)

Set the left and right gap between view items and grid. The view items are automatically repositioned.

Parameters
crvViewItemsGapThe gap between view items.

◆ SetViewItemsGapVertical()

void CGUITableView::SetViewItemsGapVertical ( const eC_Value &  crvViewItemsGapVertical)

Set the top and bottom gap between view items and grid. The view items are automatically repositioned.

Parameters
crvViewItemsGapVerticalThe gap between view items.

◆ SetWidth()

void CGUITableView::SetWidth ( const eC_Value &  crvWidth)
virtual

Resizes the table and all columns within the auto resized list.

Parameters
crvWidthThe new width of the table.
See also
SetAutoResizedColumn()
AdjustAutoresizedColumn()

Reimplemented from CGUIScrollView.

◆ StopEditing()

void CGUITableView::StopEditing ( eC_Bool  bMoveFocusToViewItem = true)
protected

Hides editor object (if currently visible).

Parameters
bMoveFocusToViewItemIf true the table view will try to set the focus to the currently edited ViewObject. Set this parameter to false, if the view item will be deleted in the next step.

◆ ToggleSelection()

eC_Bool CGUITableView::ToggleSelection ( const CGUIViewIndex rkIndex)
protected

Toggles selection of an item.

Parameters
rkIndexThe index of the item to toggle.
Returns
True if the toggle operation was successful, False else.

◆ ToggleSelectionForRow()

eC_Bool CGUITableView::ToggleSelectionForRow ( const eC_UInt  uiRow)
protected

Toggles selection of a row.

Parameters
uiRowThe row of the item to toggle.
Returns
True if the toggle operation was successful, False else.

◆ UpdateHeaderItems()

void CGUITableView::UpdateHeaderItems ( )
protected

Changes the texts on existing header items and updates their width based on the column width. Call this if a new model has been set or the column width was changed.

◆ UpdateViewItem()

void CGUITableView::UpdateViewItem ( const CGUIModelIndex crkModelIndex,
const CGUIValue crkNewValue 
)
protected

Called by the model to update the view item with new data.

Parameters
crkModelIndexThe ModelIndex.
crkNewValueThe new value.

◆ ViewItemUpdated()

virtual void CGUITableView::ViewItemUpdated ( const CGUIViewIndex rkIndex,
const CGUIValue kNewValue 
)
inlineprotectedvirtual

Callback called whenever a view item was updated. ViewItems use this callback to inform the view about changed values.

Parameters
rkIndexThe ViewIndex
kNewValueThe new value.

◆ WriteToStream()

void CGUITableView::WriteToStream ( const eC_Bool  bWriteClassID = false)
virtual

Since the content (children) depend on the model, all children are removed from the row and header containers before calling the base class implementation. Afterwards, the children are added again. Writes attributes to the streaming file. A CGUIStreamWriter has to be initialized.

Parameters
bWriteClassIDThis flag is used to switch writing of the class ID, leading and trailing tags. When implementing a new streamable object, check this flag. If it is true, first write the class ID, then continue with this object's attributes, and finally call the base class implementation with this flag set to false (this is the default).

Reimplemented from CGUIScrollView.

Friends And Related Function Documentation

◆ CGUIHeaderItem

friend class CGUIHeaderItem
friend

◆ CGUITableModel

friend class CGUITableModel
friend

The model needs to call the protected Insert/Remove/Update methods.

◆ CGUIViewItem

friend class CGUIViewItem
friend

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