Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]

#include <EIKPROC.H>
Link against: eikcore.lib

Class CEikProcess

class CEikProcess : public CApaProcess;

Description

The controlling process for an application.

An instance of this class is created by the Uikon environment. This instance calls CApaProcess::AddNewDocumentL(TApaApplicationFactory) to load the application DLL and construct the new application which runs in this environment.

It also provides services related to an application's main (non-embedded) document, including:

Derivation

Members

Defined in CEikProcess:

Inherited from CApaProcess:

Inherited from CBase:


Construction and destruction


~CEikProcess()

IMPORT_C ~CEikProcess();

Description

Destructor.

Destroys the main document.

[Top]


Member functions


CommandTailEnd()const

IMPORT_C TPtrC CommandTailEnd() const;

Description

Returns the command tail end - i.e. command line parameters

Return value

TPtrC16

CommandTailEnd.


MainDocFolder()const

IMPORT_C TFileName MainDocFolder() const;

Description

Returns the drive and path of the main document.

Return value

TBuf

The drive and path of the main document. This excludes the filename.


SetLastUsedFileL(TLastUsedFile,const TDesC &)const

IMPORT_C void SetLastUsedFileL(TLastUsedFile aType, const TDesC &aFileName) const;

Description

Sets the name of either the last opened or the last created file.

The information is written to the .ini file of the application associated with the main document. It attempts to create an .ini file if one does not exist.

Parameters

CEikProcess::TLastUsedFile aType

Indicates whether aFileName is the name of the last opened or last created file.

const TDesC16 &aFileName

The name of the last opened or last created file.


LastUsedFileL(TLastUsedFile)const

IMPORT_C TFileName LastUsedFileL(TLastUsedFile aType) const;

Description

Gets the name of either the last opened or last created file.

The information is read from the .ini file of the application associated with the main document. The function cannot leave. If an error occurs, the function returns an empty filename.

Parameters

CEikProcess::TLastUsedFile aType

Indicates whether the function should return the name of the last opened or last created file.

Return value

TBuf

The name of the last opened or last created file.


SetMainStore(CFileStore *)

IMPORT_C void SetMainStore(CFileStore *aMainStore);

Description

Sets the file store that stores the main document.

A main store must have been set before you can call CEikProcess::SaveToDirectFileStoreL(CEikDocument *,const TFileName *).

Parameters

CFileStore *aMainStore

The file store object which is used to store the main document.


MainStore()const

IMPORT_C CFileStore* MainStore() const;

Description

Gets a pointer to the main store. This is the file store that holds the main document.

Return value

CFileStore *

The main store, or NULL if it has not been set.


AppFromDocL(TDes &,const TDesC &)const

IMPORT_C void AppFromDocL(TDes &aLibraryName, const TDesC &aDocumentName) const;

Description

Gets the name of the application DLL associated with the specified document.

Parameters

TDes16 &aLibraryName

On return, holds the path and filename of the application DLL.

const TDesC16 &aDocumentName

The path and filename of the document file.

Leave codes

KErrCorrupt

The document file is not valid (its UID2 must be KUidAppDllDoc).


SaveToDirectFileStoreL(CEikDocument *,const TFileName *)

IMPORT_C void SaveToDirectFileStoreL(CEikDocument *aDoc, const TFileName *aNewFileName=0);

Description

Saves the main document optionally to a new file.

If aNewFileName is specified, a new file with that name is created, and the main document is saved to it. This file is opened for writing.

If aNewFileName is NULL, the main document is saved and is opened for writing.

Parameters

CEikDocument *aDoc

The main document.

const TBuf *aNewFileName

The optional new filename for the main document. This file should not already exist.

Panic codes

EIKON

44 The main store has not been allocated.

EIKON

45 The main store is not a direct file store (its first UID is not KDirectFileStoreLayoutUid).


SaveToDirectFileStoreL(CEikDocument *,const TFileName *,TBool,TFileName *)

IMPORT_C void SaveToDirectFileStoreL(CEikDocument *aDoc, const TFileName *aNewFileName, TBool aReopen, TFileName *aTempFile=0);

Description

Saves the main document optionally to a new file, and optionally opens it.

Parameters

CEikDocument *aDoc

The main document.

const TBuf *aNewFileName

The optional new filename for the main document. This file should not already exist. If specified, a new file with this name is created, and the main document is saved to it; aTempFile is not used. If NULL, the main document is saved to a temporary file, whose name is returned in aTempFile.

TBool aReopen

If true, the main document file is set to the contents of any temporary file created, if applicable, and the newly created main document file is opened for writing. If false, the temporary file (if created) or the main document file remains closed.

TBuf *aTempFile

If not NULL, on return, this holds the path and filename of the temporary file created and into which the document was saved.

Panic codes

EIKON

44 The main store has not been allocated.

EIKON

45 The main store is not a direct file store (its first UID is not KDirectFileStoreLayoutUid).

[Top]


Member enumerations


Enum TLastUsedFile

TLastUsedFile

Description

Used as a parameter by CEikProcess::SetLastUsedFileL(TLastUsedFile,const TDesC &)const and CEikProcess::LastUsedFileL(TLastUsedFile)const to indicate whether the function relates to the last opened or last created file.

ELastOpenFile

Last opened file.

ELastCreatedFile

Last created file.