williamr@2: /* williamr@2: * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * 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: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: williamr@2: * Interface for Bio controls. williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: williamr@2: #ifndef MMSGBIOCONTROL_H williamr@2: #define MMSGBIOCONTROL_H williamr@2: williamr@2: // INCLUDES williamr@2: #include williamr@2: #include williamr@2: #include // for enums williamr@2: williamr@2: // CONSTANTS williamr@2: williamr@2: /// Leave code which signals that the smart message data was invalid. williamr@2: const TInt KErrMsgBioMessageNotValid = -90; williamr@2: williamr@2: williamr@2: /** williamr@2: * Used by HandleBaseControlEventRequestL(). williamr@2: */ williamr@2: enum TMsgBioControlEventRequest williamr@2: { williamr@2: EMsgBioUpdateScrollBars williamr@2: }; williamr@2: williamr@2: /** williamr@2: * These option menu flags are used with the function williamr@2: * MMsgBioControl::OptionMenuPermissionsL(). williamr@2: */ williamr@2: enum TMsgBioOptionMenu { williamr@2: EMsgBioReply = 0x00000001, williamr@2: EMsgBioForward = 0x00000002, williamr@2: EMsgBioCallBack = 0x00000004, williamr@2: EMsgBioDelete = 0x00000008, williamr@2: EMsgBioMessInfo = 0x00000010, williamr@2: EMsgBioMove = 0x00000020, williamr@2: EMsgBioCreateCC = 0x00000040, williamr@2: EMsgBioFindItem = 0x00000080, williamr@2: EMsgBioAddPinBoard = 0x00000100, williamr@2: EMsgBioSend = 0x00000200, williamr@2: EMsgBioAddRecipient = 0x00000400, williamr@2: EMsgBioSave = 0x00000800, williamr@2: EMsgBioEditText = 0x00001000, williamr@2: EMsgBioInsert = 0x00002000, williamr@2: EMsgBioSendingOpt = 0x00004000, williamr@2: EMsgBioHelp = 0x00008000, williamr@2: EMsgBioExit = 0x00010000, williamr@2: EMsgBioReserved1 = 0x00020000, williamr@2: EMsgBioReserved2 = 0x00040000, williamr@2: EMsgBioReserved3 = 0x00080000, williamr@2: EMsgBioReserved4 = 0x00100000, williamr@2: EMsgBioReserved5 = 0x00200000, williamr@2: EMsgBioReserved6 = 0x00400000, williamr@2: EMsgBioReserved7 = 0x00800000, williamr@2: EMsgBioReserved8 = 0x01000000 williamr@2: }; williamr@2: williamr@2: /// This flag is given as a construction parameter to the Bio Control. williamr@2: enum TMsgBioMode { williamr@2: EMsgBioEditorMode, williamr@2: EMsgBioViewerMode williamr@2: }; williamr@2: williamr@2: // MACROS williamr@2: // DATA TYPES williamr@2: // FUNCTION PROTOTYPES williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class CEikMenuPane; williamr@2: williamr@2: // CLASS DECLARATION williamr@2: williamr@2: /** williamr@2: * Interface for handling of event request. williamr@2: */ williamr@2: class MMsgBioBodyControl williamr@2: { williamr@2: public: williamr@2: virtual TBool HandleBaseControlEventRequestL( williamr@2: TMsgBioControlEventRequest aRequest, williamr@2: TInt aDelta = 0) = 0; williamr@2: }; williamr@2: williamr@2: /** williamr@2: * The interface for Bio controls williamr@2: */ williamr@2: class MMsgBioControl williamr@2: { williamr@2: public: williamr@2: williamr@2: /** williamr@2: * Calculates and sets size for a Bio control according to aSize. williamr@2: * This function might become deprecated. The SetSizeL() function will williamr@2: * be the replacement. williamr@2: * The height of the Bio control may be less or more than requested by williamr@2: * aSize, but the width must be exactly the same. If width of the Bio williamr@2: * control is not the same as given by aSize, the width must be reset williamr@2: * back to requested one. The aSize is set to the new size. williamr@2: * @param aSize Size. See explanation. williamr@2: */ williamr@2: virtual void SetAndGetSizeL(TSize& aSize) = 0; williamr@2: williamr@2: /** williamr@2: * This is called by the container to allow the Bio control to add williamr@2: * a menu item command. The command ID's should start from the value williamr@2: * returned by the MMsgBioControlObserver::FirstFreeCommand(). williamr@2: * @param aMenuPane Reference to the applications menu which will be williamr@2: * modified. williamr@2: */ williamr@2: virtual void SetMenuCommandSetL(CEikMenuPane& aMenuPane) = 0; williamr@2: williamr@2: /** williamr@2: * The command handler. The Bio Control should only handle its own williamr@2: * commands that it has set using the function SetMenuCommandSetL(). williamr@2: * @param aCommand ID of command to be handled. williamr@2: * @return If the command is handled, it returns ETrue, and vice versa williamr@2: */ williamr@2: virtual TBool HandleBioCommandL(TInt aCommand) = 0; williamr@2: williamr@2: /** williamr@2: * Returns a rectangle slice of the bio controls viewing area. williamr@2: * It is used by the CMsgEditorView class for scrolling the screen. williamr@2: * The position is given relative to the bio controls top left williamr@2: * corner. williamr@2: * @return TRect williamr@2: */ williamr@2: virtual TRect CurrentLineRect() const = 0; williamr@2: williamr@2: /** williamr@2: * Used by the body container for managing focus and scrolling. williamr@2: * @param aDirection The direction to be checked. williamr@2: * @return ETrue if focus change is possible, and vice versa. williamr@2: */ williamr@2: virtual TBool IsFocusChangePossible( williamr@2: TMsgFocusDirection aDirection) const = 0; williamr@2: williamr@2: /** williamr@2: * Returns the header text. williamr@2: * @return The header text. williamr@2: */ williamr@2: virtual HBufC* HeaderTextL(void) const = 0; williamr@2: williamr@2: /** williamr@2: * The application can get the option menu permissions using this williamr@2: * function. williamr@2: * @return The option menu permission flags. If the flag is off it williamr@2: * means that the option menu command is not recommended with this williamr@2: * Bio Control. williamr@2: */ williamr@2: virtual TUint32 OptionMenuPermissionsL() const = 0; williamr@2: williamr@2: /** williamr@2: * Gives the height of the text in pixels. williamr@2: * It is used by the scrolling framework. williamr@2: * @return Height of the text in pixels. williamr@2: */ williamr@2: virtual TInt VirtualHeight() = 0; williamr@2: williamr@2: /** williamr@2: * Gives the cursor position in pixels. williamr@2: * It is used by the scrolling framework. williamr@2: * @return Cursor position in pixels. williamr@2: */ williamr@2: virtual TInt VirtualVisibleTop() = 0; williamr@2: williamr@2: /** williamr@2: * Tells whether the cursor is in the topmost or bottom position. williamr@2: * It is used by the scrolling framework. williamr@2: * @param aLocation Specifies either top or bottom. williamr@2: * @return ETrue if the cursor is in the part specified by aLocation. williamr@2: */ williamr@2: virtual TBool IsCursorLocation(TMsgCursorLocation aLocation) const = 0; williamr@2: williamr@2: }; williamr@2: williamr@2: #endif // MMSGBIOCONTROL_H williamr@2: williamr@2: // end of file