1.1 --- a/epoc32/include/mw/apamdr.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/mw/apamdr.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -1,9 +1,9 @@
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 +// under the terms of "Eclipse Public License v1.0"
1.9 // which accompanies this distribution, and is available
1.10 -// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.12 //
1.13 // Initial Contributors:
1.14 // Nokia Corporation - initial contribution.
1.15 @@ -11,60 +11,45 @@
1.16 // Contributors:
1.17 //
1.18 // Description:
1.19 +// apamdr.h
1.20 //
1.21
1.22 #ifndef __APAMDR_H__
1.23 #define __APAMDR_H__
1.24
1.25 -#if !defined(__E32STD_H__)
1.26 #include <e32std.h>
1.27 -#endif
1.28 -#if !defined(__E32BASE_H__)
1.29 #include <e32base.h>
1.30 -#endif
1.31 -#if !defined(__GDI_H__)
1.32 #include <gdi.h>
1.33 -#endif
1.34 -#if !defined(__APADBASE_H__)
1.35 #include <apadbase.h>
1.36 -#endif
1.37
1.38 -// classes defined:
1.39 -class TApaModelDoorFactory;
1.40 -class CApaModelDoor;
1.41 -class CApaModelHeader;
1.42 -class MApaModelHeaderFactory;
1.43 -//
1.44 -// classes referenced:
1.45 class RReadStream;
1.46 class RWriteStream;
1.47 class CStreamStore;
1.48 class CStreamDictionary;
1.49 class CEmbeddedStore;
1.50 class TApaAppIdentifier;
1.51 -//
1.52 +class MApaModelHeaderFactory;
1.53 +class CApaModelHeader;
1.54
1.55
1.56 -class TApaModelDoorFactory : public MPictureFactory
1.57 -// Recognizes KUidPictureTypeDoor and creates CApaModelDoor pictures
1.58 /** A factory class for instantiating and restoring an application's door using
1.59 the application's model.
1.60
1.61 @publishedAll
1.62 @released */
1.63 +class TApaModelDoorFactory : public MPictureFactory
1.64 +// Recognizes KUidPictureTypeDoor and creates CApaModelDoor pictures
1.65 {
1.66 public:
1.67 IMPORT_C TApaModelDoorFactory(const MApaModelHeaderFactory* aFactory);
1.68 - //
1.69 - // from MPictureFactory
1.70 - IMPORT_C void NewPictureL(TPictureHeader& aPictureHeader,const CStreamStore& aPictureStore)const; // used to create CApaDoor's during document restore only
1.71 +public: // from MPictureFactory
1.72 + IMPORT_C void NewPictureL(TPictureHeader& aPictureHeader, const CStreamStore& aPictureStore) const; // used to create CApaDoor's during document restore only
1.73 private:
1.74 const MApaModelHeaderFactory* iHeaderFactory;
1.75 TInt iTApaModelDoorFactory_Reserved1;
1.76 };
1.77
1.78
1.79 -class CApaModelDoor : public CApaDoorBase
1.80 /** A persistent representation of a door that also acts as a wrapper around an
1.81 application's model.
1.82
1.83 @@ -73,12 +58,13 @@
1.84
1.85 @publishedAll
1.86 @released */
1.87 +class CApaModelDoor : public CApaDoorBase
1.88 {
1.89 public:
1.90 IMPORT_C static CApaModelDoor* NewL(CApaModelHeader* aHeader);
1.91 IMPORT_C static CApaModelDoor* NewLC(CApaModelHeader* aHeader);
1.92 - IMPORT_C static CApaModelDoor* NewL(const CStreamStore& aStore,TStreamId aHeadStreamId,const MApaModelHeaderFactory* aFactory);
1.93 - //
1.94 + IMPORT_C static CApaModelDoor* NewL(const CStreamStore& aStore, TStreamId aHeadStreamId, const MApaModelHeaderFactory* aFactory);
1.95 +
1.96 /** Gets the application model wrapper object.
1.97
1.98 @return A pointer to the application model wrapper object. */
1.99 @@ -89,13 +75,10 @@
1.100 @param aFormat The format for the graphical representation of the embedded
1.101 document. */
1.102 inline void SetFormat(TFormat aFormat) { iFormat = aFormat; }
1.103 - //
1.104 IMPORT_C TStreamId StoreL(CStreamStore& aStore) const;
1.105 IMPORT_C void RestoreL(const CStreamStore& aStore,TStreamId aHeadStreamId,const MApaModelHeaderFactory* aFactory);
1.106 - //
1.107 IMPORT_C ~CApaModelDoor();
1.108 - //
1.109 - // from CPicture
1.110 +public: // from CPicture
1.111 IMPORT_C void DetachFromStoreL(TDetach /*aDegree*/=EDetachFull); //lint !e1735 Virtual function has default parameter - Inherited from CPicture, must be fixed there
1.112 IMPORT_C void ExternalizeL(RWriteStream& aStream)const;
1.113 IMPORT_C void Draw(CGraphicsContext& aGc,const TPoint& aTopLeft,const TRect& aClipRect,MGraphicsDeviceMap* aMap)const;
1.114 @@ -103,16 +86,13 @@
1.115 IMPORT_C void SetScaleFactor(TInt aScaleFactorWidth,TInt aScaleFactorHeight);
1.116 IMPORT_C TInt ScaleFactorWidth()const;
1.117 IMPORT_C TInt ScaleFactorHeight()const;
1.118 - //
1.119 private:
1.120 CApaModelDoor();
1.121 CApaModelDoor(CApaModelHeader* aHeader);
1.122 - //
1.123 static CStreamDictionary* ReadStreamDictionaryLC(const CStreamStore& aSourceStore,TStreamId aStreamId);
1.124 static void CopyStoreL(const CEmbeddedStore& aSourceStore,RWriteStream& aTargetStream);
1.125 void InternalizeModelL(const MApaModelHeaderFactory& aFactory);
1.126 - //
1.127 - // from CApaDoorBase
1.128 +private: // from CApaDoorBase
1.129 TSize GlassDoorSize()const;
1.130 private:
1.131 CApaModelHeader* iModelHeader;
1.132 @@ -122,7 +102,6 @@
1.133 };
1.134
1.135
1.136 -class CApaModelHeader : public CBase
1.137 // Abstract wrapper for an applications model - used for file format conversion etc
1.138 /** An interface class that acts as a wrapper for an application model.
1.139
1.140 @@ -142,6 +121,7 @@
1.141 @see CApaModelDoor
1.142 @see TApaModelDoorFactory
1.143 @see MApaModelHeaderFactory */
1.144 +class CApaModelHeader : public CBase
1.145 {
1.146 public:
1.147 /** Stores the model and its components in the specified store.
1.148 @@ -149,18 +129,18 @@
1.149 @param aStore The store in which the model's components are to be stored.
1.150 @param aDict The stream dictionary into which stream IDs and associated UIDs
1.151 are put. */
1.152 - virtual void StoreL(CStreamStore& aStore,CStreamDictionary& aDict) const=0;
1.153 + virtual void StoreL(CStreamStore& aStore, CStreamDictionary& aDict) const = 0;
1.154 /** Gets the identity of the application associated with the application model.
1.155
1.156 @return The application identity. */
1.157 - virtual TApaAppIdentifier AppId()const=0;
1.158 + virtual TApaAppIdentifier AppId() const = 0;
1.159 /** Restores the model to the specified degree.
1.160
1.161 An implementation of this function should propagate this call to all components
1.162 of the model.
1.163
1.164 @param aDegree The degree to which restoration is needed. */
1.165 - virtual void DetachFromStoreL(CPicture::TDetach aDegree)=0;
1.166 + virtual void DetachFromStoreL(CPicture::TDetach aDegree) = 0;
1.167 protected:
1.168 IMPORT_C CApaModelHeader();
1.169 private:
1.170 @@ -169,16 +149,15 @@
1.171 private:
1.172 TInt iCApaModelHeader_Reserved1;
1.173 };
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 +class MApaModelHeaderFactory
1.186 {
1.187 public:
1.188 /** Creates and returns an application model wrapper object.
1.189 @@ -188,7 +167,7 @@
1.190 @param aAppId The application's identity held as a stream in the application's
1.191 store
1.192 @return A pointer to the new application model wrapper object. */
1.193 - virtual CApaModelHeader* NewHeaderL(const CStreamStore& aStore,const CStreamDictionary& aDict,const TApaAppIdentifier& aAppId)const=0;
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: