2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
15 * Interface for Bio controls.
21 #ifndef MMSGBIOCONTROL_H
22 #define MMSGBIOCONTROL_H
27 #include <msgeditor.hrh> // for enums
31 /// Leave code which signals that the smart message data was invalid.
32 const TInt KErrMsgBioMessageNotValid = -90;
36 * Used by HandleBaseControlEventRequestL().
38 enum TMsgBioControlEventRequest
40 EMsgBioUpdateScrollBars
44 * These option menu flags are used with the function
45 * MMsgBioControl::OptionMenuPermissionsL().
47 enum TMsgBioOptionMenu {
48 EMsgBioReply = 0x00000001,
49 EMsgBioForward = 0x00000002,
50 EMsgBioCallBack = 0x00000004,
51 EMsgBioDelete = 0x00000008,
52 EMsgBioMessInfo = 0x00000010,
53 EMsgBioMove = 0x00000020,
54 EMsgBioCreateCC = 0x00000040,
55 EMsgBioFindItem = 0x00000080,
56 EMsgBioAddPinBoard = 0x00000100,
57 EMsgBioSend = 0x00000200,
58 EMsgBioAddRecipient = 0x00000400,
59 EMsgBioSave = 0x00000800,
60 EMsgBioEditText = 0x00001000,
61 EMsgBioInsert = 0x00002000,
62 EMsgBioSendingOpt = 0x00004000,
63 EMsgBioHelp = 0x00008000,
64 EMsgBioExit = 0x00010000,
65 EMsgBioReserved1 = 0x00020000,
66 EMsgBioReserved2 = 0x00040000,
67 EMsgBioReserved3 = 0x00080000,
68 EMsgBioReserved4 = 0x00100000,
69 EMsgBioReserved5 = 0x00200000,
70 EMsgBioReserved6 = 0x00400000,
71 EMsgBioReserved7 = 0x00800000,
72 EMsgBioReserved8 = 0x01000000
75 /// This flag is given as a construction parameter to the Bio Control.
83 // FUNCTION PROTOTYPES
85 // FORWARD DECLARATIONS
91 * Interface for handling of event request.
93 class MMsgBioBodyControl
96 virtual TBool HandleBaseControlEventRequestL(
97 TMsgBioControlEventRequest aRequest,
102 * The interface for Bio controls
109 * Calculates and sets size for a Bio control according to aSize.
110 * This function might become deprecated. The SetSizeL() function will
111 * be the replacement.
112 * The height of the Bio control may be less or more than requested by
113 * aSize, but the width must be exactly the same. If width of the Bio
114 * control is not the same as given by aSize, the width must be reset
115 * back to requested one. The aSize is set to the new size.
116 * @param aSize Size. See explanation.
118 virtual void SetAndGetSizeL(TSize& aSize) = 0;
121 * This is called by the container to allow the Bio control to add
122 * a menu item command. The command ID's should start from the value
123 * returned by the MMsgBioControlObserver::FirstFreeCommand().
124 * @param aMenuPane Reference to the applications menu which will be
127 virtual void SetMenuCommandSetL(CEikMenuPane& aMenuPane) = 0;
130 * The command handler. The Bio Control should only handle its own
131 * commands that it has set using the function SetMenuCommandSetL().
132 * @param aCommand ID of command to be handled.
133 * @return If the command is handled, it returns ETrue, and vice versa
135 virtual TBool HandleBioCommandL(TInt aCommand) = 0;
138 * Returns a rectangle slice of the bio controls viewing area.
139 * It is used by the CMsgEditorView class for scrolling the screen.
140 * The position is given relative to the bio controls top left
144 virtual TRect CurrentLineRect() const = 0;
147 * Used by the body container for managing focus and scrolling.
148 * @param aDirection The direction to be checked.
149 * @return ETrue if focus change is possible, and vice versa.
151 virtual TBool IsFocusChangePossible(
152 TMsgFocusDirection aDirection) const = 0;
155 * Returns the header text.
156 * @return The header text.
158 virtual HBufC* HeaderTextL(void) const = 0;
161 * The application can get the option menu permissions using this
163 * @return The option menu permission flags. If the flag is off it
164 * means that the option menu command is not recommended with this
167 virtual TUint32 OptionMenuPermissionsL() const = 0;
170 * Gives the height of the text in pixels.
171 * It is used by the scrolling framework.
172 * @return Height of the text in pixels.
174 virtual TInt VirtualHeight() = 0;
177 * Gives the cursor position in pixels.
178 * It is used by the scrolling framework.
179 * @return Cursor position in pixels.
181 virtual TInt VirtualVisibleTop() = 0;
184 * Tells whether the cursor is in the topmost or bottom position.
185 * It is used by the scrolling framework.
186 * @param aLocation Specifies either top or bottom.
187 * @return ETrue if the cursor is in the part specified by aLocation.
189 virtual TBool IsCursorLocation(TMsgCursorLocation aLocation) const = 0;
193 #endif // MMSGBIOCONTROL_H