epoc32/include/mw/apadbase.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 3 e1b950c65cb4
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     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".
     7 //
     8 // Initial Contributors:
     9 // Nokia Corporation - initial contribution.
    10 //
    11 // Contributors:
    12 //
    13 // Description:
    14 // apadbase.h
    15 //
    16 
    17 #ifndef __APADBASE_H__
    18 #define __APADBASE_H__
    19 
    20 #include <e32std.h>
    21 #include <s32std.h>
    22 #include <gdi.h>
    23 
    24 // Base class for a wrapper for embedded CApaDocuments
    25 
    26 /** The base class for the graphic representation of an embedded document.
    27 
    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.
    30 
    31 The class is intended for derivation.
    32 
    33 @publishedAll 
    34 @released
    35 @see CApaDoor
    36 @see CApaModelDoor */
    37 class CApaDoorBase : public CPicture
    38 	{
    39 public:
    40 	/** Defines the possible formats for the graphical representation of the embedded 
    41 	document. */
    42 	enum TFormat {
    43 		/** The representation is an icon. */
    44 		EIconic,
    45 		/** The representation is a glass door. */
    46 		EGlassDoor,
    47 		/** The representation is a glass door but has been temporarily switched to an icon. */
    48 		ETemporarilyIconic
    49 		};
    50 public:
    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);
    64 protected:
    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
    68 private:
    69 	IMPORT_C virtual void CApaDoorBase_Reserved1();
    70 	IMPORT_C virtual void CApaDoorBase_Reserved2();
    71 protected:
    72 	/** Returns the size of the glass door, in twips.
    73 	
    74 	A concrete implementation of this function is provided by derived classes.
    75 	
    76 	@return The size of the glass door, in twips. 
    77 	
    78 	@publishedAll 
    79 	@released */
    80 	virtual TSize GlassDoorSize() const = 0;
    81 protected:
    82 	TFormat iFormat;
    83 	TUid iSource; // foreign representation of a translated door (eg MS Word doc)
    84 private:
    85 	TInt iCApaDoorBase_Spare1;
    86 	};
    87 
    88 //
    89 // inlines
    90 //
    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. */
    95 inline CApaDoorBase::TFormat CApaDoorBase::Format()const
    96 	{ return iFormat; }
    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. */
   105 inline TUid CApaDoorBase::Source()const
   106 	{ return iSource; }
   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. */
   115 inline void CApaDoorBase::SetSource(TUid aSource)
   116 	{ iSource=aSource; }
   117 
   118 #endif	// __APADBASE_H__
   119 
   120