class MSvgRequestObserver |
This interface is the callback mechanism for the SVG Engine to communicate to interested clients and to request for external data, such as images. The callbacks will be active when the methods of this interace are implemented and the pointer to the implementation object is passed in as the second parameter of the 'ConstructL' method of the CSvgEngineInterface. A 'null' value may be passed-in if the callbacks are to be ignored.
Public Member Functions | |
---|---|
TInt | FetchFont (const TDesC &, RFs &, RFile &) |
TInt | FetchImage (const TDesC &, RFs &, RFile &) |
TBool | ScriptCall (const TDesC &, CSvgElementImpl *) |
void | UpdatePresentation (const TInt32 &) |
void | UpdateScreen () |
TInt | FetchFont | ( | const TDesC & | aUri, |
RFs & | aSession, | |||
RFile & | aFileHandle | |||
) | [pure virtual] |
This method is called to retrieve the file handle of an svg font file. This file must be SVG 1.1 .svg file. When the engine comes acrossed a font-family name that it doesnt know it will request "fontfamilyname".svg file through this method. The client can either provide the svg file or the engine will default to system text.
The usage of this method is exactly the same as the FetchImage method above
TInt | FetchImage | ( | const TDesC & | aUri, |
RFs & | aSession, | |||
RFile & | aFileHandle | |||
) | [pure virtual] |
This method is called to retrieve the file handle of an image name. The session ( RFs ) object passed in is guaranteed to be connected, so the client must NOT call aSession.Connect().
The implementation for the client of this method is usually if not always: TInt X::FetchImage( const TDesC& aFilename, RFs& aSession, RFile& aFileHandle ) { // Check for "http", get data from remote site, save to disk // Get absolute path to aFilename: absolutepath return aFileHandle.Open( aSession, absolutepath, EFileRead ); }
Note: Use EFileShareReadersOnly to prevent file locking.
The API AssignImageData() can be used to avoid block the parsing thread due this method taking too long to return. This is accomplished by returning a non-KErrNone value (i.e. KErrNotFound), and storing the URI parameter. The image data then could be assigned the the URI in another thread/Active-Object.
TBool | ScriptCall | ( | const TDesC & | aScript, |
CSvgElementImpl * | aCallerElement | |||
) | [pure virtual] |
This method is for future extension, in which an external script engine could be used to evaluate a script description.
const TDesC & aScript | |
CSvgElementImpl * aCallerElement |
void | UpdatePresentation | ( | const TInt32 & | aNoOfAnimation | ) | [pure virtual] |
const TInt32 & aNoOfAnimation |
void | UpdateScreen | ( | ) | [pure virtual] |
This method is called by the SVG Engine when all data for a certain step, such as animation frame, have been updated. This usually means the off-screen image (passed in to 'ConstructL' of CSvgEngineInterface) has been updated. The client usually redraws the image onto the screen.
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.