PowerUI.FileProtocol Class Reference

Detailed Description

Represents a custom protocol:// as used by PowerUI files. For example, if you wish to deliver content in a custom way to PowerUI, implement a new FileProtocol (e.g. 'cdn') Then, setup its OnGetGraphic function.

Inheritance diagram for PowerUI.FileProtocol:
PowerUI.BundleProtocol PowerUI.CacheProtocol PowerUI.CameraProtocol PowerUI.DataProtocol PowerUI.HttpProtocol PowerUI.JavascriptProtocol PowerUI.ResourcesProtocol PowerUI.SceneProtocol PowerUI.WindowProtocol

Public Member Functions

virtual CachedContent GetCached (Dom.Location location)
 Attempts to get cached data for the given location. Used to enable caching (off by default). More...
 
virtual DomainData GetDomain (Dom.Location location)
 Gets the domain data for the given location. More...
 
virtual string GetRelative (Dom.Location location)
 Gets the relative path for the given location. More...
 
CachedContent GetCached (Dom.Location location, bool create)
 Attempts to get cached data for the given location. More...
 
virtual string[] GetNames ()
 Returns all protocol names:// that can be used for this protocol. e.g. new string[]{"cdn","net"}; => cdn://file.png or net://file.png More...
 
virtual string ContentType (Location path)
 Used to determine the content type for the file from the given path. More...
 
virtual bool FullAccess (Location path)
 Does the item at the given location have full access to the code security domain? Used by Nitro. If it does not have full access, the Nitro security domain is asked about the path instead. If you're unsure, leave this false! If your game uses simple web browsing, this essentially stops somebody writing dangerous Nitro on a remote webpage and directing your game at it. More...
 
void OnGetData (ContentPackage package)
 Gets binary data, checking the cache first. More...
 
virtual void OnGetDataNow (ContentPackage package)
 Get generic binary at the given path using this protocol. Used for e.g. fonts. Once it's been retrieved, this must call package.GotData(theText) internally. Note that you can call this directly to avoid all cache checking. More...
 
virtual void OnGetGraphic (ImagePackage package)
 Get the file at the given path as a MovieTexture (Unity Pro only!), Texture2D, SPA Animation or DynamicTexture using this protocol. Once it's been retrieved, this must call package.GotGraphic(theObject) internally. More...
 
virtual void OnGetAudio (AudioPackage package)
 Get the file at the given path as any supported audio format. Once it's been retrieved, this must call package.GotAudio(theObject) internally. More...
 
virtual void OnFollowLink (HtmlElement linkElement, Location path)
 The user clicked on the given link which points to the given path. More...
 

Static Public Attributes

static InternalEventHandler OnRequestStarted
 An event called when any request is started. Useful for debugging networking (and is used by the network inspector). More...
 

Member Function Documentation

virtual string PowerUI.FileProtocol.ContentType ( Location  path)
inlinevirtual

Used to determine the content type for the file from the given path.

virtual bool PowerUI.FileProtocol.FullAccess ( Location  path)
inlinevirtual

Does the item at the given location have full access to the code security domain? Used by Nitro. If it does not have full access, the Nitro security domain is asked about the path instead. If you're unsure, leave this false! If your game uses simple web browsing, this essentially stops somebody writing dangerous Nitro on a remote webpage and directing your game at it.

Reimplemented in PowerUI.ResourcesProtocol.

virtual CachedContent PowerUI.FileProtocol.GetCached ( Dom.Location  location)
inlinevirtual

Attempts to get cached data for the given location. Used to enable caching (off by default).

Reimplemented in PowerUI.HttpProtocol.

CachedContent PowerUI.FileProtocol.GetCached ( Dom.Location  location,
bool  create 
)
inline

Attempts to get cached data for the given location.

virtual DomainData PowerUI.FileProtocol.GetDomain ( Dom.Location  location)
inlinevirtual

Gets the domain data for the given location.

virtual string [] PowerUI.FileProtocol.GetNames ( )
inlinevirtual

Returns all protocol names:// that can be used for this protocol. e.g. new string[]{"cdn","net"}; => cdn://file.png or net://file.png

Reimplemented in PowerUI.CameraProtocol, PowerUI.HttpProtocol, PowerUI.SceneProtocol, PowerUI.ResourcesProtocol, PowerUI.WindowProtocol, PowerUI.ResizeProtocol, PowerUI.BundleProtocol, PowerUI.CacheProtocol, PowerUI.DataProtocol, and PowerUI.JavascriptProtocol.

virtual string PowerUI.FileProtocol.GetRelative ( Dom.Location  location)
inlinevirtual

Gets the relative path for the given location.

virtual void PowerUI.FileProtocol.OnFollowLink ( HtmlElement  linkElement,
Location  path 
)
inlinevirtual

The user clicked on the given link which points to the given path.

Reimplemented in PowerUI.ResourcesProtocol, PowerUI.HttpProtocol, PowerUI.SceneProtocol, and PowerUI.WindowProtocol.

virtual void PowerUI.FileProtocol.OnGetAudio ( AudioPackage  package)
inlinevirtual

Get the file at the given path as any supported audio format. Once it's been retrieved, this must call package.GotAudio(theObject) internally.

Reimplemented in PowerUI.BundleProtocol, and PowerUI.ResourcesProtocol.

void PowerUI.FileProtocol.OnGetData ( ContentPackage  package)
inline

Gets binary data, checking the cache first.

virtual void PowerUI.FileProtocol.OnGetDataNow ( ContentPackage  package)
inlinevirtual

Get generic binary at the given path using this protocol. Used for e.g. fonts. Once it's been retrieved, this must call package.GotData(theText) internally. Note that you can call this directly to avoid all cache checking.

Reimplemented in PowerUI.ResourcesProtocol, PowerUI.HttpProtocol, PowerUI.DataProtocol, and PowerUI.JavascriptProtocol.

virtual void PowerUI.FileProtocol.OnGetGraphic ( ImagePackage  package)
inlinevirtual

Get the file at the given path as a MovieTexture (Unity Pro only!), Texture2D, SPA Animation or DynamicTexture using this protocol. Once it's been retrieved, this must call package.GotGraphic(theObject) internally.

Reimplemented in PowerUI.BundleProtocol, PowerUI.ResourcesProtocol, PowerUI.CameraProtocol, PowerUI.ResizeProtocol, and PowerUI.CacheProtocol.

Member Data Documentation

InternalEventHandler PowerUI.FileProtocol.OnRequestStarted
static

An event called when any request is started. Useful for debugging networking (and is used by the network inspector).