Coherent UI  2.5.3
A modern user interface library for games
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Coherent::UI::ViewContext Class Referenceabstract

Encapsulates basic View Context functionality. More...

#include <Coherent/UI/ViewContext.h>

Public Member Functions

virtual bool Uninitialize ()=0
 Frees all resources used by the event system. More...
 
virtual void Update ()=0
 Communicates with the UI context process and performs all updates. More...
 
virtual void FetchSurfaces ()=0
 Check if new surfaces have been drawn and are available. More...
 
virtual void CreateView (const ViewInfo &info, const wchar_t *path, ViewListenerBase *listener)=0
 Creates a new UI View. More...
 
virtual void CreateView (const ViewInfo &info, const wchar_t *path, ViewListenerBase *listener, const wchar_t *scriptToExecute)=0
 Creates a new UI View. More...
 
virtual void SaveCookies ()=0
 Saves the cookies to disk. More...
 
virtual void AddCrossOriginWhitelistEntry (const wchar_t *sourceOrigin, const wchar_t *targetProtocol, const wchar_t *targetDomain, bool allowTargetSubdomains)=0
 Add an entry to the cross-origin access whitelist. More...
 
virtual void RemoveCrossOriginWhitelistEntry (const wchar_t *sourceOrigin, const wchar_t *targetProtocol, const wchar_t *targetDomain, bool allowTargetSubdomains)=0
 Remove an entry from the cross-origin access whitelist. More...
 
virtual void ClearCrossOriginWhitelist ()=0
 Remove all entries from the cross-origin access whitelist. More...
 

Detailed Description

Encapsulates basic View Context functionality.

Member Function Documentation

virtual void Coherent::UI::ViewContext::AddCrossOriginWhitelistEntry ( const wchar_t *  sourceOrigin,
const wchar_t *  targetProtocol,
const wchar_t *  targetDomain,
bool  allowTargetSubdomains 
)
pure virtual

Add an entry to the cross-origin access whitelist.

Warning
Must be called after the context has signaled that it is ready via Coherent::UI::ContextListener::ContextReady
virtual void Coherent::UI::ViewContext::ClearCrossOriginWhitelist ( )
pure virtual

Remove all entries from the cross-origin access whitelist.

Warning
Must be called after the context has signaled that it is ready via Coherent::UI::ContextListener::ContextReady
virtual void Coherent::UI::ViewContext::CreateView ( const ViewInfo info,
const wchar_t *  path,
ViewListenerBase listener 
)
pure virtual

Creates a new UI View.

Warning
Must be called after the context has signaled that it is ready via Coherent::UI::ContextListener::ContextReady
Parameters
infoan instance of the ViewInfo struct that describes all the parameters of the view
paththe page to load when the view is created
listeneran instance of the ViewListenerBase interface to allow listening to all the events raised for this view
Note
In the Coherent In-Game Browser product, only 2 simultaneous Views are allowed
virtual void Coherent::UI::ViewContext::CreateView ( const ViewInfo info,
const wchar_t *  path,
ViewListenerBase listener,
const wchar_t *  scriptToExecute 
)
pure virtual

Creates a new UI View.

Warning
Must be called after the context has signaled that it is ready via Coherent::UI::ContextListener::ContextReady
Parameters
infoan instance of the ViewInfo struct that describes all the parameters of the view
paththe page to load when the view is created
listeneran instance of the ViewListenerBase interface to allow listening to all the events raised for this view
scriptToExecuteJavaScript code that will be executed on every new page at start
virtual void Coherent::UI::ViewContext::FetchSurfaces ( )
pure virtual

Check if new surfaces have been drawn and are available.

Warning
This function can be called from a thread different than the main UI context thread in order to support client applications with multi-threaded rendering.
Fetches only the surfaces of buffered views; on-demand views must be fetched manually per-view
virtual void Coherent::UI::ViewContext::RemoveCrossOriginWhitelistEntry ( const wchar_t *  sourceOrigin,
const wchar_t *  targetProtocol,
const wchar_t *  targetDomain,
bool  allowTargetSubdomains 
)
pure virtual

Remove an entry from the cross-origin access whitelist.

Warning
Must be called after the context has signaled that it is ready via Coherent::UI::ContextListener::ContextReady
virtual void Coherent::UI::ViewContext::SaveCookies ( )
pure virtual

Saves the cookies to disk.

Warning
Must be called after the context has signaled that it is ready via Coherent::UI::ContextListener::ContextReady
virtual bool Coherent::UI::ViewContext::Uninitialize ( )
pure virtual

Frees all resources used by the event system.

Warning
the ViewContext object is unusable after this call
Returns
true if the context has been properly uninitialized
virtual void Coherent::UI::ViewContext::Update ( )
pure virtual

Communicates with the UI context process and performs all updates.

Warning
Must be called in the thread that owns the context. All registered callbacks will be called in here