epoc32/include/eikdoc.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/eikdoc.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/eikdoc.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,128 @@
     1.4 -eikdoc.h
     1.5 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +// All rights reserved.
     1.7 +// This component and the accompanying materials are made available
     1.8 +// 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
     1.9 +// which accompanies this distribution, and is available
    1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +//
    1.12 +// Initial Contributors:
    1.13 +// Nokia Corporation - initial contribution.
    1.14 +//
    1.15 +// Contributors:
    1.16 +//
    1.17 +// Description:
    1.18 +//
    1.19 +
    1.20 +#ifndef __EIKDOC_H__
    1.21 +#define __EIKDOC_H__
    1.22 +
    1.23 +#include <apparc.h>
    1.24 +#include <savenotf.h>
    1.25 +
    1.26 +class CEikAppUi;
    1.27 +class CEikApplication;
    1.28 +class CApaWindowGroupName;
    1.29 +
    1.30 +
    1.31 +/** The base class for all GUI applications' documents. 
    1.32 +
    1.33 +In file-based applications, the document represents the data that relates to a 
    1.34 +particular instance of the application, and should handle storing and restoring 
    1.35 +it. In all applications, whether file-based or not, the document is used to create 
    1.36 +the application UI. 
    1.37 +
    1.38 +A class derived from CEikDocument must be defined by each GUI application, and minimally 
    1.39 +it must implement CreateAppUiL(). Note that UIs may implement their own document base class, 
    1.40 +derived from CEikDocument, which applications may need to derive from instead. 
    1.41 +
    1.42 +The document is created by the application's CreateDocumentL() function.
    1.43 +
    1.44 +@publishedAll
    1.45 +@released 
    1.46 +@see CEikApplication::CreateDocumentL()
    1.47 +@see CEikAppUi */
    1.48 +class CEikDocument : public CApaDocument, public MSaveObserver
    1.49 +	{
    1.50 +public: // new functions
    1.51 +	/** Constructs the application UI.
    1.52 +	
    1.53 +	This function is called by the UI framework during application start-up. It should 
    1.54 +	only carry out first phase construction of the app UI, in other words, using new(ELeave). 
    1.55 +	It should not call the app UI's ConstructL(), because the UI framework is responsible 
    1.56 +	for this. Note also that the UI framework takes ownership of the app UI, so the 
    1.57 +	document does not need to destroy it.
    1.58 +
    1.59 +	@return A partially-constructed app UI object. */
    1.60 +	virtual CEikAppUi* CreateAppUiL()=0;
    1.61 +	IMPORT_C virtual CFileStore* OpenFileL(TBool aDoOpen,const TDesC& aFilename,RFs& aFs);
    1.62 +	IMPORT_C void PrepareToEditL(MApaEmbeddedDocObserver* aObserver,TBool aReadOnly);
    1.63 +	IMPORT_C void PrepareToEditL();
    1.64 +	IMPORT_C void SetAppFileMode(TUint aMode);
    1.65 +	IMPORT_C TUint AppFileMode() const;
    1.66 +	IMPORT_C virtual void UpdateTaskNameL(CApaWindowGroupName* aWgName);
    1.67 +	IMPORT_C const TApaAppCaption& AppCaption() const;
    1.68 +	IMPORT_C void SetChanged(TBool aHasChanged);
    1.69 +	IMPORT_C void SetEditStoreL(CStreamStore* aStore);
    1.70 +	void SetEditStoreWithoutAppUiNotificationL(CStreamStore* aStore);
    1.71 +	inline CStreamStore* EditStore() const;
    1.72 +	IMPORT_C ~CEikDocument();
    1.73 +public: // from MSaveObserver
    1.74 +	IMPORT_C virtual void SaveL(MSaveObserver::TSaveType aSaveType);
    1.75 +public: // from CApaDocument
    1.76 +	IMPORT_C void NewDocumentL();
    1.77 +	IMPORT_C CFileStore* CreateFileStoreLC(RFs& aFs,const TDesC& aFileName);
    1.78 +	IMPORT_C void EditL(MApaEmbeddedDocObserver* aObserver,TBool aReadOnly=EFalse);
    1.79 +	IMPORT_C void PrintL(const CStreamStore& aSourceStore);
    1.80 +	IMPORT_C void SaveL();
    1.81 +	IMPORT_C void StoreL(CStreamStore& aStore,CStreamDictionary& aStreamDic) const;
    1.82 +	IMPORT_C void RestoreL(const CStreamStore& aStore,const CStreamDictionary& aStreamDic);
    1.83 +	IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
    1.84 +	IMPORT_C TBool IsEmpty() const;
    1.85 +	IMPORT_C TBool HasChanged() const;
    1.86 +	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
    1.87 +protected:
    1.88 +	IMPORT_C CEikDocument();
    1.89 +	IMPORT_C CEikDocument(CEikApplication& aApp);
    1.90 +public:
    1.91 +	IMPORT_C virtual void OpenFileL(CFileStore*& aFileStore, RFile& aFile);
    1.92 +private:
    1.93 +	void NullAppUi();
    1.94 +	// reserved functions from CApaDocument
    1.95 +	IMPORT_C virtual void Reserved_2();
    1.96 +protected:
    1.97 +	/** A pointer to the app UI which the document is associated with. */
    1.98 +	CEikAppUi* iAppUi;
    1.99 +	/** A pointer to the file store object which is used to edit the document. */
   1.100 +	CStreamStore* iEditStore;
   1.101 +private:
   1.102 +	TBool iChanged;
   1.103 +	TUint iAppFileMode;
   1.104 +	friend class CEikAppUi;
   1.105 +	};
   1.106 +
   1.107 +/** A pointer to the application process associated with this document.
   1.108 +
   1.109 +@publishedAll
   1.110 +@released */
   1.111 +#define iEikProcess ((CEikProcess*)Process())
   1.112 +
   1.113 +/** A pointer to the application that created this document.
   1.114 +
   1.115 +@publishedAll
   1.116 +@released */
   1.117 +#define iEikApplication ((CEikApplication*)Application())
   1.118 +
   1.119 +/** The default size in twips of icons that represent embedded objects.
   1.120 +
   1.121 +@publishedPartner
   1.122 +@released */
   1.123 +#define KDefaultIconicDoorSize TSize(500,500)
   1.124 +
   1.125 +
   1.126 +/** Gets the file store object which is used to edit the document.
   1.127 +
   1.128 +@return A pointer to the file store object which is used to edit the document. */
   1.129 +inline CStreamStore* CEikDocument::EditStore() const
   1.130 +	{ return(iEditStore); }
   1.131 +
   1.132 +#endif	// __EIKDOC_H__