1.1 --- a/epoc32/include/mw/apgdoor.h Wed Mar 31 12:27:01 2010 +0100
1.2 +++ b/epoc32/include/mw/apgdoor.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,87 +11,55 @@
1.16 // Contributors:
1.17 //
1.18 // Description:
1.19 +// apgdoor.h
1.20 //
1.21
1.22 #ifndef __APGDOOR_H__
1.23 #define __APGDOOR_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(__S32STD_H__)
1.32 #include <s32std.h>
1.33 -#endif
1.34 -#if !defined(__GDI_H__)
1.35 #include <gdi.h>
1.36 -#endif
1.37 -#if !defined(__APPARC_H__)
1.38 #include <apparc.h>
1.39 -#endif
1.40 -#if !defined(__APADBASE_H__)
1.41 #include <apadbase.h>
1.42 -#endif
1.43
1.44 +#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
1.45 /**
1.46 @internalAll
1.47 */
1.48 -#ifdef _UNICODE
1.49 -#define KUidApaDoorDocStream KUidApaDoorDocStream16
1.50 -#else
1.51 -#define KUidApaDoorDocStream KUidApaDoorDocStream8
1.52 -#endif
1.53 +const TUid KUidApaDoorDocStream={0x10003A35};
1.54
1.55 -/**
1.56 -@internalComponent
1.57 -@deprecated
1.58 -*/
1.59 -const TUid KUidApaDoorDocStream8={0x10000144};
1.60 +#endif //SYMBIAN_ENABLE_SPLIT_HEADERS
1.61 +// classes referenced
1.62 +class CEmbeddedStore;
1.63
1.64 -/**
1.65 -@internalComponent
1.66 -*/
1.67 -const TUid KUidApaDoorDocStream16={0x10003A35};
1.68 -
1.69 -// classes defined:
1.70 -class CApaDoor;
1.71 -class TApaPictureFactory;
1.72 -//
1.73 -// classes referenced:
1.74 -class CEmbeddedStore;
1.75 -//
1.76 -
1.77 -class CApaDoor : public CApaDoorBase
1.78 /** A wrapper for an embedded document that can be displayed in a user interface
1.79 as an icon or a glass door.
1.80
1.81 @publishedAll
1.82 @released */
1.83 +class CApaDoor : public CApaDoorBase
1.84 {
1.85 public:
1.86 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
1.87 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
1.88 IMPORT_C static CApaDoor* NewL(RFs& aFs, const CStreamStore& aStore,TStreamId aStreamId,CApaProcess& aProcess); // restoring constructor called by TApaPictureFactory
1.89 - //
1.90 +
1.91 IMPORT_C void SetFormatToIconL();
1.92 IMPORT_C void SetFormatToGlassL();
1.93 IMPORT_C void SetFormatToTemporaryIconL(TBool aEnabled=ETrue);
1.94 - //
1.95 +
1.96 IMPORT_C CApaDocument* DocumentL(TBool aCheckPassword=EFalse); // returns a pointer to the doc, restoring it if necessary. Checks password if required.
1.97 inline TDesC* Caption()const;
1.98 IMPORT_C TUid AppUidL()const;
1.99 - //
1.100 // persistence methods
1.101 IMPORT_C void RestoreL(const CStreamStore& aStore,TStreamId aHeadStreamId);
1.102 TStreamId StoreL(CStreamStore& aStore) const;
1.103 - //
1.104 +
1.105 IMPORT_C ~CApaDoor();
1.106 - //
1.107 - // from CPicture
1.108 - void Draw(CGraphicsContext& aGc,const TPoint& aTopLeft,const TRect& aClipRect,
1.109 - MGraphicsDeviceMap* aMap)const; // draws according to current iPicFormat
1.110 +public: // from CPicture
1.111 + void Draw(CGraphicsContext& aGc,const TPoint& aTopLeft,const TRect& aClipRect, MGraphicsDeviceMap* aMap)const; // draws according to current iPicFormat
1.112 void DetachFromStoreL(TDetach aDegree=EDetachFull); //lint !e1735 Virtual function has default parameter - Must use the same default as declared by CPicture
1.113 void GetOriginalSizeInTwips(TSize& aSize)const;
1.114 void SetScaleFactor(TInt aScaleFactorWidth,TInt aScaleFactorHeight);
1.115 @@ -104,9 +72,9 @@
1.116 CApaDoor(RFs& aFs, CApaProcess& aProcess);
1.117 CApaDoor(RFs& aFs, CApaDocument& aDoc,const TSize& aDefaultIconSizeInTwips);
1.118 void ConstructL();
1.119 - //
1.120 +
1.121 void SetIconSizeInTwips(TSize aSize); // for use of factory
1.122 - //
1.123 +
1.124 void StoreDocL(CPersistentStore& aStore)const;
1.125 void RestoreDocL(const CPersistentStore& aStore);
1.126 void RestoreDoorStateL(const CStreamStore& aStore,const CStreamDictionary& streamDic);
1.127 @@ -114,11 +82,11 @@
1.128 static void CopyStoreL(const CEmbeddedStore& aSourceStore,RWriteStream& aTargetStream);
1.129 void ExternalizeStateStreamL(CStreamStore& aStore,CStreamDictionary& aStreamDict)const;
1.130 void InternalizeStateStreamL(const CStreamStore& aStore,const CStreamDictionary& aStreamDict,TSize aDefaultIconSize);
1.131 - //
1.132 +
1.133 // required so CPicture's can be swizzled
1.134 void ExternalizeL(RWriteStream& aStream)const;
1.135 - // from CApaDoorBase
1.136 - virtual TSize GlassDoorSize()const;
1.137 +private: // from CApaDoorBase
1.138 + TSize GlassDoorSize()const;
1.139 TUid AppUidFromStreamL() const;
1.140 private:
1.141 RFs& iFs;
1.142 @@ -128,14 +96,12 @@
1.143 CPicture* iPicture; // the current view of the door, either iconic or glass
1.144 CEmbeddedStore* iStore; // store containing the doc
1.145 CBufSeg* iStoreHost; // the host for the embedded store, if the door has been detached from its originating store
1.146 - __MUTABLE TSize iIconSizeInTwips;
1.147 - //
1.148 + mutable TSize iIconSizeInTwips;
1.149 +private:
1.150 friend class TApaPictureFactory;
1.151 };
1.152
1.153
1.154 -class TApaPictureFactory : public MPictureFactory
1.155 -// Recognizes KUidPictureTypeDoor and creates CApaDoor pictures
1.156 /** A factory class for instantiating and restoring an application's door.
1.157
1.158 A door factory object is constructed by the UI environment and can be accessed
1.159 @@ -145,37 +111,34 @@
1.160 @released
1.161 @see CEikonEnv::PictureFactory()
1.162 @see CApaDoor */
1.163 +class TApaPictureFactory : public MPictureFactory
1.164 +// Recognizes KUidPictureTypeDoor and creates CApaDoor pictures
1.165 {
1.166 public:
1.167 IMPORT_C TApaPictureFactory(CApaProcess* aAppProcess);
1.168 inline void SetIconSize(TSize aIconSizeInTwips);
1.169 - //
1.170 - // from MPictureFactory
1.171 +public: // from MPictureFactory
1.172 IMPORT_C void NewPictureL(TPictureHeader& aPictureHeader,const CStreamStore& aPictureStore)const; // used to create CApaDoor's during document restore only
1.173 protected:
1.174 IMPORT_C TApaPictureFactory();
1.175 -
1.176 private:
1.177 CApaProcess* iApaProcess;
1.178 TSize iIconSize;
1.179 TInt iSpare;
1.180 };
1.181
1.182 -
1.183 //
1.184 // inlines
1.185 //
1.186
1.187 +/** Gets the name of the application with which the embedded document is associated.
1.188 +@return A pointer to a descriptor containing the name of the application. */
1.189 inline TDesC* CApaDoor::Caption()const
1.190 - /** Gets the name of the application with which the embedded document is associated.
1.191 -
1.192 - @return A pointer to a descriptor containing the name of the application. */
1.193 { return iAppCaption; }
1.194
1.195 +/** Sets the size of the icon.
1.196 +@param aIconSizeInTwips The size of the icon, in twips. */
1.197 inline void TApaPictureFactory::SetIconSize(TSize aIconSizeInTwips)
1.198 - /** Sets the size of the icon.
1.199 -
1.200 - @param aIconSizeInTwips The size of the icon, in twips. */
1.201 { iIconSize = aIconSizeInTwips; }
1.202
1.203 -#endif
1.204 +#endif // __APGDOOR_H__