TalanSoft Toolkits  201707
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
List of all members
iUIContext Struct Referenceabstract
Inheritance diagram for iUIContext:
iUnknown

Detailed Description

UI Context interface.

Graphics context

virtual iGraphicsGetGraphics () const =0
 Get the parent graphics object. {Property}. More...
 
virtual iGraphicsContextGetGraphicsContext () const =0
 Get the parent graphics context attached to this UI context. {Property}. More...
 

Input

virtual void SendWindowMessage (eOSWindowMessage aMsg, const Var &avarA, const Var &avarB)=0
 Send a Window message to the UI context. More...
 
virtual void SetInputModifiers (tU32 anInputModifier)=0
 Set the input modifiers. More...
 
virtual tU32 GetInputModifiers () const =0
 Get the input modifiers. More...
 
virtual void SetDefaultInputSubmitFlags (tUIInputSubmitFlags aSubmitFlags)=0
 Set the default input submit flags. {Property}. More...
 
virtual tUIInputSubmitFlags GetDefaultInputSubmitFlags () const =0
 Get the default input submit flags. {Property}. More...
 
virtual void SetHoverDelay (tF32 afDelay)=0
 Set the hovering delay in seconds. {Property}. More...
 
virtual tF32 GetHoverDelay () const =0
 Get the hovering delay in seconds. {Property}. More...
 
virtual void SetHoverInputModifiers (tU32 anInputModifiers)=0
 Set the input modifier required to enable the hover. More...
 
virtual tU32 GetHoverInputModifiers () const =0
 Get the input modifier required to enable the hover. More...
 
virtual tBool GetKeyDown (tU8 aKey) const =0
 Get a keyboard key's down state. {Property}. More...
 
virtual void InputFingerMove (tU32 anFinger, const sVec3f &avPosition)=0
 
virtual void InputFingerRelativeMove (tU32 anFinger, const sVec3f &avRelMove)=0
 
virtual void InputFingerPress (tU32 anFinger, const sVec3f &avPosition, tBool abDown)=0
 
virtual void InputKeyPress (eKey aKey, tBool abDown)=0
 
virtual void InputKeyChar (tU32 aCharCodePoint, eKey aKeyLeadingToKeyChar)=0
 
virtual void InputMouseWheel (const tF32 afDelta)=0
 
virtual void InputDoubleClick (ePointerButton aPointer)=0
 
virtual void InputRelativeMouseMove (const sVec2f &avRelMove)=0
 
virtual void InputGameCtrl (iGameCtrl *apGameController)=0
 
virtual void InputPinch (const tF32 afScale)=0
 

Skins

virtual void SetImageMap (iImageMap *apImageMap)=0
 Set the context's image map. {Property}. More...
 
virtual iImageMapGetImageMap () const =0
 Get the context's image map. {Property}. More...
 
virtual tBool SetErrorOverlay (iOverlay *apOverlay)=0
 Get the error overlay. {Property}. More...
 
virtual iOverlayGetErrorOverlay () const =0
 Get the error overlay. {Property}. More...
 
virtual void ClearSkins ()=0
 Remove all skins loaded. More...
 
virtual tBool AddSkin (iDataTable *apDT)=0
 Add a new skin. More...
 
virtual tBool AddSkinFromRes (iHString *ahspRes)=0
 Add a new skin from the specified resource. More...
 
virtual tBool RemoveSkin (iHString *ahspSkin)=0
 Unload a skin. More...
 
virtual tBool SetDefaultSkin (iHString *ahspName)=0
 Set the default skin. {Property}. More...
 
virtual iHStringGetDefaultSkin () const =0
 Get the default skin. {Property}. More...
 
virtual tU32 GetNumSkins () const =0
 Get the number of skins. {Property}. More...
 
virtual iHStringGetSkinName (tU32 anIndex) const =0
 Get the name of the skin at the specified index. {Property}. More...
 
virtual tU32 GetSkinIndex (iHString *ahspName) const =0
 Get the index of the skin with the specified name. More...
 
virtual iDataTableGetSkinDataTable (iHString *ahspSkin) const =0
 Get the data table associated with the specified skin. {Property}. More...
 
virtual tBool ApplySkin (iWidget *apWidget, iHString *ahspName)=0
 Apply the specified skin to a widget and all its children. More...
 
virtual iFontFindSkinFont (iHString *ahspSkin, iHString *ahspClass, iHString *ahspState, iHString *ahspName) const =0
 Find the font of the specified item in the widget's skin. More...
 
virtual iOverlayFindSkinCursor (iHString *ahspSkin, iHString *ahspClass, iHString *ahspState, iHString *ahspName) const =0
 Find the cursor of the specified item in the widget's skin. More...
 
virtual iOverlayFindSkinElement (iHString *ahspSkin, iHString *ahspClass, iHString *ahspState, iHString *ahspName) const =0
 Find the element of the specified item in the widget's skin. More...
 
virtual sColor4f FindSkinColor (const sColor4f &aDefault, iHString *ahspSkin, iHString *ahspClass, iHString *ahspState, iHString *ahspName) const =0
 Find the color of the specified item in the widget's skin. More...
 

Widgets

virtual tBool HasWidgetSinkClass (const achar *aszClassName) const =0
 Check whether the specified widget sink class can be created. More...
 
virtual iWidgetSinkCreateWidgetSink (const achar *aszClassName, iWidget *apWidget)=0
 Create a widget sink of the specified class. More...
 
virtual iWidgetSinkCreateWidgetSinkFromScript (iHString *ahspRes)=0
 Create a widget sink from the the specified script script. More...
 
virtual iWidgetCreateWidget (const achar *aszClassName, iWidget *apwParent, const sRectf &arectPos=sRectf::Null(), tU32 anStyle=0, iHString *ahspID=NULL)=0
 Create a widget. More...
 
virtual iWidgetCreateWidgetRaw (const achar *aszClassName, iWidget *apwParent, const sRectf &arectPos=sRectf::Null(), tU32 anStyle=0, iHString *ahspID=NULL)=0
 Create a widget without attaching any sink to it. More...
 
virtual iWidgetCreateWidgetFromDataTable (iDataTable *apDT, iWidget *apwParent, iHString *ahspID, iHString *ahspTitle)=0
 Create a widget from the specified datatable. More...
 
virtual iWidgetCreateWidgetFromResource (iHString *ahspRes, iWidget *apwParent, iHString *ahspID, iHString *ahspTitle)=0
 Create a widget from a datatable in the specified resource. More...
 
virtual iWidgetGetRootWidget () const =0
 Get the root widget. {Property}. More...
 
virtual tBool SetActiveWidget (iWidget *apWidget)=0
 Set the active widget. {Property}. More...
 
virtual iWidgetGetActiveWidget () const =0
 Get the active widget. {Property}. More...
 
virtual tU32 GetNumWidgets () const =0
 Get the number of widgets created. {Property}. More...
 
virtual iWidgetGetWidget (tU32 anIndex) const =0
 Get the widget at the specified index. {Property}. More...
 
virtual tBool SerializeWidget (iWidget *apWidget, iDataTable *apDT, tWidgetSerializeFlags anFlags, iRegex *apFilter)=0
 Serialize the specified widget. More...
 
virtual iWidgetCommandCreateWidgetCommand ()=0
 Create a widget command instance. More...
 
virtual tBool SendCommand (iWidget *apDest, iWidgetCommand *apCmd)=0
 Send a command to the specified widget. More...
 
virtual void Draw ()=0
 Draw the GUI. More...
 
virtual void DrawCursor (iOSWindow *apWindow)=0
 Draw the current mouse cursor or set it as hardware cursor on the specified window if it is specified and supported by the graphics context. More...
 
virtual tBool Update (tF32 fTime)=0
 Updates the GUI. More...
 
virtual tBool Resize (const sRectf &aRootRect)=0
 Resize the UI context. More...
 
virtual void SetDebugDraw (tBool abDebug)=0
 Set whether debug draw is enabled. {Property}. More...
 
virtual tBool GetDebugDraw () const =0
 Get whether debug draw is enabled. {Property}. More...
 

Cursor

virtual tBool SetCursor (iOverlay *pCursor)=0
 Set the current mouse cursor. {Property}. More...
 
virtual iOverlayGetCursor () const =0
 Get the current mouse cursor. {Property}. More...
 
virtual sVec2f GetCursorPosition () const =0
 Get the cursor position. {Property}. More...
 

Toolbar

virtual void InitializeDefaultToolbar ()=0
 Initialize the a toolbar in the root widget. More...
 
virtual ni::tBool SetToolbar (iWidget *apToolbar)=0
 Set the UI default toolbar. {Property}. More...
 
virtual ni::iWidgetGetToolbar () const =0
 Get the UI default toolbar. {Property}. More...
 

DrawOpCapture

virtual void SetDrawOpCapture (tBool abEnabled)=0
 Set whether the draw operation capture hud is enabled. {Property}. More...
 
virtual ni::tBool GetDrawOpCapture () const =0
 Get whether the draw operation capture hud is enabled. {Property}. More...
 

Manual drawing

virtual tBool DrawWidget (iWidget *apWidget, iCanvas *apCanvas)=0
 Draw the specified widget in the specified canvas. More...
 
virtual tBool DrawTransformedWidget (iWidget *apWidget, iCanvas *apCanvas, const sMatrixf &aBaseMatrix)=0
 Draw the specified widget in the specified canvas. The widget is transformed using the specified matrix. Clipping and scissoring is disabled. More...
 

UI behaviors

virtual void SetDragStartDistance (tU32 anPixelDistance)=0
 Set the drag start distance. More...
 
virtual tU32 GetDragStartDistance () const =0
 Get the drag start distance. {Property}. More...
 

Finger

virtual void SetDragFingerStartDistance (tU32 anFinger, tU32 anPixelDistance)=0
 Set the drag finger start distance. More...
 
virtual tU32 GetDragFingerStartDistance (tU32 anFinger) const =0
 Get the drag finger start distance. {Property}. More...
 
virtual sVec3f GetFingerPosition (tU32 anFinger) const =0
 Get a finger's latest screen position and pressure. {Property}. More...
 
virtual tBool GetFingerDown (tU32 anFinger) const =0
 Get a finger's latest down state. {Property}. More...
 

Shorcuts

virtual void ClearShortcuts ()=0
 Remove all shortcuts. More...
 
virtual void AddShortcut (tU32 anKey, iHString *ahspCmd)=0
 Add a shortcut. More...
 
virtual void RemoveShortcut (tU32 anKey)=0
 Remove a shortcut. More...
 
virtual iHStringGetShortcutCommand (tU32 anKey) const =0
 Get the command of the specified shortcut. {Property}. More...
 

Profiler

virtual iProfDrawCreateProfDraw (iCanvas *apCanvas, iFont *apFont) const =0
 Create an iProfDraw instance which uses the specifed canvas and font. More...
 

Additional Inherited Members

- Public Member Functions inherited from iUnknown
virtual tBool IsOK () const =0
 Check if the object is valid. More...
 
virtual tI32 AddRef ()=0
 Signal that one more reference of the object has been created. More...
 
virtual tI32 Release ()=0
 Release a reference of the object. More...
 
virtual void DeleteThis ()=0
 Bypass any reference counting and delete this object. More...
 
virtual void Invalidate ()=0
 Invalidate the object. More...
 
virtual iUnknownQueryInterface (const tUUID &aIID)=0
 Query an interface. More...
 
virtual void ListInterfaces (iMutableCollection *apLst, tU32 anFlags) const =0
 Fill a UUID list containing the UUIDs of the implemented interfaces. More...
 
virtual tI32 SetNumRefs (tI32 anNumRefs)=0
 Set the reference counter directly. More...
 
virtual tI32 GetNumRefs () const =0
 Get the number of references to this object. More...
 

Member Function Documentation

virtual iGraphics* GetGraphics ( ) const
pure virtual

Get the parent graphics object. {Property}.

virtual iGraphicsContext* GetGraphicsContext ( ) const
pure virtual

Get the parent graphics context attached to this UI context. {Property}.

virtual void SendWindowMessage ( eOSWindowMessage  aMsg,
const Var avarA,
const Var avarB 
)
pure virtual

Send a Window message to the UI context.

Remarks
This method should be called in the application's window message sink to send input to the UI context.
virtual void SetInputModifiers ( tU32  anInputModifier)
pure virtual

Set the input modifiers.

See also
ni::eUIInputModifier {Property}
virtual tU32 GetInputModifiers ( ) const
pure virtual

Get the input modifiers.

See also
ni::eUIInputModifier {Property}
virtual void SetDefaultInputSubmitFlags ( tUIInputSubmitFlags  aSubmitFlags)
pure virtual

Set the default input submit flags. {Property}.

virtual tUIInputSubmitFlags GetDefaultInputSubmitFlags ( ) const
pure virtual

Get the default input submit flags. {Property}.

virtual void SetHoverDelay ( tF32  afDelay)
pure virtual

Set the hovering delay in seconds. {Property}.

Remarks
Default is 0 which means that it is disabled.
virtual tF32 GetHoverDelay ( ) const
pure virtual

Get the hovering delay in seconds. {Property}.

virtual void SetHoverInputModifiers ( tU32  anInputModifiers)
pure virtual

Set the input modifier required to enable the hover.

See also
ni::eUIInputModifier {Property}
virtual tU32 GetHoverInputModifiers ( ) const
pure virtual

Get the input modifier required to enable the hover.

See also
ni::eUIInputModifier {Property}
virtual void SetImageMap ( iImageMap apImageMap)
pure virtual

Set the context's image map. {Property}.

virtual iImageMap* GetImageMap ( ) const
pure virtual

Get the context's image map. {Property}.

virtual tBool SetErrorOverlay ( iOverlay apOverlay)
pure virtual

Get the error overlay. {Property}.

virtual iOverlay* GetErrorOverlay ( ) const
pure virtual

Get the error overlay. {Property}.

virtual void ClearSkins ( )
pure virtual

Remove all skins loaded.

Remarks
The default skin will remain.
A SkinChanged message will be broadcasted to all widgets when the skins are cleared.
virtual tBool AddSkin ( iDataTable apDT)
pure virtual

Add a new skin.

Remarks
If a skin with the specified name has already been loaded the method will fail.
virtual tBool AddSkinFromRes ( iHString ahspRes)
pure virtual

Add a new skin from the specified resource.

virtual tBool RemoveSkin ( iHString ahspSkin)
pure virtual

Unload a skin.

Remarks
The default skin cannot be removed
virtual tBool SetDefaultSkin ( iHString ahspName)
pure virtual

Set the default skin. {Property}.

virtual iHString* GetDefaultSkin ( ) const
pure virtual

Get the default skin. {Property}.

virtual tU32 GetNumSkins ( ) const
pure virtual

Get the number of skins. {Property}.

virtual iHString* GetSkinName ( tU32  anIndex) const
pure virtual

Get the name of the skin at the specified index. {Property}.

virtual tU32 GetSkinIndex ( iHString ahspName) const
pure virtual

Get the index of the skin with the specified name.

Remarks
Return eInvalidHandle if the skin does not exist. {Property}
virtual iDataTable* GetSkinDataTable ( iHString ahspSkin) const
pure virtual

Get the data table associated with the specified skin. {Property}.

virtual tBool ApplySkin ( iWidget apWidget,
iHString ahspName 
)
pure virtual

Apply the specified skin to a widget and all its children.

virtual iFont* FindSkinFont ( iHString ahspSkin,
iHString ahspClass,
iHString ahspState,
iHString ahspName 
) const
pure virtual

Find the font of the specified item in the widget's skin.

virtual iOverlay* FindSkinCursor ( iHString ahspSkin,
iHString ahspClass,
iHString ahspState,
iHString ahspName 
) const
pure virtual

Find the cursor of the specified item in the widget's skin.

virtual iOverlay* FindSkinElement ( iHString ahspSkin,
iHString ahspClass,
iHString ahspState,
iHString ahspName 
) const
pure virtual

Find the element of the specified item in the widget's skin.

virtual sColor4f FindSkinColor ( const sColor4f aDefault,
iHString ahspSkin,
iHString ahspClass,
iHString ahspState,
iHString ahspName 
) const
pure virtual

Find the color of the specified item in the widget's skin.

virtual tBool HasWidgetSinkClass ( const achar aszClassName) const
pure virtual

Check whether the specified widget sink class can be created.

virtual iWidgetSink* CreateWidgetSink ( const achar aszClassName,
iWidget apWidget 
)
pure virtual

Create a widget sink of the specified class.

virtual iWidgetSink* CreateWidgetSinkFromScript ( iHString ahspRes)
pure virtual

Create a widget sink from the the specified script script.

virtual iWidget* CreateWidget ( const achar aszClassName,
iWidget apwParent,
const sRectf arectPos = sRectf::Null(),
tU32  anStyle = 0,
iHString ahspID = NULL 
)
pure virtual

Create a widget.

virtual iWidget* CreateWidgetRaw ( const achar aszClassName,
iWidget apwParent,
const sRectf arectPos = sRectf::Null(),
tU32  anStyle = 0,
iHString ahspID = NULL 
)
pure virtual

Create a widget without attaching any sink to it.

Remarks
Use ni::iWidget::AddSink, ni::iWidget::AddPostSink, ni::iWidget::AddClassSink or ni::iWidget::AddClassPostSink to add custom or registered sink.
virtual iWidget* CreateWidgetFromDataTable ( iDataTable apDT,
iWidget apwParent,
iHString ahspID,
iHString ahspTitle 
)
pure virtual

Create a widget from the specified datatable.

Remarks
apwParent is the parent widget, if specified the datatable is loaded in a Canvas widget with a fill dock style, if not the datatable is loaded in a Form widget with a snap center dock style.
ahspID if not null is the id of the widget (overwrite the 'id' property in the datatable).
ahspTitle if not null is the title of the form widget (overwrite the 'title' property in the datatable).
Returns
The newly created widget.
virtual iWidget* CreateWidgetFromResource ( iHString ahspRes,
iWidget apwParent,
iHString ahspID,
iHString ahspTitle 
)
pure virtual

Create a widget from a datatable in the specified resource.

virtual iWidget* GetRootWidget ( ) const
pure virtual

Get the root widget. {Property}.

virtual tBool SetActiveWidget ( iWidget apWidget)
pure virtual

Set the active widget. {Property}.

virtual iWidget* GetActiveWidget ( ) const
pure virtual

Get the active widget. {Property}.

virtual tU32 GetNumWidgets ( ) const
pure virtual

Get the number of widgets created. {Property}.

Remarks
This function is meant for debugging purpose.
virtual iWidget* GetWidget ( tU32  anIndex) const
pure virtual

Get the widget at the specified index. {Property}.

Remarks
This function is meant for debugging purpose.
virtual tBool SerializeWidget ( iWidget apWidget,
iDataTable apDT,
tWidgetSerializeFlags  anFlags,
iRegex apFilter 
)
pure virtual

Serialize the specified widget.

Parameters
apWidgetis the widget to serialize.
apDTis the source/destination data table.
anFlagsis the serialization flags.
apFilterregular expression that determines which class will be serialized. Is NULL all classes will be serialized.
Returns
eFalse if failed, else eTrue.
virtual iWidgetCommand* CreateWidgetCommand ( )
pure virtual

Create a widget command instance.

virtual tBool SendCommand ( iWidget apDest,
iWidgetCommand apCmd 
)
pure virtual

Send a command to the specified widget.

virtual void Draw ( )
pure virtual

Draw the GUI.

virtual void DrawCursor ( iOSWindow apWindow)
pure virtual

Draw the current mouse cursor or set it as hardware cursor on the specified window if it is specified and supported by the graphics context.

virtual tBool Update ( tF32  fTime)
pure virtual

Updates the GUI.

Returns
eTrue if succeeded, eFalse if failed.
Remarks
Update will fail if called from inside a widget's message handler.
virtual tBool Resize ( const sRectf aRootRect)
pure virtual

Resize the UI context.

Returns
eTrue if succeeded, eFalse if failed.
virtual void SetDebugDraw ( tBool  abDebug)
pure virtual

Set whether debug draw is enabled. {Property}.

virtual tBool GetDebugDraw ( ) const
pure virtual

Get whether debug draw is enabled. {Property}.

virtual tBool SetCursor ( iOverlay pCursor)
pure virtual

Set the current mouse cursor. {Property}.

virtual iOverlay* GetCursor ( ) const
pure virtual

Get the current mouse cursor. {Property}.

virtual sVec2f GetCursorPosition ( ) const
pure virtual

Get the cursor position. {Property}.

virtual void InitializeDefaultToolbar ( )
pure virtual

Initialize the a toolbar in the root widget.

virtual ni::tBool SetToolbar ( iWidget apToolbar)
pure virtual

Set the UI default toolbar. {Property}.

virtual ni::iWidget* GetToolbar ( ) const
pure virtual

Get the UI default toolbar. {Property}.

virtual void SetDrawOpCapture ( tBool  abEnabled)
pure virtual

Set whether the draw operation capture hud is enabled. {Property}.

virtual ni::tBool GetDrawOpCapture ( ) const
pure virtual

Get whether the draw operation capture hud is enabled. {Property}.

virtual tBool DrawWidget ( iWidget apWidget,
iCanvas apCanvas 
)
pure virtual

Draw the specified widget in the specified canvas.

virtual tBool DrawTransformedWidget ( iWidget apWidget,
iCanvas apCanvas,
const sMatrixf aBaseMatrix 
)
pure virtual

Draw the specified widget in the specified canvas. The widget is transformed using the specified matrix. Clipping and scissoring is disabled.

virtual void SetDragStartDistance ( tU32  anPixelDistance)
pure virtual

Set the drag start distance.

Remarks
This define the minimum number of pixels the cursor has to move before a drag start message is sent. {Property}
virtual tU32 GetDragStartDistance ( ) const
pure virtual

Get the drag start distance. {Property}.

virtual void SetDragFingerStartDistance ( tU32  anFinger,
tU32  anPixelDistance 
)
pure virtual

Set the drag finger start distance.

Remarks
This define the minimum number of pixels a finger has to move before a drag start message is sent. {Property}
virtual tU32 GetDragFingerStartDistance ( tU32  anFinger) const
pure virtual

Get the drag finger start distance. {Property}.

virtual sVec3f GetFingerPosition ( tU32  anFinger) const
pure virtual

Get a finger's latest screen position and pressure. {Property}.

virtual tBool GetFingerDown ( tU32  anFinger) const
pure virtual

Get a finger's latest down state. {Property}.

virtual void ClearShortcuts ( )
pure virtual

Remove all shortcuts.

virtual void AddShortcut ( tU32  anKey,
iHString ahspCmd 
)
pure virtual

Add a shortcut.

virtual void RemoveShortcut ( tU32  anKey)
pure virtual

Remove a shortcut.

virtual iHString* GetShortcutCommand ( tU32  anKey) const
pure virtual

Get the command of the specified shortcut. {Property}.

virtual tBool GetKeyDown ( tU8  aKey) const
pure virtual

Get a keyboard key's down state. {Property}.

virtual void InputFingerMove ( tU32  anFinger,
const sVec3f avPosition 
)
pure virtual
virtual void InputFingerRelativeMove ( tU32  anFinger,
const sVec3f avRelMove 
)
pure virtual
virtual void InputFingerPress ( tU32  anFinger,
const sVec3f avPosition,
tBool  abDown 
)
pure virtual
virtual void InputKeyPress ( eKey  aKey,
tBool  abDown 
)
pure virtual
virtual void InputKeyChar ( tU32  aCharCodePoint,
eKey  aKeyLeadingToKeyChar 
)
pure virtual
virtual void InputMouseWheel ( const tF32  afDelta)
pure virtual
virtual void InputDoubleClick ( ePointerButton  aPointer)
pure virtual
virtual void InputRelativeMouseMove ( const sVec2f avRelMove)
pure virtual
virtual void InputGameCtrl ( iGameCtrl apGameController)
pure virtual
virtual void InputPinch ( const tF32  afScale)
pure virtual
virtual iProfDraw* CreateProfDraw ( iCanvas apCanvas,
iFont apFont 
) const
pure virtual

Create an iProfDraw instance which uses the specifed canvas and font.