UIQ Technology
 Developer Library

UIQ 3 SDK

UIQ developer portal

FEEDBACK 

[Index] [Spacer] [Previous] [Next]



Location: QikDocument.h
Link against: qikcore.lib

Class CQikDocument

class CQikDocument : public CEikDocument;

Description

This class provides an extra document layer over the CEikDocument class. This layer is closing down applications when EReleaseRam is received.

Derivation

Members

Defined in CQikDocument:
CQikDocument(), CreateFileStoreLC(), EditL(), ExternalizeL(), HasChanged(), NewDocumentL(), OpenFileL(), PrintL(), RestoreL(), SaveL(), SaveL(), StoreL(), UpdateTaskNameL(), ValidatePasswordL(), ~CQikDocument()

Inherited from CApaDocument:
Application(), Capability(), DetachFromStoreL(), GlassPictureL(), Process(), TCapability, iContainer

Inherited from CBase:
Delete(), Extension_(), operator new()

Inherited from CEikDocument:
AppCaption(), AppFileMode(), CreateAppUiL(), EditStore(), IsEmpty(), PrepareToEditL(), SetAppFileMode(), SetChanged(), SetEditStoreL(), iAppUi, iEditStore


Construction and destruction


CQikDocument()

IMPORT_C CQikDocument(CEikApplication &aApp);

Description

Default constructor. Allocates a new CEikDocument and initialises its references to the associated application and managing process.

Parameters

CEikApplication &aApp

The application instance with which the new document is associated. In UIQ, this should always be a CQikApplication object.


~CQikDocument()

IMPORT_C ~CQikDocument();

Description

Destructor.

[Top]


Member functions


SaveL()

virtual IMPORT_C void SaveL(MSaveObserver::TSaveType aSaveType);

Description

Saves the document to its current direct file store, marking it as not having changed and saves application data depending on the save type.

This method is called when the system requires the application to save its data. The aSaveType parameter specifies the reason why this is so. The default implementation always calls the parameterless SaveL() overload.

If aSaveType is a request to release memory (MSaveObserver::EReleaseRAM ), the default implementation sends a quit request (EEikCmdExit ) to the AppUi's HandleCommandL() . An application that does not want to quit when there is a memory shortage (e.g. because there is a file download in progress), must therefore override this function. Note that the system will not send a EReleaseRAM event if the application is in the foreground. Note that the event will be sent to a system application and it is up to the system app to decide if it can release memory or not.

If aSaveType indicates that disk space is low MSaveObserver::EReleaseDisk , the function should be overriden to perform any possible application space saving, for example, deleting cached files, or compressing saved data. Please note that if using standard databases it is not recommended to compress saved data when disk space is low as the database will in actuality increase in size, if just for a short moment!

Parameters

MSaveObserver::TSaveType aSaveType

The save type.

See also:


UpdateTaskNameL()

virtual IMPORT_C void UpdateTaskNameL(CApaWindowGroupName *aWgName);

Description

Updates the task name.

Parameters

CApaWindowGroupName *aWgName

New task name.

See also:


NewDocumentL()

virtual IMPORT_C void NewDocumentL();

Description

Initialises a new default document.

This function calls CEikDocument::NewDocumentL() only.

See also:


CreateFileStoreLC()

virtual IMPORT_C CFileStore *CreateFileStoreLC(RFs &aFs, const TDesC &aFileName);

Description

Creates a new file store for a file, creating a new file or overwriting an existing one as necessary. A StoreL() is performed immediately.

Parameters

RFs &aFs

File server session to use.

const TDesC &aFileName

Full path to the file.

Return value

CFileStore *

The newly created file store.

See also:


EditL()

virtual IMPORT_C void EditL(MApaEmbeddedDocObserver *aObserver, TBool aReadOnly=EFalse);

Description

Starts an editing session on an embedded document. This causes the application’s UI to be created, and the document is fully restored for editing or viewing.

Parameters

MApaEmbeddedDocObserver *aObserver

Pointer to an observer that should be informed when editing has been completed.

TBool aReadOnly

If ETrue , the document is opened as read only, and changes made to its content do not persist. EFalse by default.


PrintL()

virtual IMPORT_C void PrintL(const CStreamStore &aSourceStore);

Description

Prints a document without opening it for editing. This function is usually called from a shell or file manager application that wants to print the document without opening it fully.

This function is empty. Applications that want to support printing should override this with a function that uses default print parameters.

Parameters

const CStreamStore &aSourceStore

Observer for the editing session.


SaveL()

virtual IMPORT_C void SaveL();

Description

Saves the document to its current direct file store, marking it as not having changed. Should be overridden by applications to store application data.


StoreL()

virtual IMPORT_C void StoreL(CStreamStore &aStore, CStreamDictionary &aStreamDic) const;

Description

Stores the document’s content and state, recording the identity of any headstreams created.

This function calls the Uikon function CEikDocument::StoreL() , the implementation of which is empty. Applications that wish to persist any data must provide their own version.

Parameters

CStreamStore &aStore

Stream store to which data is saved.

CStreamDictionary &aStreamDic

Stream dictionary in which to record headstreams.


RestoreL()

virtual IMPORT_C void RestoreL(const CStreamStore &aStore, const CStreamDictionary &aStreamDic);

Description

Restores this document from a stream store, setting the document’s state and content. Any existing data in the document is lost.

The Uikon implementation of this function is empty. Applications that wish to load any persisted data must provide their own version.

If this function leaves, the document should be rolled back to the state in which it was before the function was called.

Parameters

const CStreamStore &aStore

Stream store from which to read the new state and content.

const CStreamDictionary &aStreamDic

Stream dictionary in which to look up head streams.


ExternalizeL()

virtual IMPORT_C void ExternalizeL(RWriteStream &aStream) const;

Description

Externalises the document to the specified write stream.

Calls the Uikon function CEikDocument::ExternalizeL() , the implementation of which is blank.

Parameters

RWriteStream &aStream

The write stream to which information is written.

See also:


HasChanged()

virtual IMPORT_C TBool HasChanged() const;

Description

Gets this document’s document-changed flag.

Return value

TBool

ETrue if the document-changed flag is ETrue , otherwise EFalse .

See also:


OpenFileL()

virtual IMPORT_C CFileStore *OpenFileL(TBool aDoOpen, const TDesC &aFilename, RFs &aFs);

Description

This function is called by the UI framework during application start-up.

If OpenFileL in EikDocument leave with KErrCorrupt or KErrNotSupported then it deletes the corrupted file and tells the user about it.

Parameters

TBool aDoOpen

True to open an existing file, false to create a new default file.

const TDesC &aFilename

The path and name of the file to open or create.

RFs &aFs

File server session to use.

Return value

CFileStore *

The file that stores the main document.


ValidatePasswordL()

virtual IMPORT_C void ValidatePasswordL() const;

Description

Checks the document password.

The default implementation is empty.

See also:

Terms and conditions of use of the material