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