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