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 "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
17 #ifndef __APADBASE_H__
18 #define __APADBASE_H__
24 // Base class for a wrapper for embedded CApaDocuments
26 /** The base class for the graphic representation of an embedded document.
28 An embedded document can be represented either as an icon or as a glass picture.
29 Such a graphic representation is known as a door.
31 The class is intended for derivation.
37 class CApaDoorBase : public CPicture
40 /** Defines the possible formats for the graphical representation of the embedded
43 /** The representation is an icon. */
45 /** The representation is a glass door. */
47 /** The representation is a glass door but has been temporarily switched to an icon. */
51 inline TFormat Format() const;
52 inline TUid Source() const;
53 inline void SetSource(TUid aSource);
54 public: // from CPicture
55 IMPORT_C TStreamId StoreL(CStreamStore& aStore) const;
56 IMPORT_C void SetScaleFactor(TInt aScaleFactorWidth, TInt aScaleFactorHeight);
57 IMPORT_C void SetCropInTwips(const TMargins& aMargins);
58 IMPORT_C TPictureCapability Capability() const;
59 IMPORT_C void GetCropInTwips(TMargins& aMargins) const;
60 IMPORT_C TInt ScaleFactorWidth() const;
61 IMPORT_C TInt ScaleFactorHeight() const;
62 IMPORT_C TBool LineBreakPossible(TUint aClass, TBool aBeforePicture, TBool aHaveSpaces) const;
63 IMPORT_C TBool NativePixelSize(TSize& aPixelSize);
65 IMPORT_C CApaDoorBase();
66 IMPORT_C void ExternalizeBaseStreamL(CStreamStore& aStore,CStreamDictionary& aStreamDict)const;
67 IMPORT_C TSize InternalizeBaseStreamL(const CStreamStore& aStore,const CStreamDictionary& aStreamDict); // returns current size in twips
69 IMPORT_C virtual void CApaDoorBase_Reserved1();
70 IMPORT_C virtual void CApaDoorBase_Reserved2();
72 /** Returns the size of the glass door, in twips.
74 A concrete implementation of this function is provided by derived classes.
76 @return The size of the glass door, in twips.
80 virtual TSize GlassDoorSize() const = 0;
83 TUid iSource; // foreign representation of a translated door (eg MS Word doc)
85 TInt iCApaDoorBase_Spare1;
92 /** Gets the current format of the representation of the embedded document.
94 @return The format for the representation of the embedded document. */
95 inline CApaDoorBase::TFormat CApaDoorBase::Format()const
98 /** Gets the UID that identifies this door when the source originates on a non-Symbian
101 This is used by converters.
103 @return The UID for the non-Symbian OS source. For a source that originates
104 on a Symbian OS phone, this is KNullUid. */
105 inline TUid CApaDoorBase::Source()const
108 /** Sets the UID that identifies this door when the source originates on a non-Symbian
111 This is used by converters.
113 @param aSource The UID for the non-Symbian OS source. For a source that originates
114 on a Symbian OS phone, this is KNullUid. */
115 inline void CApaDoorBase::SetSource(TUid aSource)
118 #endif // __APADBASE_H__