epoc32/include/app/mmsgbiocontrol.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
     1 /*
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     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".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:  
    15 *     Interface for Bio controls.
    16 *
    17 */
    18 
    19 
    20 
    21 #ifndef MMSGBIOCONTROL_H
    22 #define MMSGBIOCONTROL_H
    23 
    24 //  INCLUDES
    25 #include <e32std.h>
    26 #include <e32base.h>
    27 #include <msgeditor.hrh>   // for enums
    28 
    29 // CONSTANTS
    30 
    31 /// Leave code which signals that the smart message data was invalid.
    32 const TInt KErrMsgBioMessageNotValid = -90;
    33 
    34 
    35 /**
    36  * Used by HandleBaseControlEventRequestL().
    37  */
    38 enum TMsgBioControlEventRequest 
    39     {
    40     EMsgBioUpdateScrollBars
    41     };
    42 
    43     /**
    44      * These option menu flags are used with the function
    45      * MMsgBioControl::OptionMenuPermissionsL().
    46      */
    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
    73         };
    74 
    75     /// This flag is given as a construction parameter to the Bio Control.
    76     enum TMsgBioMode {
    77         EMsgBioEditorMode,
    78         EMsgBioViewerMode
    79         };
    80 
    81 // MACROS
    82 // DATA TYPES
    83 // FUNCTION PROTOTYPES
    84 
    85 // FORWARD DECLARATIONS
    86 class CEikMenuPane;
    87 
    88 // CLASS DECLARATION
    89 
    90 /**
    91  * Interface for handling of event request.
    92  */
    93 class MMsgBioBodyControl
    94     {
    95     public:
    96         virtual TBool HandleBaseControlEventRequestL(        
    97             TMsgBioControlEventRequest aRequest,
    98             TInt aDelta = 0) = 0;
    99     };
   100 
   101 /**
   102 * The interface for Bio controls
   103 */
   104 class MMsgBioControl
   105     {
   106     public:
   107 
   108         /**
   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.
   117          */
   118         virtual void SetAndGetSizeL(TSize& aSize) = 0;
   119 
   120         /**
   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
   125          * modified.
   126          */
   127         virtual void SetMenuCommandSetL(CEikMenuPane& aMenuPane) = 0;
   128 
   129         /**
   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
   134          */
   135         virtual TBool HandleBioCommandL(TInt aCommand) = 0;
   136 
   137         /**
   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
   141          * corner.
   142          * @return TRect
   143          */
   144         virtual TRect CurrentLineRect() const = 0;
   145 
   146         /**
   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.
   150          */
   151         virtual TBool IsFocusChangePossible(
   152             TMsgFocusDirection aDirection) const = 0;
   153 
   154         /**
   155          * Returns the header text.
   156          * @return The header text.
   157          */
   158         virtual HBufC* HeaderTextL(void)  const = 0;
   159 
   160         /**
   161          * The application can get the option menu permissions using this
   162          * function.
   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
   165          * Bio Control.
   166          */
   167         virtual TUint32 OptionMenuPermissionsL() const = 0;
   168 
   169         /**
   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.
   173          */
   174         virtual TInt VirtualHeight() = 0;
   175 
   176         /**
   177          * Gives the cursor position in pixels.
   178          * It is used by the scrolling framework.
   179          * @return Cursor position in pixels.
   180          */
   181         virtual TInt VirtualVisibleTop() = 0;
   182 
   183         /**
   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.
   188          */
   189         virtual TBool IsCursorLocation(TMsgCursorLocation aLocation) const = 0;
   190 
   191     };
   192 
   193 #endif // MMSGBIOCONTROL_H
   194 
   195 // end of file