williamr@2
|
1 |
/*
|
williamr@2
|
2 |
* Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
3 |
* All rights reserved.
|
williamr@2
|
4 |
* This component and the accompanying materials are made available
|
williamr@4
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
6 |
* which accompanies this distribution, and is available
|
williamr@4
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
8 |
*
|
williamr@2
|
9 |
* Initial Contributors:
|
williamr@2
|
10 |
* Nokia Corporation - initial contribution.
|
williamr@2
|
11 |
*
|
williamr@2
|
12 |
* Contributors:
|
williamr@2
|
13 |
*
|
williamr@2
|
14 |
* Description:
|
williamr@2
|
15 |
* Interface for Bio controls.
|
williamr@2
|
16 |
*
|
williamr@2
|
17 |
*/
|
williamr@2
|
18 |
|
williamr@2
|
19 |
|
williamr@2
|
20 |
|
williamr@2
|
21 |
#ifndef MMSGBIOCONTROL_H
|
williamr@2
|
22 |
#define MMSGBIOCONTROL_H
|
williamr@2
|
23 |
|
williamr@2
|
24 |
// INCLUDES
|
williamr@2
|
25 |
#include <e32std.h>
|
williamr@2
|
26 |
#include <e32base.h>
|
williamr@2
|
27 |
#include <msgeditor.hrh> // for enums
|
williamr@2
|
28 |
|
williamr@2
|
29 |
// CONSTANTS
|
williamr@2
|
30 |
|
williamr@2
|
31 |
/// Leave code which signals that the smart message data was invalid.
|
williamr@2
|
32 |
const TInt KErrMsgBioMessageNotValid = -90;
|
williamr@2
|
33 |
|
williamr@2
|
34 |
|
williamr@2
|
35 |
/**
|
williamr@2
|
36 |
* Used by HandleBaseControlEventRequestL().
|
williamr@2
|
37 |
*/
|
williamr@2
|
38 |
enum TMsgBioControlEventRequest
|
williamr@2
|
39 |
{
|
williamr@2
|
40 |
EMsgBioUpdateScrollBars
|
williamr@2
|
41 |
};
|
williamr@2
|
42 |
|
williamr@2
|
43 |
/**
|
williamr@2
|
44 |
* These option menu flags are used with the function
|
williamr@2
|
45 |
* MMsgBioControl::OptionMenuPermissionsL().
|
williamr@2
|
46 |
*/
|
williamr@2
|
47 |
enum TMsgBioOptionMenu {
|
williamr@2
|
48 |
EMsgBioReply = 0x00000001,
|
williamr@2
|
49 |
EMsgBioForward = 0x00000002,
|
williamr@2
|
50 |
EMsgBioCallBack = 0x00000004,
|
williamr@2
|
51 |
EMsgBioDelete = 0x00000008,
|
williamr@2
|
52 |
EMsgBioMessInfo = 0x00000010,
|
williamr@2
|
53 |
EMsgBioMove = 0x00000020,
|
williamr@2
|
54 |
EMsgBioCreateCC = 0x00000040,
|
williamr@2
|
55 |
EMsgBioFindItem = 0x00000080,
|
williamr@2
|
56 |
EMsgBioAddPinBoard = 0x00000100,
|
williamr@2
|
57 |
EMsgBioSend = 0x00000200,
|
williamr@2
|
58 |
EMsgBioAddRecipient = 0x00000400,
|
williamr@2
|
59 |
EMsgBioSave = 0x00000800,
|
williamr@2
|
60 |
EMsgBioEditText = 0x00001000,
|
williamr@2
|
61 |
EMsgBioInsert = 0x00002000,
|
williamr@2
|
62 |
EMsgBioSendingOpt = 0x00004000,
|
williamr@2
|
63 |
EMsgBioHelp = 0x00008000,
|
williamr@2
|
64 |
EMsgBioExit = 0x00010000,
|
williamr@2
|
65 |
EMsgBioReserved1 = 0x00020000,
|
williamr@2
|
66 |
EMsgBioReserved2 = 0x00040000,
|
williamr@2
|
67 |
EMsgBioReserved3 = 0x00080000,
|
williamr@2
|
68 |
EMsgBioReserved4 = 0x00100000,
|
williamr@2
|
69 |
EMsgBioReserved5 = 0x00200000,
|
williamr@2
|
70 |
EMsgBioReserved6 = 0x00400000,
|
williamr@2
|
71 |
EMsgBioReserved7 = 0x00800000,
|
williamr@2
|
72 |
EMsgBioReserved8 = 0x01000000
|
williamr@2
|
73 |
};
|
williamr@2
|
74 |
|
williamr@2
|
75 |
/// This flag is given as a construction parameter to the Bio Control.
|
williamr@2
|
76 |
enum TMsgBioMode {
|
williamr@2
|
77 |
EMsgBioEditorMode,
|
williamr@2
|
78 |
EMsgBioViewerMode
|
williamr@2
|
79 |
};
|
williamr@2
|
80 |
|
williamr@2
|
81 |
// MACROS
|
williamr@2
|
82 |
// DATA TYPES
|
williamr@2
|
83 |
// FUNCTION PROTOTYPES
|
williamr@2
|
84 |
|
williamr@2
|
85 |
// FORWARD DECLARATIONS
|
williamr@2
|
86 |
class CEikMenuPane;
|
williamr@2
|
87 |
|
williamr@2
|
88 |
// CLASS DECLARATION
|
williamr@2
|
89 |
|
williamr@2
|
90 |
/**
|
williamr@2
|
91 |
* Interface for handling of event request.
|
williamr@2
|
92 |
*/
|
williamr@2
|
93 |
class MMsgBioBodyControl
|
williamr@2
|
94 |
{
|
williamr@2
|
95 |
public:
|
williamr@2
|
96 |
virtual TBool HandleBaseControlEventRequestL(
|
williamr@2
|
97 |
TMsgBioControlEventRequest aRequest,
|
williamr@2
|
98 |
TInt aDelta = 0) = 0;
|
williamr@2
|
99 |
};
|
williamr@2
|
100 |
|
williamr@2
|
101 |
/**
|
williamr@2
|
102 |
* The interface for Bio controls
|
williamr@2
|
103 |
*/
|
williamr@2
|
104 |
class MMsgBioControl
|
williamr@2
|
105 |
{
|
williamr@2
|
106 |
public:
|
williamr@2
|
107 |
|
williamr@2
|
108 |
/**
|
williamr@2
|
109 |
* Calculates and sets size for a Bio control according to aSize.
|
williamr@2
|
110 |
* This function might become deprecated. The SetSizeL() function will
|
williamr@2
|
111 |
* be the replacement.
|
williamr@2
|
112 |
* The height of the Bio control may be less or more than requested by
|
williamr@2
|
113 |
* aSize, but the width must be exactly the same. If width of the Bio
|
williamr@2
|
114 |
* control is not the same as given by aSize, the width must be reset
|
williamr@2
|
115 |
* back to requested one. The aSize is set to the new size.
|
williamr@2
|
116 |
* @param aSize Size. See explanation.
|
williamr@2
|
117 |
*/
|
williamr@2
|
118 |
virtual void SetAndGetSizeL(TSize& aSize) = 0;
|
williamr@2
|
119 |
|
williamr@2
|
120 |
/**
|
williamr@2
|
121 |
* This is called by the container to allow the Bio control to add
|
williamr@2
|
122 |
* a menu item command. The command ID's should start from the value
|
williamr@2
|
123 |
* returned by the MMsgBioControlObserver::FirstFreeCommand().
|
williamr@2
|
124 |
* @param aMenuPane Reference to the applications menu which will be
|
williamr@2
|
125 |
* modified.
|
williamr@2
|
126 |
*/
|
williamr@2
|
127 |
virtual void SetMenuCommandSetL(CEikMenuPane& aMenuPane) = 0;
|
williamr@2
|
128 |
|
williamr@2
|
129 |
/**
|
williamr@2
|
130 |
* The command handler. The Bio Control should only handle its own
|
williamr@2
|
131 |
* commands that it has set using the function SetMenuCommandSetL().
|
williamr@2
|
132 |
* @param aCommand ID of command to be handled.
|
williamr@2
|
133 |
* @return If the command is handled, it returns ETrue, and vice versa
|
williamr@2
|
134 |
*/
|
williamr@2
|
135 |
virtual TBool HandleBioCommandL(TInt aCommand) = 0;
|
williamr@2
|
136 |
|
williamr@2
|
137 |
/**
|
williamr@2
|
138 |
* Returns a rectangle slice of the bio controls viewing area.
|
williamr@2
|
139 |
* It is used by the CMsgEditorView class for scrolling the screen.
|
williamr@2
|
140 |
* The position is given relative to the bio controls top left
|
williamr@2
|
141 |
* corner.
|
williamr@2
|
142 |
* @return TRect
|
williamr@2
|
143 |
*/
|
williamr@2
|
144 |
virtual TRect CurrentLineRect() const = 0;
|
williamr@2
|
145 |
|
williamr@2
|
146 |
/**
|
williamr@2
|
147 |
* Used by the body container for managing focus and scrolling.
|
williamr@2
|
148 |
* @param aDirection The direction to be checked.
|
williamr@2
|
149 |
* @return ETrue if focus change is possible, and vice versa.
|
williamr@2
|
150 |
*/
|
williamr@2
|
151 |
virtual TBool IsFocusChangePossible(
|
williamr@2
|
152 |
TMsgFocusDirection aDirection) const = 0;
|
williamr@2
|
153 |
|
williamr@2
|
154 |
/**
|
williamr@2
|
155 |
* Returns the header text.
|
williamr@2
|
156 |
* @return The header text.
|
williamr@2
|
157 |
*/
|
williamr@2
|
158 |
virtual HBufC* HeaderTextL(void) const = 0;
|
williamr@2
|
159 |
|
williamr@2
|
160 |
/**
|
williamr@2
|
161 |
* The application can get the option menu permissions using this
|
williamr@2
|
162 |
* function.
|
williamr@2
|
163 |
* @return The option menu permission flags. If the flag is off it
|
williamr@2
|
164 |
* means that the option menu command is not recommended with this
|
williamr@2
|
165 |
* Bio Control.
|
williamr@2
|
166 |
*/
|
williamr@2
|
167 |
virtual TUint32 OptionMenuPermissionsL() const = 0;
|
williamr@2
|
168 |
|
williamr@2
|
169 |
/**
|
williamr@2
|
170 |
* Gives the height of the text in pixels.
|
williamr@2
|
171 |
* It is used by the scrolling framework.
|
williamr@2
|
172 |
* @return Height of the text in pixels.
|
williamr@2
|
173 |
*/
|
williamr@2
|
174 |
virtual TInt VirtualHeight() = 0;
|
williamr@2
|
175 |
|
williamr@2
|
176 |
/**
|
williamr@2
|
177 |
* Gives the cursor position in pixels.
|
williamr@2
|
178 |
* It is used by the scrolling framework.
|
williamr@2
|
179 |
* @return Cursor position in pixels.
|
williamr@2
|
180 |
*/
|
williamr@2
|
181 |
virtual TInt VirtualVisibleTop() = 0;
|
williamr@2
|
182 |
|
williamr@2
|
183 |
/**
|
williamr@2
|
184 |
* Tells whether the cursor is in the topmost or bottom position.
|
williamr@2
|
185 |
* It is used by the scrolling framework.
|
williamr@2
|
186 |
* @param aLocation Specifies either top or bottom.
|
williamr@2
|
187 |
* @return ETrue if the cursor is in the part specified by aLocation.
|
williamr@2
|
188 |
*/
|
williamr@2
|
189 |
virtual TBool IsCursorLocation(TMsgCursorLocation aLocation) const = 0;
|
williamr@2
|
190 |
|
williamr@2
|
191 |
};
|
williamr@2
|
192 |
|
williamr@2
|
193 |
#endif // MMSGBIOCONTROL_H
|
williamr@2
|
194 |
|
williamr@2
|
195 |
// end of file
|