epoc32/include/apamdr.h
branchSymbian2
changeset 3 e1b950c65cb4
parent 2 2fe1408b6811
child 4 837f303aceeb
     1.1 --- a/epoc32/include/apamdr.h	Tue Mar 16 16:12:26 2010 +0000
     1.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.3 @@ -1,202 +0,0 @@
     1.4 -// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.5 -// All rights reserved.
     1.6 -// This component and the accompanying materials are made available
     1.7 -// 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.8 -// which accompanies this distribution, and is available
     1.9 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.10 -//
    1.11 -// Initial Contributors:
    1.12 -// Nokia Corporation - initial contribution.
    1.13 -//
    1.14 -// Contributors:
    1.15 -//
    1.16 -// Description:
    1.17 -//
    1.18 -
    1.19 -#ifndef __APAMDR_H__
    1.20 -#define __APAMDR_H__
    1.21 -
    1.22 -#if !defined(__E32STD_H__)
    1.23 -#include <e32std.h>
    1.24 -#endif
    1.25 -#if !defined(__E32BASE_H__)
    1.26 -#include <e32base.h>
    1.27 -#endif
    1.28 -#if !defined(__GDI_H__)
    1.29 -#include <gdi.h>
    1.30 -#endif
    1.31 -#if !defined(__APADBASE_H__)
    1.32 -#include <apadbase.h>
    1.33 -#endif
    1.34 -
    1.35 -// classes defined:
    1.36 -class TApaModelDoorFactory;
    1.37 -class CApaModelDoor;
    1.38 -class CApaModelHeader;
    1.39 -class MApaModelHeaderFactory;
    1.40 -//
    1.41 -// classes referenced:
    1.42 -class RReadStream;
    1.43 -class RWriteStream;
    1.44 -class CStreamStore;
    1.45 -class CStreamDictionary;
    1.46 -class CEmbeddedStore;
    1.47 -class TApaAppIdentifier;
    1.48 -//
    1.49 -
    1.50 -
    1.51 -class TApaModelDoorFactory : public MPictureFactory
    1.52 -// Recognizes KUidPictureTypeDoor and creates CApaModelDoor pictures
    1.53 -/** A factory class for instantiating and restoring an application's door using 
    1.54 -the application's model. 
    1.55 -
    1.56 -@publishedAll 
    1.57 -@released */
    1.58 -	{
    1.59 -public:
    1.60 -	IMPORT_C TApaModelDoorFactory(const MApaModelHeaderFactory* aFactory);
    1.61 -	//
    1.62 -	// from MPictureFactory
    1.63 -	IMPORT_C void NewPictureL(TPictureHeader& aPictureHeader,const CStreamStore& aPictureStore)const; // used to create CApaDoor's during document restore only 
    1.64 -private:
    1.65 -	const MApaModelHeaderFactory* iHeaderFactory;
    1.66 -	TInt iTApaModelDoorFactory_Reserved1;
    1.67 -	};
    1.68 -
    1.69 -
    1.70 -class CApaModelDoor : public CApaDoorBase
    1.71 -/** A persistent representation of a door that also acts as a wrapper around an 
    1.72 -application's model.
    1.73 -
    1.74 -The class allows embedded data to be manipulated without requiring the whole 
    1.75 -associated application. 
    1.76 -
    1.77 -@publishedAll 
    1.78 -@released */
    1.79 -	{
    1.80 -public:
    1.81 -	IMPORT_C static CApaModelDoor* NewL(CApaModelHeader* aHeader);
    1.82 -	IMPORT_C static CApaModelDoor* NewLC(CApaModelHeader* aHeader);
    1.83 -	IMPORT_C static CApaModelDoor* NewL(const CStreamStore& aStore,TStreamId aHeadStreamId,const MApaModelHeaderFactory* aFactory);
    1.84 -	//
    1.85 -	/** Gets the application model wrapper object.
    1.86 -	
    1.87 -	@return A pointer to the application model wrapper object. */
    1.88 -	inline CApaModelHeader* ModelHeader() { return iModelHeader; }
    1.89 -	
    1.90 -	/** Sets the format of the door.
    1.91 -	
    1.92 -	@param aFormat The format for the graphical representation of the embedded 
    1.93 -	document. */
    1.94 -	inline void SetFormat(TFormat aFormat) { iFormat = aFormat; }
    1.95 -	//
    1.96 -	IMPORT_C TStreamId StoreL(CStreamStore& aStore) const;
    1.97 -	IMPORT_C void RestoreL(const CStreamStore& aStore,TStreamId aHeadStreamId,const MApaModelHeaderFactory* aFactory);
    1.98 -	//
    1.99 -	IMPORT_C ~CApaModelDoor();
   1.100 -	//
   1.101 -	// from CPicture
   1.102 -	IMPORT_C void DetachFromStoreL(TDetach /*aDegree*/=EDetachFull); //lint !e1735 Virtual function has default parameter - Inherited from CPicture, must be fixed there
   1.103 -	IMPORT_C void ExternalizeL(RWriteStream& aStream)const;
   1.104 -	IMPORT_C void Draw(CGraphicsContext& aGc,const TPoint& aTopLeft,const TRect& aClipRect,MGraphicsDeviceMap* aMap)const; 
   1.105 -	IMPORT_C void GetOriginalSizeInTwips(TSize& aSize)const;
   1.106 -	IMPORT_C void SetScaleFactor(TInt aScaleFactorWidth,TInt aScaleFactorHeight); 
   1.107 -	IMPORT_C TInt ScaleFactorWidth()const; 
   1.108 -	IMPORT_C TInt ScaleFactorHeight()const;
   1.109 -	//
   1.110 -private:
   1.111 -	CApaModelDoor();
   1.112 -	CApaModelDoor(CApaModelHeader* aHeader);
   1.113 -	//
   1.114 -	static CStreamDictionary* ReadStreamDictionaryLC(const CStreamStore& aSourceStore,TStreamId aStreamId);
   1.115 -	static void CopyStoreL(const CEmbeddedStore& aSourceStore,RWriteStream& aTargetStream);
   1.116 -	void InternalizeModelL(const MApaModelHeaderFactory& aFactory);
   1.117 -	//
   1.118 -	// from CApaDoorBase
   1.119 -	TSize GlassDoorSize()const;
   1.120 -private:
   1.121 -	CApaModelHeader* iModelHeader;
   1.122 -	CEmbeddedStore* iStore;
   1.123 -	TSize iScaleFactor;
   1.124 -	CBufSeg* iStoreHost; // the host for the embedded store, if the door has been detached from its originating store
   1.125 -	};
   1.126 -
   1.127 -
   1.128 -class CApaModelHeader : public CBase
   1.129 -// Abstract wrapper for an applications model - used for file format conversion etc
   1.130 -/** An interface class that acts as a wrapper for an application model.
   1.131 -
   1.132 -This is also known as an application model header.
   1.133 -
   1.134 -The class provides the knowledge for internalizing and externalizing an application 
   1.135 -model's data. An instance of the class is used by CApaModelDoor.
   1.136 -
   1.137 -A concrete implementation of the class must be supplied by the application 
   1.138 -model (not the application UI). An instance of the class is constructed by 
   1.139 -a factory object that implements the MApaModelHeaderFactory interface; the 
   1.140 -factory object is also supplied by the application model (not the application 
   1.141 -UI).
   1.142 -
   1.143 -@publishedAll
   1.144 -@released
   1.145 -@see CApaModelDoor
   1.146 -@see TApaModelDoorFactory
   1.147 -@see MApaModelHeaderFactory */
   1.148 -	{
   1.149 -public:
   1.150 -	/** Stores the model and its components in the specified store.
   1.151 -	
   1.152 -	@param aStore The store in which the model's components are to be stored.
   1.153 -	@param aDict The stream dictionary into which stream IDs and associated UIDs 
   1.154 -	are put. */
   1.155 -	virtual void StoreL(CStreamStore& aStore,CStreamDictionary& aDict) const=0;
   1.156 -	/** Gets the identity of the application associated with the application model.
   1.157 -	
   1.158 -	@return The application identity. */
   1.159 -	virtual TApaAppIdentifier AppId()const=0;
   1.160 -	/** Restores the model to the specified degree.
   1.161 -	
   1.162 -	An implementation of this function should propagate this call to all components 
   1.163 -	of the model.
   1.164 -	
   1.165 -	@param aDegree The degree to which restoration is needed. */
   1.166 -	virtual void DetachFromStoreL(CPicture::TDetach aDegree)=0;
   1.167 -protected:
   1.168 -	IMPORT_C CApaModelHeader();
   1.169 -private:
   1.170 -	IMPORT_C virtual void Reserved_1();
   1.171 -	IMPORT_C virtual void Reserved_2();
   1.172 -private:
   1.173 -	TInt iCApaModelHeader_Reserved1;
   1.174 -	};
   1.175 -
   1.176 -
   1.177 -
   1.178 -class MApaModelHeaderFactory
   1.179 -/** An interface class that applications implement to construct an application model 
   1.180 -wrapper object, also known as the application model header.
   1.181 -
   1.182 -@publishedAll
   1.183 -@released
   1.184 -@see CApaModelHeader */
   1.185 -	{
   1.186 -public:	
   1.187 -	/** Creates and returns an application model wrapper object.
   1.188 -	
   1.189 -	@param aStore The store containing model data.
   1.190 -	@param aDict The stream dictionary. 
   1.191 -	@param aAppId The application's identity held as a stream in the application's 
   1.192 -	store
   1.193 -	@return A pointer to the new application model wrapper object. */
   1.194 -	virtual CApaModelHeader* NewHeaderL(const CStreamStore& aStore,const CStreamDictionary& aDict,const TApaAppIdentifier& aAppId)const=0;
   1.195 -protected:
   1.196 -	IMPORT_C MApaModelHeaderFactory();
   1.197 -private:
   1.198 -	IMPORT_C virtual void MApaModelHeaderFactory_Reserved1();
   1.199 -	IMPORT_C virtual void MApaModelHeaderFactory_Reserved2();
   1.200 -private:
   1.201 -	TInt iMApaModelHeaderFactory_Reserved1;
   1.202 -	};
   1.203 -
   1.204 -
   1.205 -#endif