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@4: // under the terms of "Eclipse Public License v1.0" williamr@2: // which accompanies this distribution, and is available williamr@4: // at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@4: // apadbase.h williamr@2: // williamr@2: williamr@2: #ifndef __APADBASE_H__ williamr@2: #define __APADBASE_H__ williamr@2: williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@4: // Base class for a wrapper for embedded CApaDocuments williamr@2: 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@4: class CApaDoorBase : public CPicture williamr@2: { williamr@2: public: 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@4: inline TFormat Format() const; williamr@4: inline TUid Source() const; williamr@2: inline void SetSource(TUid aSource); williamr@4: public: // from CPicture williamr@4: IMPORT_C TStreamId StoreL(CStreamStore& aStore) const; williamr@4: IMPORT_C void SetScaleFactor(TInt aScaleFactorWidth, TInt aScaleFactorHeight); williamr@4: IMPORT_C void SetCropInTwips(const TMargins& aMargins); williamr@4: IMPORT_C TPictureCapability Capability() const; williamr@4: IMPORT_C void GetCropInTwips(TMargins& aMargins) const; williamr@4: IMPORT_C TInt ScaleFactorWidth() const; williamr@4: IMPORT_C TInt ScaleFactorHeight() const; williamr@4: IMPORT_C TBool LineBreakPossible(TUint aClass, TBool aBeforePicture, TBool aHaveSpaces) const; williamr@4: IMPORT_C 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: private: williamr@2: IMPORT_C virtual void CApaDoorBase_Reserved1(); williamr@2: IMPORT_C virtual void CApaDoorBase_Reserved2(); williamr@2: protected: 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@4: 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: private: williamr@4: TInt iCApaDoorBase_Spare1; williamr@2: }; williamr@2: williamr@2: // williamr@2: // inlines williamr@2: // williamr@2: williamr@4: /** Gets the current format of the representation of the embedded document. williamr@4: williamr@4: @return The format for the representation of the embedded document. */ williamr@2: inline CApaDoorBase::TFormat CApaDoorBase::Format()const williamr@2: { return iFormat; } williamr@2: williamr@4: /** Gets the UID that identifies this door when the source originates on a non-Symbian williamr@4: OS device. williamr@4: williamr@4: This is used by converters. williamr@4: williamr@4: @return The UID for the non-Symbian OS source. For a source that originates williamr@4: on a Symbian OS phone, this is KNullUid. */ williamr@2: inline TUid CApaDoorBase::Source()const williamr@2: { return iSource; } williamr@2: williamr@4: /** Sets the UID that identifies this door when the source originates on a non-Symbian williamr@4: OS device. williamr@4: williamr@4: This is used by converters. williamr@4: williamr@4: @param aSource The UID for the non-Symbian OS source. For a source that originates williamr@4: on a Symbian OS phone, this is KNullUid. */ williamr@2: inline void CApaDoorBase::SetSource(TUid aSource) williamr@2: { iSource=aSource; } williamr@2: williamr@4: #endif // __APADBASE_H__ williamr@4: williamr@4: