epoc32/include/eikdoc.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
permissions -rw-r--r--
Final list of Symbian^2 public API header files
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 __EIKDOC_H__
williamr@2
    17
#define __EIKDOC_H__
williamr@2
    18
williamr@2
    19
#include <apparc.h>
williamr@2
    20
#include <savenotf.h>
williamr@2
    21
williamr@2
    22
class CEikAppUi;
williamr@2
    23
class CEikApplication;
williamr@2
    24
class CApaWindowGroupName;
williamr@2
    25
williamr@2
    26
williamr@2
    27
/** The base class for all GUI applications' documents. 
williamr@2
    28
williamr@2
    29
In file-based applications, the document represents the data that relates to a 
williamr@2
    30
particular instance of the application, and should handle storing and restoring 
williamr@2
    31
it. In all applications, whether file-based or not, the document is used to create 
williamr@2
    32
the application UI. 
williamr@2
    33
williamr@2
    34
A class derived from CEikDocument must be defined by each GUI application, and minimally 
williamr@2
    35
it must implement CreateAppUiL(). Note that UIs may implement their own document base class, 
williamr@2
    36
derived from CEikDocument, which applications may need to derive from instead. 
williamr@2
    37
williamr@2
    38
The document is created by the application's CreateDocumentL() function.
williamr@2
    39
williamr@2
    40
@publishedAll
williamr@2
    41
@released 
williamr@2
    42
@see CEikApplication::CreateDocumentL()
williamr@2
    43
@see CEikAppUi */
williamr@2
    44
class CEikDocument : public CApaDocument, public MSaveObserver
williamr@2
    45
	{
williamr@2
    46
public: // new functions
williamr@2
    47
	/** Constructs the application UI.
williamr@2
    48
	
williamr@2
    49
	This function is called by the UI framework during application start-up. It should 
williamr@2
    50
	only carry out first phase construction of the app UI, in other words, using new(ELeave). 
williamr@2
    51
	It should not call the app UI's ConstructL(), because the UI framework is responsible 
williamr@2
    52
	for this. Note also that the UI framework takes ownership of the app UI, so the 
williamr@2
    53
	document does not need to destroy it.
williamr@2
    54
williamr@2
    55
	@return A partially-constructed app UI object. */
williamr@2
    56
	virtual CEikAppUi* CreateAppUiL()=0;
williamr@2
    57
	IMPORT_C virtual CFileStore* OpenFileL(TBool aDoOpen,const TDesC& aFilename,RFs& aFs);
williamr@2
    58
	IMPORT_C void PrepareToEditL(MApaEmbeddedDocObserver* aObserver,TBool aReadOnly);
williamr@2
    59
	IMPORT_C void PrepareToEditL();
williamr@2
    60
	IMPORT_C void SetAppFileMode(TUint aMode);
williamr@2
    61
	IMPORT_C TUint AppFileMode() const;
williamr@2
    62
	IMPORT_C virtual void UpdateTaskNameL(CApaWindowGroupName* aWgName);
williamr@2
    63
	IMPORT_C const TApaAppCaption& AppCaption() const;
williamr@2
    64
	IMPORT_C void SetChanged(TBool aHasChanged);
williamr@2
    65
	IMPORT_C void SetEditStoreL(CStreamStore* aStore);
williamr@2
    66
	void SetEditStoreWithoutAppUiNotificationL(CStreamStore* aStore);
williamr@2
    67
	inline CStreamStore* EditStore() const;
williamr@2
    68
	IMPORT_C ~CEikDocument();
williamr@2
    69
public: // from MSaveObserver
williamr@2
    70
	IMPORT_C virtual void SaveL(MSaveObserver::TSaveType aSaveType);
williamr@2
    71
public: // from CApaDocument
williamr@2
    72
	IMPORT_C void NewDocumentL();
williamr@2
    73
	IMPORT_C CFileStore* CreateFileStoreLC(RFs& aFs,const TDesC& aFileName);
williamr@2
    74
	IMPORT_C void EditL(MApaEmbeddedDocObserver* aObserver,TBool aReadOnly=EFalse);
williamr@2
    75
	IMPORT_C void PrintL(const CStreamStore& aSourceStore);
williamr@2
    76
	IMPORT_C void SaveL();
williamr@2
    77
	IMPORT_C void StoreL(CStreamStore& aStore,CStreamDictionary& aStreamDic) const;
williamr@2
    78
	IMPORT_C void RestoreL(const CStreamStore& aStore,const CStreamDictionary& aStreamDic);
williamr@2
    79
	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
williamr@2
    80
	IMPORT_C TBool IsEmpty() const;
williamr@2
    81
	IMPORT_C TBool HasChanged() const;
williamr@2
    82
	IMPORT_C virtual void ValidatePasswordL() const; // return EFalse if there *is* a password *and* the user doesn't get it right, ETrue otherwise (ie they get it right or there isn't one). Returns ETrue by default
williamr@2
    83
protected:
williamr@2
    84
	IMPORT_C CEikDocument();
williamr@2
    85
	IMPORT_C CEikDocument(CEikApplication& aApp);
williamr@2
    86
public:
williamr@2
    87
	IMPORT_C virtual void OpenFileL(CFileStore*& aFileStore, RFile& aFile);
williamr@2
    88
private:
williamr@2
    89
	void NullAppUi();
williamr@2
    90
	// reserved functions from CApaDocument
williamr@2
    91
	IMPORT_C virtual void Reserved_2();
williamr@2
    92
protected:
williamr@2
    93
	/** A pointer to the app UI which the document is associated with. */
williamr@2
    94
	CEikAppUi* iAppUi;
williamr@2
    95
	/** A pointer to the file store object which is used to edit the document. */
williamr@2
    96
	CStreamStore* iEditStore;
williamr@2
    97
private:
williamr@2
    98
	TBool iChanged;
williamr@2
    99
	TUint iAppFileMode;
williamr@2
   100
	friend class CEikAppUi;
williamr@2
   101
	};
williamr@2
   102
williamr@2
   103
/** A pointer to the application process associated with this document.
williamr@2
   104
williamr@2
   105
@publishedAll
williamr@2
   106
@released */
williamr@2
   107
#define iEikProcess ((CEikProcess*)Process())
williamr@2
   108
williamr@2
   109
/** A pointer to the application that created this document.
williamr@2
   110
williamr@2
   111
@publishedAll
williamr@2
   112
@released */
williamr@2
   113
#define iEikApplication ((CEikApplication*)Application())
williamr@2
   114
williamr@2
   115
/** The default size in twips of icons that represent embedded objects.
williamr@2
   116
williamr@2
   117
@publishedPartner
williamr@2
   118
@released */
williamr@2
   119
#define KDefaultIconicDoorSize TSize(500,500)
williamr@2
   120
williamr@2
   121
williamr@2
   122
/** Gets the file store object which is used to edit the document.
williamr@2
   123
williamr@2
   124
@return A pointer to the file store object which is used to edit the document. */
williamr@2
   125
inline CStreamStore* CEikDocument::EditStore() const
williamr@2
   126
	{ return(iEditStore); }
williamr@2
   127
williamr@2
   128
#endif	// __EIKDOC_H__