Attempt to represent the S^2->S^3 header reorganisation as a series of "hg rename" operations
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
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
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 #if !defined(__E32STD_H__)
22 #if !defined(__E32BASE_H__)
25 #if !defined(__S32STD_H__)
28 #if !defined(__GDI_H__)
31 #if !defined(__APPARC_H__)
34 #if !defined(__APADBASE_H__)
42 #define KUidApaDoorDocStream KUidApaDoorDocStream16
44 #define KUidApaDoorDocStream KUidApaDoorDocStream8
51 const TUid KUidApaDoorDocStream8={0x10000144};
56 const TUid KUidApaDoorDocStream16={0x10003A35};
60 class TApaPictureFactory;
62 // classes referenced:
66 class CApaDoor : public CApaDoorBase
67 /** A wrapper for an embedded document that can be displayed in a user interface
68 as an icon or a glass door.
74 IMPORT_C static CApaDoor* NewLC(RFs& aFs, CApaDocument& aDoc,const TSize& aDefaultIconSizeInTwips); // call to create a new door in iconic format - restoration is achieved with TApaPictureFactory
75 IMPORT_C static CApaDoor* NewL(RFs& aFs, CApaDocument& aDoc,const TSize& aDefaultIconSizeInTwips); // call to create a new door in iconic format - restoration is achieved with TApaPictureFactory
76 IMPORT_C static CApaDoor* NewL(RFs& aFs, const CStreamStore& aStore,TStreamId aStreamId,CApaProcess& aProcess); // restoring constructor called by TApaPictureFactory
78 IMPORT_C void SetFormatToIconL();
79 IMPORT_C void SetFormatToGlassL();
80 IMPORT_C void SetFormatToTemporaryIconL(TBool aEnabled=ETrue);
82 IMPORT_C CApaDocument* DocumentL(TBool aCheckPassword=EFalse); // returns a pointer to the doc, restoring it if necessary. Checks password if required.
83 inline TDesC* Caption()const;
84 IMPORT_C TUid AppUidL()const;
86 // persistence methods
87 IMPORT_C void RestoreL(const CStreamStore& aStore,TStreamId aHeadStreamId);
88 TStreamId StoreL(CStreamStore& aStore) const;
93 void Draw(CGraphicsContext& aGc,const TPoint& aTopLeft,const TRect& aClipRect,
94 MGraphicsDeviceMap* aMap)const; // draws according to current iPicFormat
95 void DetachFromStoreL(TDetach aDegree=EDetachFull); //lint !e1735 Virtual function has default parameter - Must use the same default as declared by CPicture
96 void GetOriginalSizeInTwips(TSize& aSize)const;
97 void SetScaleFactor(TInt aScaleFactorWidth,TInt aScaleFactorHeight);
98 void SetCropInTwips(const TMargins& aMargins);
99 TPictureCapability Capability() const;
100 void GetCropInTwips(TMargins& aMargins) const;
101 TInt ScaleFactorWidth() const;
102 TInt ScaleFactorHeight() const;
104 CApaDoor(RFs& aFs, CApaProcess& aProcess);
105 CApaDoor(RFs& aFs, CApaDocument& aDoc,const TSize& aDefaultIconSizeInTwips);
108 void SetIconSizeInTwips(TSize aSize); // for use of factory
110 void StoreDocL(CPersistentStore& aStore)const;
111 void RestoreDocL(const CPersistentStore& aStore);
112 void RestoreDoorStateL(const CStreamStore& aStore,const CStreamDictionary& streamDic);
113 static CStreamDictionary* ReadStreamDictionaryLC(const CStreamStore& aStore,TStreamId aStreamId);
114 static void CopyStoreL(const CEmbeddedStore& aSourceStore,RWriteStream& aTargetStream);
115 void ExternalizeStateStreamL(CStreamStore& aStore,CStreamDictionary& aStreamDict)const;
116 void InternalizeStateStreamL(const CStreamStore& aStore,const CStreamDictionary& aStreamDict,TSize aDefaultIconSize);
118 // required so CPicture's can be swizzled
119 void ExternalizeL(RWriteStream& aStream)const;
121 virtual TSize GlassDoorSize()const;
122 TUid AppUidFromStreamL() const;
125 HBufC* iAppCaption; // name of the app used to create the embedded object
126 CApaProcess* iApaProcess;
127 CApaDocument* iApaDoc;
128 CPicture* iPicture; // the current view of the door, either iconic or glass
129 CEmbeddedStore* iStore; // store containing the doc
130 CBufSeg* iStoreHost; // the host for the embedded store, if the door has been detached from its originating store
131 __MUTABLE TSize iIconSizeInTwips;
133 friend class TApaPictureFactory;
137 class TApaPictureFactory : public MPictureFactory
138 // Recognizes KUidPictureTypeDoor and creates CApaDoor pictures
139 /** A factory class for instantiating and restoring an application's door.
141 A door factory object is constructed by the UI environment and can be accessed
142 by calling CEikonEnv::PictureFactory().
146 @see CEikonEnv::PictureFactory()
150 IMPORT_C TApaPictureFactory(CApaProcess* aAppProcess);
151 inline void SetIconSize(TSize aIconSizeInTwips);
153 // from MPictureFactory
154 IMPORT_C void NewPictureL(TPictureHeader& aPictureHeader,const CStreamStore& aPictureStore)const; // used to create CApaDoor's during document restore only
156 IMPORT_C TApaPictureFactory();
159 CApaProcess* iApaProcess;
169 inline TDesC* CApaDoor::Caption()const
170 /** Gets the name of the application with which the embedded document is associated.
172 @return A pointer to a descriptor containing the name of the application. */
173 { return iAppCaption; }
175 inline void TApaPictureFactory::SetIconSize(TSize aIconSizeInTwips)
176 /** Sets the size of the icon.
178 @param aIconSizeInTwips The size of the icon, in twips. */
179 { iIconSize = aIconSizeInTwips; }