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

  • CSVGTAppObserverUtil
Public Member Functions
~CSVGTAppObserverUtil()
IMPORT_C voidAssignEmbededDataL(const TDesC &)
IMPORT_C TBoolCanShowDownload()
IMPORT_C TBoolCanShowSave()
IMPORT_C voidDialogDismissedL(TInt)
IMPORT_C voidDisplayDownloadMenuL()
IMPORT_C voidDoSaveL(TInt)
TBool ExitWhenOrientationChange()
TInt FetchFont(const TDesC &, RFs &, RFile &)
IMPORT_C TIntFetchImage(const TDesC &, RFs &, RFile &)
IMPORT_C TBoolGetFileNameFromUri(const TDesC &, TDes &)
IMPORT_C TBoolGetLocalFile(const TDesC &, TDes &, const TDesC &)
IMPORT_C voidGetSmilFitValue(TDes &)
voidGetUniqueFileName(TDes &)
IMPORT_C voidHandleDMgrEventL(RHttpDownload &, THttpDownloadEvent)
IMPORT_C TDownloadNeededIsDownloadNeededL(const TDesC &)
TBool IsGzipContent(const RFile &)
IMPORT_C TBoolIsSavingDone()
IMPORT_C TBoolLinkActivated(const TDesC &)
IMPORT_C voidLinkActivatedL(const TDesC &)
IMPORT_C TBoolLinkActivatedWithShow(const TDesC &, const TDesC &)
IMPORT_C voidLinkActivatedWithShowL(const TDesC &, const TDesC &)
IMPORT_C TIntNewFetchImageData(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 voidSVGTPositionChanged(TInt)
IMPORT_C voidSVGTSavingDoneL(TInt)
voidSaveContentL(RFile &, const TDesC &, TDes &, TBool)
voidSaveSvgTextContentL(const RFile &, TDes &)
IMPORT_C voidSetDownloadMenu(TBool)
Protected Member Functions
CSVGTAppObserverUtil(CSVGTUIDialog *)
IMPORT_C voidConstructL()
IMPORT_C voidConstructL(RFile *, const TDesC &, TBool, TBool, TBool)
IMPORT_C voidConstructL(RFile *)
CSVGTViewerAppDownloads *FindDownload(const RHttpDownload *)
IMPORT_C TBoolGetDefaultInetAccessPointL(TUint32 &)
IMPORT_C voidGetFileNameAndExt(TDes &)
IMPORT_C TBoolIsAllowMove()
IMPORT_C TBoolIsFileFullPathAvailable()
IMPORT_C voidLaunchDownloadedFileL(const TDesC &, TBool, TBool)
voidLaunchWaitNoteL(TInt, TBool, const TDesC &)
TInt StartDownloadingImageL(const TDesC &, RFs &, RFile &, TBool, TBool, TBool)
Private Member Functions
voidDoAssignImageDataL(const CSVGTViewerAppDownloads *, RHttpDownload &)
voidDoAssignLocalFileDataL(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
enumTDownloadNeeded { ELocalImageFile, ERemoteImageFile, ENotAnImageFile }
enumTWaitNoteState { 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
RHttpDownloadMgriDownloadMgr
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_CCSVGTAppObserverUtil(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 voidAssignEmbededDataL(const TDesC &aUri)

Parameters

const TDesC & aUri

CanShowDownload()

IMPORT_C TBoolCanShowDownload()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 TBoolCanShowSave()[virtual]

ConstructL()

IMPORT_C voidConstructL()[protected]

Default Symbian 2nd phase constructor.

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

IMPORT_C voidConstructL(RFile *aFileHdlPtr,
const TDesC &aFilename,
TBoolaIsFileFullPathAvailable,
TBoolaCanSaveContent,
TBoolaShouldMoveContent
)[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 voidConstructL(RFile *aFileHdlPtr)[protected]

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

Parameters

RFile * aFileHdlPtr

DialogDismissedL(TInt)

IMPORT_C voidDialogDismissedL(TIntaButtonId)

Parameters

TInt aButtonId

DisplayDownloadMenuL()

IMPORT_C voidDisplayDownloadMenuL()[virtual]

DoAssignImageDataL(const CSVGTViewerAppDownloads *, RHttpDownload &)

voidDoAssignImageDataL(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 &)

voidDoAssignLocalFileDataL(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 voidDoSaveL(TIntaCommandId)[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 TIntFetchImage(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 TBoolGetDefaultInetAccessPointL(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 voidGetFileNameAndExt(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 TBoolGetFileNameFromUri(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 TBoolGetLocalFile(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 voidGetSmilFitValue(TDes &aSmilValue)[virtual]

Parameters

TDes & aSmilValue

GetUniqueFileName(TDes &)

voidGetUniqueFileName(TDes &aName)const

This function generates a unique file name in the private directory

Parameters

TDes & aNameOn return contains the full path on return.

HandleDMgrEventL(RHttpDownload &, THttpDownloadEvent)

IMPORT_C voidHandleDMgrEventL(RHttpDownload &aDownload,
THttpDownloadEventaEvent
)
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 TBoolIsAllowMove()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 TDownloadNeededIsDownloadNeededL(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 TBoolIsFileFullPathAvailable()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 & aFileHandleFile handle to the SVG content

IsSavingDone()

IMPORT_C TBoolIsSavingDone()[virtual]

LaunchDownloadedFileL(const TDesC &, TBool, TBool)

IMPORT_C voidLaunchDownloadedFileL(const TDesC &aFileName,
TBoolaIsEmbedded,
TBoolaAllowSave
)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 &)

voidLaunchWaitNoteL(TIntaResourceId,
TBoolaVisibilityDelayOff,
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 TBoolLinkActivated(const TDesC &aUri)[virtual]

Parameters

const TDesC & aUri

LinkActivatedL(const TDesC &)

IMPORT_C voidLinkActivatedL(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 TBoolLinkActivatedWithShow(const TDesC &aUri,
const TDesC &aShow
)[virtual]

Parameters

const TDesC & aUri
const TDesC & aShow

LinkActivatedWithShowL(const TDesC &, const TDesC &)

IMPORT_C voidLinkActivatedWithShowL(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 TIntNewFetchImageData(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,
TBoolaIsFileFullPathAvailable,
TBoolaCanSaveContent,
TBoolaShouldMoveContent
)[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,
TBoolaIsFileFullPathAvailable,
TBoolaCanSaveContent,
TBoolaShouldMoveContent
)[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 voidSVGTPositionChanged(TIntaPosition)[virtual]
From MSVGTUISaveListener. This function is called when buffering or saving position is changed.
Since
3.0

Parameters

TInt aPosition

SVGTSavingDoneL(TInt)

IMPORT_C voidSVGTSavingDoneL(TIntaError)[virtual]
From MSVGTUISaveListener. Called when saving is finished.
Since
3.0

Parameters

TInt aError

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

voidSaveContentL(RFile &aSrcFileHandle,
const TDesC &aSrcFileName,
TDes &aDstFileName,
TBoolaMoveFlag
)

Helper function for DoSaveL

Parameters

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

SaveSvgTextContentL(const RFile &, TDes &)

voidSaveSvgTextContentL(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 voidSetDownloadMenu(TBoolaAddDownloadMenu)
This function is called by the application to enable/disable the downloads menu in the options menu
Since
3.0

Parameters

TBool aAddDownloadMenuenable/disable the downloads menu

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

TInt StartDownloadingImageL(const TDesC &aUri,
RFs &aSession,
RFile &aFileHandle,
TBoolaIsSynchronous,
TBoolaLinkFlag,
TBoolaIsEmbedded = 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

RHttpDownloadMgriDownloadMgr[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]