author | William Roberts <williamr@symbian.org> |
Tue, 16 Mar 2010 16:12:26 +0000 | |
branch | Symbian2 |
changeset 2 | 2fe1408b6811 |
parent 0 | 061f57f2323e |
permissions | -rw-r--r-- |
williamr@2 | 1 |
// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
williamr@2 | 2 |
// All rights reserved. |
williamr@2 | 3 |
// This component and the accompanying materials are made available |
williamr@2 | 4 |
// under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
williamr@2 | 5 |
// which accompanies this distribution, and is available |
williamr@2 | 6 |
// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
williamr@2 | 7 |
// |
williamr@2 | 8 |
// Initial Contributors: |
williamr@2 | 9 |
// Nokia Corporation - initial contribution. |
williamr@2 | 10 |
// |
williamr@2 | 11 |
// Contributors: |
williamr@2 | 12 |
// |
williamr@2 | 13 |
// Description: |
williamr@2 | 14 |
// |
williamr@2 | 15 |
|
williamr@2 | 16 |
#ifndef __EIKAPP_H__ |
williamr@2 | 17 |
#define __EIKAPP_H__ |
williamr@2 | 18 |
|
williamr@2 | 19 |
#include <apparc.h> // class CApaApplication |
williamr@2 | 20 |
#include <apaflrec.h> |
williamr@2 | 21 |
|
williamr@2 | 22 |
class CCoeEnv; |
williamr@2 | 23 |
|
williamr@2 | 24 |
/** The base of all Uikon applications. |
williamr@2 | 25 |
|
williamr@2 | 26 |
CEikApplication builds on CApaApplication, providing a basis for applications |
williamr@2 | 27 |
working within the framework provided by Uikon. It also contains an interface |
williamr@2 | 28 |
to the resource file and the document object belonging to the application. |
williamr@2 | 29 |
|
williamr@2 | 30 |
Each Uikon application class is derived from CEikApplication. Application |
williamr@2 | 31 |
writers must provide at least an implementation of the pure virtual function |
williamr@2 | 32 |
CreateDocumentL(). |
williamr@2 | 33 |
|
williamr@2 | 34 |
The application's resource file can be changed from the default by overriding |
williamr@2 | 35 |
ResourceFileName(). |
williamr@2 | 36 |
|
williamr@2 | 37 |
@publishedAll |
williamr@2 | 38 |
@released |
williamr@2 | 39 |
@see CEikDocument */ |
williamr@2 | 40 |
class CEikApplication : public CApaApplication |
williamr@2 | 41 |
{ |
williamr@2 | 42 |
public: |
williamr@2 | 43 |
IMPORT_C ~CEikApplication(); |
williamr@2 | 44 |
inline TInt ResourceFileOffset() const; |
williamr@2 | 45 |
inline CApaProcess* Process() const; |
williamr@2 | 46 |
inline const TApaAppCaption& AppCaption() const; |
williamr@2 | 47 |
IMPORT_C virtual void GetDefaultDocumentFileName(TFileName& aDocumentName) const; |
williamr@2 | 48 |
IMPORT_C virtual TFileName BitmapStoreName() const; |
williamr@2 | 49 |
public: // from CApaApplication |
williamr@2 | 50 |
IMPORT_C CDictionaryStore* OpenIniFileLC(RFs& aFs) const; |
williamr@2 | 51 |
IMPORT_C void Capability(TDes8& aInfo) const; |
williamr@2 | 52 |
IMPORT_C void SetToIniFileNameL(TParse& aParser) const; |
williamr@2 | 53 |
protected: // from CApaApplication |
williamr@2 | 54 |
IMPORT_C void PreDocConstructL(); |
williamr@2 | 55 |
IMPORT_C CApaDocument* CreateDocumentL(CApaProcess* aProcess); |
williamr@2 | 56 |
IMPORT_C void NewAppServerL(CApaAppServer*& aAppServer); |
williamr@2 | 57 |
protected: |
williamr@2 | 58 |
IMPORT_C CEikApplication(); |
williamr@2 | 59 |
IMPORT_C void EnsureCaptionIsLocalisedL(const TDesC& aLocalisableResourceFile); |
williamr@2 | 60 |
public: |
williamr@2 | 61 |
IMPORT_C virtual TFileName ResourceFileName() const; |
williamr@2 | 62 |
private: |
williamr@2 | 63 |
IMPORT_C virtual void CEikApplication_Reserved1(); |
williamr@2 | 64 |
IMPORT_C virtual void CEikApplication_Reserved2(); |
williamr@2 | 65 |
private: |
williamr@2 | 66 |
/** |
williamr@2 | 67 |
@publishedAll |
williamr@2 | 68 |
@released |
williamr@2 | 69 |
*/ |
williamr@2 | 70 |
virtual CApaDocument* CreateDocumentL()=0; |
williamr@2 | 71 |
private: // internal use |
williamr@2 | 72 |
void InitAppNameParserWithPathAndExt(TParse& aParser, const TDesC& aPath, const TDesC& aExt) const; |
williamr@2 | 73 |
protected: |
williamr@2 | 74 |
CCoeEnv* iCoeEnv; |
williamr@2 | 75 |
TInt iResourceFileOffset; |
williamr@2 | 76 |
private: |
williamr@2 | 77 |
enum |
williamr@2 | 78 |
{ |
williamr@2 | 79 |
EFlagCaptionCorrectlyLocalised = 0x00000001 |
williamr@2 | 80 |
}; |
williamr@2 | 81 |
private: |
williamr@2 | 82 |
CApaProcess* iProcess; |
williamr@2 | 83 |
TApaAppCaption iCaption; |
williamr@2 | 84 |
TApaAppCapabilityBuf* iCapabilityBuf; |
williamr@2 | 85 |
TUint iAppFlags; |
williamr@2 | 86 |
TInt iSpare; |
williamr@2 | 87 |
}; |
williamr@2 | 88 |
|
williamr@2 | 89 |
/** Gets the offset value defined for this application's default resource file. |
williamr@2 | 90 |
|
williamr@2 | 91 |
As the resource file offset can also be accessed through iResourceFileOffset, |
williamr@2 | 92 |
this function should not be needed by any apps. |
williamr@2 | 93 |
|
williamr@2 | 94 |
@return Offset of a resource file. */ |
williamr@2 | 95 |
inline TInt CEikApplication::ResourceFileOffset() const |
williamr@2 | 96 |
{ return iResourceFileOffset; } |
williamr@2 | 97 |
|
williamr@2 | 98 |
|
williamr@2 | 99 |
/** Gets the managing process. |
williamr@2 | 100 |
|
williamr@2 | 101 |
@return A pointer to the process object managing this application's documents. */ |
williamr@2 | 102 |
inline CApaProcess* CEikApplication::Process() const |
williamr@2 | 103 |
{ return iProcess; } |
williamr@2 | 104 |
|
williamr@2 | 105 |
|
williamr@2 | 106 |
/** Gets the caption for this application. |
williamr@2 | 107 |
|
williamr@2 | 108 |
Captions are displayed in the task list. |
williamr@2 | 109 |
|
williamr@2 | 110 |
@return Application caption. */ |
williamr@2 | 111 |
inline const TApaAppCaption& CEikApplication::AppCaption() const |
williamr@2 | 112 |
{ return iCaption; } |
williamr@2 | 113 |
|
williamr@2 | 114 |
#endif // __EIKAPP_H__ |