class CApaDocument : public CBase |
Defines basic behaviour for documents.
This is the base class for all documents. A document contains the data associated with the application's content.
The class is derived from by the UI framework and is further derived from by the UI application.
Public Member Functions | |
---|---|
~CApaDocument() | |
CApaApplication * | Application() |
IMPORT_C TCapability | Capability() |
CFileStore * | CreateFileStoreLC(RFs &, const TDesC &) |
void | DetachFromStoreL(CPicture::TDetach) |
void | EditL(MApaEmbeddedDocObserver *, TBool) |
IMPORT_C void | ExternalizeL(RWriteStream &) |
IMPORT_C CPicture * | GlassPictureL() |
TBool | HasChanged() |
TBool | IsEmpty() |
void | NewDocumentL() |
void | PrintL(const CStreamStore &) |
CApaProcess * | Process() |
void | RestoreL(const CStreamStore &, const CStreamDictionary &) |
void | SaveL() |
void | StoreL(CStreamStore &, CStreamDictionary &) |
IMPORT_C void | ValidatePasswordL() |
Protected Member Functions | |
---|---|
CApaDocument() | |
CApaDocument(CApaApplication &, CApaProcess &) |
Private Member Functions | |
---|---|
IMPORT_C void | OpenFileL(CFileStore *&, RFile &) |
IMPORT_C void | Reserved_2() |
Protected Attributes | |
---|---|
MApaEmbeddedDocObserver * | iContainer |
Private Attributes | |
---|---|
CApaProcess * | iApaProcess |
CApaApplication * | iApplication |
TInt | iSpare |
IMPORT_C | CApaDocument | ( | CApaApplication & | aApp, |
CApaProcess & | aProcess | |||
) | [protected] |
CApaApplication & aApp | |
CApaProcess & aProcess |
CApaApplication * | Application | ( | ) | const [inline] |
Returns a pointer to the application that created the document. A pointer to the document's associated application.
CFileStore * | CreateFileStoreLC | ( | RFs & | aFs, |
const TDesC & | aFileName | |||
) | [pure virtual] |
Creates and fully initialises a new filestore and stores the document into it, replacing any existing file of the same name.
The function should put the pointer to the filestore object onto the cleanup stack.
An implementation of this function is supplied by the UI framework.
A pointer to the newly constructed file store.
void | DetachFromStoreL | ( | CPicture::TDetach | = CPicture::EDetachFull | ) | [inline, virtual] |
Restores the document to the extent that it does not need the store further.
A document only keeps a pointer to a store if it implements deferred loading. This also tells the document that any store pointer that it might have is just about to become invalid.
An empty implementation of this function is supplied by the UI framework. UI applications that support deferred loading or embedding should provide an implementation.
If a document supports embedding, then it should propagate the DetachFromStoreL() call on to all embedded objects that it contains.
If the function leaves, the operation should be aborted because the document has not successfully detached from the store. Continuing with the operation may leave the document in an unsafe state or cause user data to be lost.
CPicture::TDetach = CPicture::EDetachFull |
void | EditL | ( | MApaEmbeddedDocObserver * | aContainer, |
TBool | aReadOnly = EFalse | |||
) | [pure virtual] |
Starts an editing session on an embedded document.
The function should cause the application's UI to be created and the document to be fully restored for editing.
An implementation of this function is supplied by the UI framework.
MApaEmbeddedDocObserver * aContainer | This document's observer. |
TBool aReadOnly = EFalse | True, the document should be opened in read-only mode and should not persist any changes made to the content. False, the document can be opened in read/write mode; this is the default. |
IMPORT_C void | ExternalizeL | ( | RWriteStream & | aStream | ) | const [virtual] |
RWriteStream & aStream |
TBool | HasChanged | ( | ) | const [pure virtual] |
Tests whether the document has changed since it was last persisted.
An implementation of this function is supplied by the UI framework and need not be changed by the UI application.
True, if the document has changed since the last time that it was persisted, false, otherwise.
TBool | IsEmpty | ( | ) | const [pure virtual] |
Tests whether the document is empty.
The UI framework provides a default implementation which always returns a true value.
The UI application can provide its own implementation. Typically, any application that has editable content should supply an implementation that acts according to the state of that content. Applications without associated document data need not supply an implementation.
True if the document is empty, false otherwise.
void | NewDocumentL | ( | ) | [pure virtual] |
Initialises a new, empty, document with a default setup.
This can be the main document or an embedded document. The function is called by the UI framework when it creates a default document file.
An implementation of this function must be supplied by the UI application.
If initialisation fails, the document must be left in the same state as it was before the function was called.
IMPORT_C void | OpenFileL | ( | CFileStore *& | aFileStore, |
RFile & | aFile | |||
) | [private, virtual] |
CFileStore *& aFileStore | |
RFile & aFile |
void | PrintL | ( | const CStreamStore & | aSourceStore | ) | [pure virtual] |
Prints the document without a need for it to be open for editing.
Typically, this is called from a shell or a file manager type application that wants to print the document without opening it fully.
An empty implementation of this function is supplied by the UI framework.
The UI application can provide its own implementation.
const CStreamStore & aSourceStore | A reference to the store containing the document. |
CApaProcess * | Process | ( | ) | const [inline] |
Returns a pointer to the application process associated with this document. A pointer to the application process associated with this document.
void | RestoreL | ( | const CStreamStore & | aStore, |
const CStreamDictionary & | aStreamDic | |||
) | [pure virtual] |
Restores the document's content and state from data persisted in the specified store.
An empty implementation of this function is supplied by the UI framework. UI applications that need to restore data must provide their own implementation.
If the function leaves, an implementation should ensure that the store and the stream dictionary are returned to the state they were in before the function was called.
const CStreamStore & aStore | The store from which document data is to be restored. |
const CStreamDictionary & aStreamDic | The stream dictionary containing stream IDs and associated UIDs. |
void | SaveL | ( | ) | [pure virtual] |
Stores the document to the current file, commits the changes, and marks the document status as unchanged.
Typically, the function is called by the application when it implements a "Save" type menu option in its User Interface.
An implementation of this function is supplied by the UI framework. This is adequate for direct file store applications. Applications using a permanent file store model, need to provide their own implementation.
If the function leaves, an implementation should ensure that any changes made to the file are rolled back, leaving the file in the state it was in before the function was called.
void | StoreL | ( | CStreamStore & | aStore, |
CStreamDictionary & | aStreamDic | |||
) | const [pure virtual] |
Stores the document's content and state to the specified store, recording the identity of any headstreams created in the specified stream dictionary.
The store must be fully constructed before this function is called.
An empty implementation of this function is supplied by the UI framework. UI applications that need to persist any data must provide their own implementation.
If the function leaves, an implementation should ensure that the store and the stream dictionary are returned to the state they were in before the function was called.
CStreamStore & aStore | The store into which document data is to be stored. |
CStreamDictionary & aStreamDic | The stream dictionary into which stream IDs and associated UIDs are to be recorded. |