williamr@2: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // 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 williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: #ifndef __APADBASE_H__ williamr@2: #define __APADBASE_H__ williamr@2: williamr@2: #if !defined(__E32STD_H__) williamr@2: #include williamr@2: #endif williamr@2: #if !defined(__S32STD_H__) williamr@2: #include williamr@2: #endif williamr@2: #if !defined(__GDI_H__) williamr@2: #include williamr@2: #endif williamr@2: williamr@2: williamr@2: class CApaDoorBase : public CPicture williamr@2: // Base class for a wrapper for embedded CApaDocuments williamr@2: /** The base class for the graphic representation of an embedded document. williamr@2: williamr@2: An embedded document can be represented either as an icon or as a glass picture. williamr@2: Such a graphic representation is known as a door. williamr@2: williamr@2: The class is intended for derivation. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: @see CApaDoor williamr@2: @see CApaModelDoor */ williamr@2: { williamr@2: public: williamr@2: williamr@2: /** Defines the possible formats for the graphical representation of the embedded williamr@2: document. */ williamr@2: enum TFormat { williamr@2: /** The representation is an icon. */ williamr@2: EIconic, williamr@2: /** The representation is a glass door. */ williamr@2: EGlassDoor, williamr@2: /** The representation is a glass door but has been temporarily switched to an icon. */ williamr@2: ETemporarilyIconic williamr@2: }; williamr@2: public: williamr@2: inline TFormat Format()const; williamr@2: inline TUid Source()const; williamr@2: inline void SetSource(TUid aSource); williamr@2: // Virtuals from CPicture williamr@2: IMPORT_C virtual TStreamId StoreL(CStreamStore& aStore) const; williamr@2: IMPORT_C virtual void SetScaleFactor(TInt aScaleFactorWidth,TInt aScaleFactorHeight); williamr@2: IMPORT_C virtual void SetCropInTwips(const TMargins& aMargins); williamr@2: IMPORT_C virtual TPictureCapability Capability() const; williamr@2: IMPORT_C virtual void GetCropInTwips(TMargins& aMargins) const; williamr@2: IMPORT_C virtual TInt ScaleFactorWidth() const; williamr@2: IMPORT_C virtual TInt ScaleFactorHeight() const; williamr@2: IMPORT_C virtual TBool LineBreakPossible(TUint aClass,TBool aBeforePicture,TBool aHaveSpaces) const; williamr@2: IMPORT_C virtual TBool NativePixelSize(TSize& aPixelSize); williamr@2: protected: williamr@2: IMPORT_C CApaDoorBase(); williamr@2: IMPORT_C void ExternalizeBaseStreamL(CStreamStore& aStore,CStreamDictionary& aStreamDict)const; williamr@2: IMPORT_C TSize InternalizeBaseStreamL(const CStreamStore& aStore,const CStreamDictionary& aStreamDict); // returns current size in twips williamr@2: williamr@2: private: williamr@2: IMPORT_C virtual void CApaDoorBase_Reserved1(); williamr@2: IMPORT_C virtual void CApaDoorBase_Reserved2(); williamr@2: protected: williamr@2: williamr@2: /** Returns the size of the glass door, in twips. williamr@2: williamr@2: A concrete implementation of this function is provided by derived classes. williamr@2: williamr@2: @return The size of the glass door, in twips. williamr@2: williamr@2: @publishedAll williamr@2: @released */ williamr@2: virtual TSize GlassDoorSize()const=0; williamr@2: protected: williamr@2: TFormat iFormat; williamr@2: TUid iSource; // foreign representation of a translated door (eg MS Word doc) williamr@2: williamr@2: private: williamr@2: TInt iCApaDoorBase_Reserved1; williamr@2: }; williamr@2: williamr@2: // williamr@2: // inlines williamr@2: // williamr@2: williamr@2: inline CApaDoorBase::TFormat CApaDoorBase::Format()const williamr@2: /** Gets the current format of the representation of the embedded document. williamr@2: williamr@2: @return The format for the representation of the embedded document. */ williamr@2: { return iFormat; } williamr@2: williamr@2: inline TUid CApaDoorBase::Source()const williamr@2: /** Gets the UID that identifies this door when the source originates on a non-Symbian williamr@2: OS device. williamr@2: williamr@2: This is used by converters. williamr@2: williamr@2: @return The UID for the non-Symbian OS source. For a source that originates williamr@2: on a Symbian OS phone, this is KNullUid. */ williamr@2: { return iSource; } williamr@2: williamr@2: inline void CApaDoorBase::SetSource(TUid aSource) williamr@2: /** Sets the UID that identifies this door when the source originates on a non-Symbian williamr@2: OS device. williamr@2: williamr@2: This is used by converters. williamr@2: williamr@2: @param aSource The UID for the non-Symbian OS source. For a source that originates williamr@2: on a Symbian OS phone, this is KNullUid. */ williamr@2: { iSource=aSource; } williamr@2: williamr@2: #endif