localisation/apparchitecture/inc/APADBASE.H
branchSymbian2
changeset 1 8758140453c0
child 6 c108117318cb
equal deleted inserted replaced
0:e8c1ea2c6496 1:8758140453c0
       
     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"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __APADBASE_H__
       
    17 #define __APADBASE_H__
       
    18 
       
    19 #if !defined(__E32STD_H__)
       
    20 #include <e32std.h>
       
    21 #endif
       
    22 #if !defined(__S32STD_H__)
       
    23 #include <s32std.h>
       
    24 #endif
       
    25 #if !defined(__GDI_H__)
       
    26 #include <gdi.h>
       
    27 #endif
       
    28 
       
    29 
       
    30 class CApaDoorBase : public CPicture
       
    31 // Base class for a wrapper for embedded CApaDocuments
       
    32 /** The base class for the graphic representation of an embedded document.
       
    33 
       
    34 An embedded document can be represented either as an icon or as a glass picture. 
       
    35 Such a graphic representation is known as a door.
       
    36 
       
    37 The class is intended for derivation.
       
    38 
       
    39 @publishedAll 
       
    40 @released
       
    41 @see CApaDoor
       
    42 @see CApaModelDoor */
       
    43 	{
       
    44 public:
       
    45 	
       
    46 	/** Defines the possible formats for the graphical representation of the embedded 
       
    47 	document. */
       
    48 	enum TFormat {
       
    49 		/** The representation is an icon. */
       
    50 		EIconic,
       
    51 		/** The representation is a glass door. */
       
    52 		EGlassDoor,
       
    53 		/** The representation is a glass door but has been temporarily switched to an icon. */
       
    54 		ETemporarilyIconic
       
    55 		};
       
    56 public:
       
    57 	inline TFormat Format()const;
       
    58 	inline TUid Source()const;
       
    59 	inline void SetSource(TUid aSource);
       
    60 	// Virtuals from CPicture
       
    61 	IMPORT_C virtual TStreamId StoreL(CStreamStore& aStore) const;
       
    62 	IMPORT_C virtual void SetScaleFactor(TInt aScaleFactorWidth,TInt aScaleFactorHeight); 
       
    63 	IMPORT_C virtual void SetCropInTwips(const TMargins& aMargins); 
       
    64 	IMPORT_C virtual TPictureCapability Capability() const;
       
    65 	IMPORT_C virtual void GetCropInTwips(TMargins& aMargins) const; 
       
    66 	IMPORT_C virtual TInt ScaleFactorWidth() const; 
       
    67 	IMPORT_C virtual TInt ScaleFactorHeight() const; 
       
    68 	IMPORT_C virtual TBool LineBreakPossible(TUint aClass,TBool aBeforePicture,TBool aHaveSpaces) const;
       
    69 	IMPORT_C virtual TBool NativePixelSize(TSize& aPixelSize);
       
    70 protected:
       
    71 	IMPORT_C CApaDoorBase();
       
    72 	IMPORT_C void ExternalizeBaseStreamL(CStreamStore& aStore,CStreamDictionary& aStreamDict)const;
       
    73 	IMPORT_C TSize InternalizeBaseStreamL(const CStreamStore& aStore,const CStreamDictionary& aStreamDict); // returns current size in twips
       
    74 
       
    75 private:
       
    76 	IMPORT_C virtual void CApaDoorBase_Reserved1();
       
    77 	IMPORT_C virtual void CApaDoorBase_Reserved2();
       
    78 protected:
       
    79 
       
    80 	/** Returns the size of the glass door, in twips.
       
    81 	
       
    82 	A concrete implementation of this function is provided by derived classes.
       
    83 	
       
    84 	@return The size of the glass door, in twips. 
       
    85 	
       
    86 	@publishedAll 
       
    87 	@released */
       
    88 	virtual TSize GlassDoorSize()const=0;
       
    89 protected:
       
    90 	TFormat iFormat;
       
    91 	TUid iSource; // foreign representation of a translated door (eg MS Word doc)
       
    92 
       
    93 private:
       
    94 	TInt iCApaDoorBase_Reserved1;
       
    95 	};
       
    96 
       
    97 //
       
    98 // inlines
       
    99 //
       
   100 
       
   101 inline CApaDoorBase::TFormat CApaDoorBase::Format()const
       
   102 	/** Gets the current format of the representation of the embedded document.
       
   103 	
       
   104 	@return The format for the representation of the embedded document. */
       
   105 	{ return iFormat; }
       
   106 
       
   107 inline TUid CApaDoorBase::Source()const
       
   108 	/** Gets the UID that identifies this door when the source originates on a non-Symbian 
       
   109 	OS device.
       
   110 	
       
   111 	This is used by converters.
       
   112 	
       
   113 	@return The UID for the non-Symbian OS source. For a source that originates 
       
   114 	on a Symbian OS phone, this is KNullUid. */
       
   115 	{ return iSource; }
       
   116 
       
   117 inline void CApaDoorBase::SetSource(TUid aSource)
       
   118 	/** Sets the UID that identifies this door when the source originates on a non-Symbian 
       
   119 	OS device.
       
   120 	
       
   121 	This is used by converters.
       
   122 	
       
   123 	@param aSource The UID for the non-Symbian OS source. For a source that originates 
       
   124 	on a Symbian OS phone, this is KNullUid. */
       
   125 	{ iSource=aSource; }
       
   126 
       
   127 #endif