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