|
||
class CApaProcess : public CBase;
Maintains a list of documents and all of the potentially shared resources used by documents.
This includes the application DLLs. The class also supplies utility functions that provide the basic structure for persisted document files.
The class deals with the loading of application DLLs and manages the creation and destruction of application (CApaApplication
) objects and document (CApaDocument
) objects.
The class is derived from by the UI framework and further derivation by the UI application is not necessary unless it needs to add extra utility functions for the use of applications.
CBase
-
Base class for all classes to be instantiated on the heap.
CApaProcess
- Maintains a list of documents and all of the potentially shared resources used b...
Defined in CApaProcess
:
AddNewDocumentL(TApaApplicationFactory)
Creates and adds a new document using the specified application factory.CApaProcess()
Constructor for CApaProcess CApaProcess(const RFs &)
Constructs the application process object with the specified file session handle...CApaProcess_Reserved1()
Reserved for future use CApaProcess_Reserved2()
Reserved for future use ConstructL()
Completes construction of the application process object.ConstructL(TProcessId)
Completes construction of the application process object, passing in a Parent Pr...DestroyDocument(CApaDocument *)
Destroys the specified document.FsSession()const
Returns a handle to the file server session used by this application process.MainDocFileName()const
Returns the filename of the main document.MainDocument()const
Returns a pointer to the main document.NewL(const RFs &)
Creates and returns a pointer to a new application process.OpenNewDocumentL(CFileStore *&,CStreamDictionary *&,const TDesC &,TUint)
Opens the specified file and restores the content as a document.ReadAppIdentifierL(const CStreamStore &,const CStreamDictionary &)
Reads the application identifier from its stream in the specified store and retu...ReadRootStreamLC(RFs &,CFileStore *&,const TDesC &,TUint)
Reads the stream dictionary contained as the root stream in the specified docume...ResetL()
Resets the the application process to its initial state.SetMainDocFileName(const TDesC &)
Sets the filename of the main document.SetMainDocFileNameL(const TDesC &)
Sets the filename of the main document.SetMainDocument(CApaDocument *)
Sets the main document.WriteAppIdentifierL(CStreamStore &,CStreamDictionary &,const TApaAppIdentifier &)
Writes the application identifier to a new stream in the specified store and rec...WriteRootStreamL(CPersistentStore &,CStreamDictionary &,const CApaApplication &)
Writes the application identifier (derived from the application object CApaAppli...WriteRootStreamL(CPersistentStore &,CStreamDictionary &,const TApaAppIdentifier &)
Writes the application identifier followed by the stream dictionary to the store...~CApaProcess()
Frees resources prior to destruction.Inherited from CBase
:
Delete(CBase *)
Deletes the specified object.Extension_(TUint,TAny *&,TAny *)
Extension function operator new(TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TAny *)
Initialises the object to binary zeroes.operator new(TUint,TLeave)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TLeave,TUint)
Allocates the object from the heap and then initialises its contents to binary z...operator new(TUint,TUint)
Allocates the object from the heap and then initialises its contents to binary z...CApaApplication
Defines the basic behaviour for applications.CApaDocument
Defines basic behaviour for documents.IMPORT_C static CApaProcess* NewL(const RFs &aFs);
Creates and returns a pointer to a new application process.
This function is not used by UI applications.
|
|
IMPORT_C ~CApaProcess();
Frees resources prior to destruction.
Documents must be saved before the application process is deleted, otherwise data may be lost.
In debug mode, the destructor raises an APPARC 6 panic if documents still exist, and an APPARC 5 panic if applications still exist.
Interface status: | deprecated |
protected: IMPORT_C CApaProcess(const RFs &aFs);
Constructs the application process object with the specified file session handle.
Derived classes must define and implement a constructor through which the file session handle can be specified. A typical implementation calls this constructor through a constructor initialization list.
This constructor is used by the UI framework.
|
protected: IMPORT_C void ConstructL();
Completes construction of the application process object.
Implementers of derived classes must call this function as part of the second stage construction of an object. Typically,
derived classes implement their own CApaProcess::NewL(const RFs &)
function and call CApaProcess::ConstructL()
as part of that implementation.
protected: IMPORT_C void ConstructL(TProcessId aParentProcessId);
Completes construction of the application process object, passing in a Parent Process Identifier.
Implementers of derived classes must call this function as part of the second stage construction of an object. Typically,
derived classes implement their own CApaProcess::NewL(const RFs &)
function and call CApaProcess::ConstructL()
as part of that implementation.
|
IMPORT_C void ResetL();
Resets the the application process to its initial state.
Specifically, it saves the main document, deletes the main and all embedded documents from memory, resets the main document filename and deletes all applications except the main application.
The function can leave if saving the main document fails.
IMPORT_C static CStreamDictionary* ReadRootStreamLC(RFs &aFs, CFileStore *&aStore, const TDesC &aDocFullFileName, TUint aFileMode);
Reads the stream dictionary contained as the root stream in the specified document file.
The function constructs, and returns a pointer to the stream dictionary object and puts the pointer to the stream dictionary object onto the cleanup stack. It also returns a pointer to the created file store object through an argument reference.
The file must be a valid document file; otherwise the function leaves with one of the system-wide error codes.
|
|
IMPORT_C static void WriteRootStreamL(CPersistentStore &aStore, CStreamDictionary &aStreamDic, const CApaApplication &aApp);
Writes the application identifier (derived from the application object CApaApplication
) followed by the stream dictionary to the store and makes the stream dictionary the root stream of the store.
Typically, the function is called by the application when it implements a file create or file save type operation. It is called after all model and UI data has been persisted. The IDs of the streams containing the model and UI data should have been lodged in the stream dictionary.
In effect, the function finishes off the file save or file create type operation, leaving the file containing the store in a valid state with the standard interface.
|
IMPORT_C static void WriteRootStreamL(CPersistentStore &aStore, CStreamDictionary &aStreamDic, const TApaAppIdentifier &aAppId);
Writes the application identifier followed by the stream dictionary to the store and makes the stream dictionary the root stream of the store.
Typically, the function is called by the application when it implements a file create or file save type operation. It is called after all model and UI data has been persisted. The IDs of the streams containing the model and UI data should have been lodged in the stream dictionary.
In effect, the function finishes off the file save or file create type operation, leaving the file containing the store in a valid state with the standard interface.
|
IMPORT_C static TApaAppIdentifier ReadAppIdentifierL(const CStreamStore &aStore, const CStreamDictionary &aStreamDic);
Reads the application identifier from its stream in the specified store and returns it.
The location of the stream is found in the specified stream dictionary.
|
|
IMPORT_C static void WriteAppIdentifierL(CStreamStore &aStore, CStreamDictionary &aStreamDic, const TApaAppIdentifier &aAppId);
Writes the application identifier to a new stream in the specified store and records the location of this stream in the specified stream dictionary.
|
IMPORT_C CApaDocument* AddNewDocumentL(TApaApplicationFactory aApplicationFactory);
Creates and adds a new document using the specified application factory.
The document may be a main document or an embedded document.
Any document created with this function must be destroyed using CApaProcess::DestroyDocument(CApaDocument *)
.
|
|
CApaProcess::DestroyDocument(CApaDocument *)
Destroys the specified document.CApaApplication
Defines the basic behaviour for applications.IMPORT_C CApaDocument* OpenNewDocumentL(CFileStore *&aStore, CStreamDictionary *&aStreamDic, const TDesC &aDocFullFileName,
TUint aFileMode);
Opens the specified file and restores the content as a document.
The created document can be merged into or embedded in another document.
Any document created with this function must be destroyed using CApaProcess::DestroyDocument(CApaDocument *)
.
|
|
CApaProcess::DestroyDocument(CApaDocument *)
Destroys the specified document.IMPORT_C void DestroyDocument(CApaDocument *aDoc);
Destroys the specified document.
All references to the document are removed, and associated resources are freed. Specifically, the function deletes any associated application and unloads the application DLL, provided that no other documents of that application type are still open.
All document objects created through CApaProcess must be deleted using this function.
|
CApaApplication
Defines the basic behaviour for applications.IMPORT_C void SetMainDocument(CApaDocument *aDocument);
Sets the main document.
|
CApaProcess::AddNewDocumentL(TApaApplicationFactory)
Creates and adds a new document using the specified application factory.CApaProcess::OpenNewDocumentL(CFileStore *&,CStreamDictionary *&,const TDesC &,TUint)
Opens the specified file and restores the content as a document.IMPORT_C void SetMainDocFileName(const TDesC &aMainDocFileName);
Sets the filename of the main document.
|
|
IMPORT_C void SetMainDocFileNameL(const TDesC &aMainDocFileName);
Sets the filename of the main document.
|
IMPORT_C TPtrC MainDocFileName() const;
Returns the filename of the main document.
|
inline RFs& FsSession() const;
Returns a handle to the file server session used by this application process.
|
inline CApaDocument* MainDocument() const;
Returns a pointer to the main document.
|
protected: IMPORT_C virtual void CApaProcess_Reserved2();
Reserved for future use