CSVGTAppObserverUtil Class Reference

class CSVGTAppObserverUtil : public CBase
This class is used as a utility class for implementing observer for the SVGT UI Control. It provides helper function/reference implementation for following functionality: a. Hyperlink handling b. Download manager + UI Usage c. Save Option Implementation d. Misc (GetSmilFitValue) SVGTAppObserverUtil
Since
3.0

Inherits from

Public Member Functions
~CSVGTAppObserverUtil ()
IMPORT_C void AssignEmbededDataL (const TDesC &)
IMPORT_C TBool CanShowDownload ()
IMPORT_C TBool CanShowSave ()
IMPORT_C void DialogDismissedL ( TInt )
IMPORT_C void DisplayDownloadMenuL ()
IMPORT_C void DoSaveL ( TInt )
TBool ExitWhenOrientationChange ()
TInt FetchFont (const TDesC &, RFs &, RFile &)
IMPORT_C TInt FetchImage (const TDesC &, RFs &, RFile &)
IMPORT_C TBool GetFileNameFromUri (const TDesC &, TDes &)
IMPORT_C TBool GetLocalFile (const TDesC &, TDes &, const TDesC &)
IMPORT_C void GetSmilFitValue ( TDes &)
void GetUniqueFileName ( TDes &)
IMPORT_C void HandleDMgrEventL (RHttpDownload &, THttpDownloadEvent)
IMPORT_C TDownloadNeeded IsDownloadNeededL (const TDesC &)
TBool IsGzipContent (const RFile &)
IMPORT_C TBool IsSavingDone ()
IMPORT_C TBool LinkActivated (const TDesC &)
IMPORT_C void LinkActivatedL (const TDesC &)
IMPORT_C TBool LinkActivatedWithShow (const TDesC &, const TDesC &)
IMPORT_C void LinkActivatedWithShowL (const TDesC &, const TDesC &)
IMPORT_C TInt NewFetchImageData (const TDesC &)
IMPORT_C CSVGTAppObserverUtil * NewL ( CSVGTUIDialog *, RFile *, const TDesC &, TBool , TBool , TBool )
IMPORT_C CSVGTAppObserverUtil * NewL ( CSVGTUIDialog *, RFile *)
CSVGTAppObserverUtil * NewLC ( CSVGTUIDialog *, RFile *, const TDesC &, TBool , TBool , TBool )
CSVGTAppObserverUtil * NewLC ( CSVGTUIDialog *, RFile *)
IMPORT_C void SVGTPositionChanged ( TInt )
IMPORT_C void SVGTSavingDoneL ( TInt )
void SaveContentL ( RFile &, const TDesC &, TDes &, TBool )
void SaveSvgTextContentL (const RFile &, TDes &)
IMPORT_C void SetDownloadMenu ( TBool )
Protected Member Functions
CSVGTAppObserverUtil ( CSVGTUIDialog *)
IMPORT_C void ConstructL ()
IMPORT_C void ConstructL ( RFile *, const TDesC &, TBool , TBool , TBool )
IMPORT_C void ConstructL ( RFile *)
CSVGTViewerAppDownloads * FindDownload (const RHttpDownload *)
IMPORT_C TBool GetDefaultInetAccessPointL ( TUint32 &)
IMPORT_C void GetFileNameAndExt ( TDes &)
IMPORT_C TBool IsAllowMove ()
IMPORT_C TBool IsFileFullPathAvailable ()
IMPORT_C void LaunchDownloadedFileL (const TDesC &, TBool , TBool )
void LaunchWaitNoteL ( TInt , TBool , const TDesC &)
TInt StartDownloadingImageL (const TDesC &, RFs &, RFile &, TBool , TBool , TBool )
Private Member Functions
void DoAssignImageDataL (const CSVGTViewerAppDownloads *, RHttpDownload &)
void DoAssignLocalFileDataL (const TDesC &, const TDesC &)
HBufC8 * DoGetProcessedEmbededDataL (const TDesC &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Public Member Enumerations
enum TDownloadNeeded { ELocalImageFile , ERemoteImageFile , ENotAnImageFile }
enum TWaitNoteState { ESaveFileWait  = 1, EDownloadImageWait }
Private Attributes
CSVGTUIDialog * iAppDialog
TBool iCanSaveContent
TInt iCommandId
CDownloadMgrUiDownloadsList * iDMgrDownloadsList
CDownloadMgrUiLibRegistry * iDMgrUiReg
CDownloadMgrUiUserInteractions * iDMgrUserInteractions
TBool iDeleteOrigFile
CDocumentHandler * iDocHandler
TBool iDownloadDone
TBool iDownloadInProgress
TDblQueIter < CSVGTViewerAppDownloads > iDownloadIter
TBool iDownloadMenuEnabled
RHttpDownloadMgr iDownloadMgr
TDblQue < CSVGTViewerAppDownloads > iDownloads
CEikonEnv * iEikEnv
CSVGTFileManager * iFileManager
TBool iIsFullFilePathValid
TBool iIsOverwriteCase
CEikProgressInfo * iProgressInfo
TInt iResourceOffset
TBool iSavingDone
TBool iShouldMoveContent
HBufC * iSvgDstFileName
RFile * iSvgFileId
HBufC * iSvgFileName
TBool iSynchronousDownloadStopped
HBufC * iTempFileName
TBool iTempFileUsed
CActiveSchedulerWait iWait
CAknProgressDialog * iWaitNote
TWaitNoteState iWaitNoteState

Constructor & Destructor Documentation

CSVGTAppObserverUtil(CSVGTUIDialog *)

IMPORT_C CSVGTAppObserverUtil ( CSVGTUIDialog * aAppDialog ) [protected]

C++ default constructor. aAppDialog: Pointer to the SVGT Dialog

Parameters

CSVGTUIDialog * aAppDialog

~CSVGTAppObserverUtil()

IMPORT_C ~CSVGTAppObserverUtil ( ) [virtual]

Destructor.

Member Functions Documentation

AssignEmbededDataL(const TDesC &)

IMPORT_C void AssignEmbededDataL ( const TDesC & aUri )

Parameters

const TDesC & aUri

CanShowDownload()

IMPORT_C TBool CanShowDownload ( ) const [virtual]
This function is called by the Ui Dialog to enable/disable the downloads menu in the options menu
Since
3.0

CanShowSave()

IMPORT_C TBool CanShowSave ( ) [virtual]

ConstructL()

IMPORT_C void ConstructL ( ) [protected]

Default Symbian 2nd phase constructor.

ConstructL(RFile *, const TDesC &, TBool, TBool, TBool)

IMPORT_C void ConstructL ( RFile * aFileHdlPtr,
const TDesC & aFilename,
TBool aIsFileFullPathAvailable,
TBool aCanSaveContent,
TBool aShouldMoveContent
) [protected]

Default Symbian 2nd phase constructor. RFile* aFileHdlPtr: File handle to the content. const TDesC& filename: Filepath. TBool aIsFileFullPathAvailable: Flag to indicate if content's fullpath is available. TBool aCanSaveContent, TBool aShouldMoveContent.

Parameters

RFile * aFileHdlPtr
const TDesC & aFilename
TBool aIsFileFullPathAvailable
TBool aCanSaveContent
TBool aShouldMoveContent

ConstructL(RFile *)

IMPORT_C void ConstructL ( RFile * aFileHdlPtr ) [protected]

Default Symbian 2nd phase constructor. RFile* aFileHdlPtr: File handle to the content.

Parameters

RFile * aFileHdlPtr

DialogDismissedL(TInt)

IMPORT_C void DialogDismissedL ( TInt aButtonId )

Parameters

TInt aButtonId

DisplayDownloadMenuL()

IMPORT_C void DisplayDownloadMenuL ( ) [virtual]

DoAssignImageDataL(const CSVGTViewerAppDownloads *, RHttpDownload &)

void DoAssignImageDataL ( const CSVGTViewerAppDownloads * aDownloadItem,
RHttpDownload & aDownload
) [private]
Reads the downloaded file & assign to the svg engine.
Since
3.1

Parameters

const CSVGTViewerAppDownloads * aDownloadItem
RHttpDownload & aDownload

DoAssignLocalFileDataL(const TDesC &, const TDesC &)

void DoAssignLocalFileDataL ( const TDesC & aOriginalUri,
const TDesC & aNewUri
) const [private]

Parameters

const TDesC & aOriginalUri
const TDesC & aNewUri

DoGetProcessedEmbededDataL(const TDesC &)

HBufC8 * DoGetProcessedEmbededDataL ( const TDesC & aXlinkHrefValue ) const [private]

Parameters

const TDesC & aXlinkHrefValue

DoSaveL(TInt)

IMPORT_C void DoSaveL ( TInt aCommandId ) [virtual]

Parameters

TInt aCommandId

ExitWhenOrientationChange()

TBool ExitWhenOrientationChange ( )

FetchFont(const TDesC &, RFs &, RFile &)

TInt FetchFont ( const TDesC & ,
RFs & ,
RFile &
)

Parameters

const TDesC &
RFs &
RFile &

FetchImage(const TDesC &, RFs &, RFile &)

IMPORT_C TInt FetchImage ( const TDesC & aUri,
RFs & aSession,
RFile & aFileHandle
) [virtual]
This method is called by the svg engine when there is an image tag encountered in the svg file. This function parses the uri, checks whether the uri is a local file or a remote file. If the file is a remote file, the file is downloaded. Fetched file is then opened and the file handle returned to the engine.
Since
3.0
MSvgRequestObserver::FetchImage

Parameters

const TDesC & aUri
RFs & aSession
RFile & aFileHandle

FindDownload(const RHttpDownload *)

CSVGTViewerAppDownloads * FindDownload ( const RHttpDownload * aHttpDownload ) [protected]
This method is called by HandleDMgrEventL This iterates through the linked list and return the link corresponding to the given http download handle
Since
3.0

Parameters

const RHttpDownload * aHttpDownload

GetDefaultInetAccessPointL(TUint32 &)

IMPORT_C TBool GetDefaultInetAccessPointL ( TUint32 & aIapId ) const [protected]
This method is called by the Fetch Image before starting the download to get Access point id.
Since
3.0

Parameters

TUint32 & aIapId

GetFileNameAndExt(TDes &)

IMPORT_C void GetFileNameAndExt ( TDes & filename ) const [protected]
This method is used to get back the filename of the currently playing svg content in filname.ext format.
Since
3.0

Parameters

TDes & filename

GetFileNameFromUri(const TDesC &, TDes &)

IMPORT_C TBool GetFileNameFromUri ( const TDesC & aUri,
TDes & aFileName
) const
This method is called by LinkActivated(WithShow), FetchImage This gets the filename from the uri and the
Since
3.0

Parameters

const TDesC & aUri
TDes & aFileName

GetLocalFile(const TDesC &, TDes &, const TDesC &)

IMPORT_C TBool GetLocalFile ( const TDesC & aUri,
TDes & aFileName,
const TDesC & aSvgFileName
) [static]
This method is called by LinkActivated(WithShow), FetchImage This gets the filename with full path from the uri and the
Since
3.0

Parameters

const TDesC & aUri
TDes & aFileName
const TDesC & aSvgFileName

GetSmilFitValue(TDes &)

IMPORT_C void GetSmilFitValue ( TDes & aSmilValue ) [virtual]

Parameters

TDes & aSmilValue

GetUniqueFileName(TDes &)

void GetUniqueFileName ( TDes & aName ) const

This function generates a unique file name in the private directory

Parameters

TDes & aName On return contains the full path on return.

HandleDMgrEventL(RHttpDownload &, THttpDownloadEvent)

IMPORT_C void HandleDMgrEventL ( RHttpDownload & aDownload,
THttpDownloadEvent aEvent
)
This method is a call back function used by the download manager to indicate the completion/failure of the download started. LinkActivatedWithShow function
Since
3.0

Parameters

RHttpDownload & aDownload
THttpDownloadEvent aEvent

IsAllowMove()

IMPORT_C TBool IsAllowMove ( ) const [protected]
This method is used in Save operation to decide whether move action should be performed.
Since
3.0

IsDownloadNeededL(const TDesC &)

IMPORT_C TDownloadNeeded IsDownloadNeededL ( const TDesC & aUri ) [static]
This method is called by LinkActivated(WithShow), FetchImage This checks whether the uri passed is a local image file or a remote image file or not an image file.
Since
3.0

Parameters

const TDesC & aUri

IsFileFullPathAvailable()

IMPORT_C TBool IsFileFullPathAvailable ( ) const [protected]
This method is used check whether content file's full-path is available.
Since
3.0

IsGzipContent(const RFile &)

TBool IsGzipContent ( const RFile & aFileHandle ) const

Checks whether the file is a GZipped content

Parameters

const RFile & aFileHandle File handle to the SVG content

IsSavingDone()

IMPORT_C TBool IsSavingDone ( ) [virtual]

LaunchDownloadedFileL(const TDesC &, TBool, TBool)

IMPORT_C void LaunchDownloadedFileL ( const TDesC & aFileName,
TBool aIsEmbedded,
TBool aAllowSave
) const [protected]
This method is called by HandleDMgrEventL This makes use of Document Handler to launch the file.
Since
3.0

Parameters

const TDesC & aFileName
TBool aIsEmbedded
TBool aAllowSave

LaunchWaitNoteL(TInt, TBool, const TDesC &)

void LaunchWaitNoteL ( TInt aResourceId,
TBool aVisibilityDelayOff,
const TDesC & aFileName
) [protected]
This method is used to launch wait dialog while save operation is going on.
Since
3.0

Parameters

TInt aResourceId
TBool aVisibilityDelayOff
const TDesC & aFileName

LinkActivated(const TDesC &)

IMPORT_C TBool LinkActivated ( const TDesC & aUri ) [virtual]

Parameters

const TDesC & aUri

LinkActivatedL(const TDesC &)

IMPORT_C void LinkActivatedL ( const TDesC & aUri )
This method is called by LinkActivated. If this function leaves, it is trapped by the linkActivated function
Since
3.0

Parameters

const TDesC & aUri

LinkActivatedWithShow(const TDesC &, const TDesC &)

IMPORT_C TBool LinkActivatedWithShow ( const TDesC & aUri,
const TDesC & aShow
) [virtual]

Parameters

const TDesC & aUri
const TDesC & aShow

LinkActivatedWithShowL(const TDesC &, const TDesC &)

IMPORT_C void LinkActivatedWithShowL ( const TDesC & aUri,
const TDesC & aShow
)
This method is called by LinkActivatedWithShow. If this function leaves, it is trapped by the LinkActivatedWithShow function
Since
3.0

Parameters

const TDesC & aUri
const TDesC & aShow

NewFetchImageData(const TDesC &)

IMPORT_C TInt NewFetchImageData ( const TDesC & aUri )

Parameters

const TDesC & aUri

NewL(CSVGTUIDialog *, RFile *, const TDesC &, TBool, TBool, TBool)

IMPORT_C CSVGTAppObserverUtil * NewL ( CSVGTUIDialog * aAppDialog,
RFile * aFileHdlPtr,
const TDesC & aFilename,
TBool aIsFileFullPathAvailable,
TBool aCanSaveContent,
TBool aShouldMoveContent
) [static]

Two-phased constructor. aAppDialog: Pointer to the SVGT Dialog RFile* aFileHdlPtr: File handle to the content. const TDesC& filename: Filepath. TBool aIsFileFullPathAvailable: Flag to indicate if content's fullpath is available. TBool aCanSaveContent, TBool aShouldMoveContent.

Parameters

CSVGTUIDialog * aAppDialog
RFile * aFileHdlPtr
const TDesC & aFilename
TBool aIsFileFullPathAvailable
TBool aCanSaveContent
TBool aShouldMoveContent

NewL(CSVGTUIDialog *, RFile *)

IMPORT_C CSVGTAppObserverUtil * NewL ( CSVGTUIDialog * aAppDialog,
RFile * aFileHdlPtr
) [static]
Two-phased constructor. aAppDialog: Pointer to the SVGT Dialog RFile* aFileHdlPtr: File handle to the content.
Since
3.0

Parameters

CSVGTUIDialog * aAppDialog
RFile * aFileHdlPtr

NewLC(CSVGTUIDialog *, RFile *, const TDesC &, TBool, TBool, TBool)

CSVGTAppObserverUtil * NewLC ( CSVGTUIDialog * aAppDialog,
RFile * aFileHdlPtr,
const TDesC & aFilename,
TBool aIsFileFullPathAvailable,
TBool aCanSaveContent,
TBool aShouldMoveContent
) [static]

Two-phased constructor. aAppDialog: Pointer to the SVGT Dialog RFile* aFileHdlPtr: File handle to the content. const TDesC& aFilename: Filepath. TBool aIsFileFullPathAvailable: Flag to indicate if content's fullpath is available. TBool aCanSaveContent, TBool aShouldMoveContent.

Parameters

CSVGTUIDialog * aAppDialog
RFile * aFileHdlPtr
const TDesC & aFilename
TBool aIsFileFullPathAvailable
TBool aCanSaveContent
TBool aShouldMoveContent

NewLC(CSVGTUIDialog *, RFile *)

CSVGTAppObserverUtil * NewLC ( CSVGTUIDialog * aAppDialog,
RFile * aFileHdlPtr
) [static]
Two-phased constructor. aAppDialog: Pointer to the SVGT Dialog RFile* aFileHdlPtr: File handle to the content.
Since
3.0

Parameters

CSVGTUIDialog * aAppDialog
RFile * aFileHdlPtr

SVGTPositionChanged(TInt)

IMPORT_C void SVGTPositionChanged ( TInt aPosition ) [virtual]
From MSVGTUISaveListener. This function is called when buffering or saving position is changed.
Since
3.0

Parameters

TInt aPosition

SVGTSavingDoneL(TInt)

IMPORT_C void SVGTSavingDoneL ( TInt aError ) [virtual]
From MSVGTUISaveListener. Called when saving is finished.
Since
3.0

Parameters

TInt aError

SaveContentL(RFile &, const TDesC &, TDes &, TBool)

void SaveContentL ( RFile & aSrcFileHandle,
const TDesC & aSrcFileName,
TDes & aDstFileName,
TBool aMoveFlag
)

Helper function for DoSaveL

Parameters

RFile & aSrcFileHandle
const TDesC & aSrcFileName
TDes & aDstFileName
TBool aMoveFlag

SaveSvgTextContentL(const RFile &, TDes &)

void SaveSvgTextContentL ( const RFile & aSrcFileHandle,
TDes & aTempFileName
)

This function saves the SVG content into the private directory

Parameters

const RFile & aSrcFileHandle
TDes & aTempFileName

SetDownloadMenu(TBool)

IMPORT_C void SetDownloadMenu ( TBool aAddDownloadMenu )
This function is called by the application to enable/disable the downloads menu in the options menu
Since
3.0

Parameters

TBool aAddDownloadMenu enable/disable the downloads menu

StartDownloadingImageL(const TDesC &, RFs &, RFile &, TBool, TBool, TBool)

TInt StartDownloadingImageL ( const TDesC & aUri,
RFs & aSession,
RFile & aFileHandle,
TBool aIsSynchronous,
TBool aLinkFlag,
TBool aIsEmbedded = ETrue
) [protected]
This method is called by LinkActivated(WithShow),FetchImage functions If this function leaves, it is trapped by the Called function
Since
3.0

Parameters

const TDesC & aUri
RFs & aSession
RFile & aFileHandle
TBool aIsSynchronous
TBool aLinkFlag
TBool aIsEmbedded = ETrue

Member Enumerations Documentation

Enum TDownloadNeeded

Enumerators

ELocalImageFile
ERemoteImageFile
ENotAnImageFile

Enum TWaitNoteState

Enumerators

ESaveFileWait = 1
EDownloadImageWait

Member Data Documentation

CSVGTUIDialog * iAppDialog

CSVGTUIDialog * iAppDialog [private]

TBool iCanSaveContent

TBool iCanSaveContent [private]

TInt iCommandId

TInt iCommandId [private]

CDownloadMgrUiDownloadsList * iDMgrDownloadsList

CDownloadMgrUiDownloadsList * iDMgrDownloadsList [private]

CDownloadMgrUiLibRegistry * iDMgrUiReg

CDownloadMgrUiLibRegistry * iDMgrUiReg [private]

CDownloadMgrUiUserInteractions * iDMgrUserInteractions

CDownloadMgrUiUserInteractions * iDMgrUserInteractions [private]

TBool iDeleteOrigFile

TBool iDeleteOrigFile [private]

CDocumentHandler * iDocHandler

CDocumentHandler * iDocHandler [private]

TBool iDownloadDone

TBool iDownloadDone [private]

TBool iDownloadInProgress

TBool iDownloadInProgress [private]

TDblQueIter< CSVGTViewerAppDownloads > iDownloadIter

TDblQueIter < CSVGTViewerAppDownloads > iDownloadIter [private]

TBool iDownloadMenuEnabled

TBool iDownloadMenuEnabled [private]

RHttpDownloadMgr iDownloadMgr

RHttpDownloadMgr iDownloadMgr [private]

TDblQue< CSVGTViewerAppDownloads > iDownloads

TDblQue < CSVGTViewerAppDownloads > iDownloads [private]

CEikonEnv * iEikEnv

CEikonEnv * iEikEnv [private]

CSVGTFileManager * iFileManager

CSVGTFileManager * iFileManager [private]

TBool iIsFullFilePathValid

TBool iIsFullFilePathValid [private]

TBool iIsOverwriteCase

TBool iIsOverwriteCase [private]

CEikProgressInfo * iProgressInfo

CEikProgressInfo * iProgressInfo [private]

TInt iResourceOffset

TInt iResourceOffset [private]

TBool iSavingDone

TBool iSavingDone [private]

TBool iShouldMoveContent

TBool iShouldMoveContent [private]

HBufC * iSvgDstFileName

HBufC * iSvgDstFileName [private]

RFile * iSvgFileId

RFile * iSvgFileId [private]

HBufC * iSvgFileName

HBufC * iSvgFileName [private]

TBool iSynchronousDownloadStopped

TBool iSynchronousDownloadStopped [private]

HBufC * iTempFileName

HBufC * iTempFileName [private]

TBool iTempFileUsed

TBool iTempFileUsed [private]

CActiveSchedulerWait iWait

CActiveSchedulerWait iWait [private]

CAknProgressDialog * iWaitNote

CAknProgressDialog * iWaitNote [private]

TWaitNoteState iWaitNoteState

TWaitNoteState iWaitNoteState [private]