Symbian
Symbian OS Library

SYMBIAN OS V9.3

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



Location: 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() 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:
AppFromDocL(), CommandTailEnd(), ELastCreatedFile, ELastOpenFile, LastUsedFileL(), MainDocFolder(), MainStore(), SaveToDirectFileStoreL(), SaveToDirectFileStoreL(), SetLastUsedFileL(), SetMainStore(), TLastUsedFile, ~CEikProcess()

Inherited from CApaProcess:
AddNewDocumentL(), CApaProcess_Reserved1(), CApaProcess_Reserved2(), ConstructL(), DestroyDocument(), FsSession(), MainDocFileName(), MainDocument(), NewL(), OpenNewDocumentL(), ReadAppIdentifierL(), ReadRootStreamLC(), ResetL(), SetMainDocFileName(), SetMainDocFileNameL(), SetMainDocument(), WriteAppIdentifierL(), WriteRootStreamL()

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


Construction and destruction


~CEikProcess()

IMPORT_C ~CEikProcess();

Description

Destructor.

Destroys the main document.

[Top]


Member functions


CommandTailEnd()

IMPORT_C TPtrC CommandTailEnd() const;

Description

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

Return value

TPtrC

CommandTailEnd.


MainDocFolder()

IMPORT_C TFileName MainDocFolder() const;

Description

Returns the drive and path of the main document.

Return value

TFileName

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


SetLastUsedFileL()

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

TLastUsedFile aType

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

const TDesC &aFileName

The name of the last opened or last created file.


LastUsedFileL()

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

TLastUsedFile aType

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

Return value

TFileName

The name of the last opened or last created file.


SetMainStore()

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 SaveToDirectFileStoreL().

Parameters

CFileStore *aMainStore

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


MainStore()

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

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

Description

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

Parameters

TDes &aLibraryName

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

const TDesC &aDocumentName

The path and filename of the document file.

Leave codes

KErrCorrupt

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


SaveToDirectFileStoreL()

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 TFileName *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()

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 TFileName *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.

TFileName *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() and LastUsedFileL() to indicate whether the function relates to the last opened or last created file.

ELastOpenFile

Last opened file.

ELastCreatedFile

Last created file.