wvuing/wvuiave/AppSrc/MCATextView.h
branchRCL_3
changeset 13 a941bc465d9f
parent 0 094583676ce7
equal deleted inserted replaced
12:6ca72c0fe49a 13:a941bc465d9f
       
     1 /*
       
     2 * Copyright (c) 2002-2005 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:  Interface for text viewer
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef MCATEXTVIEW_H
       
    21 #define MCATEXTVIEW_H
       
    22 
       
    23 #include <frmtlay.h> // TCursorSelection
       
    24 
       
    25 // CLASS DECLARATION
       
    26 class TPointerEvent;
       
    27 
       
    28 /**
       
    29 *  Interface for text viewer
       
    30 *
       
    31 *  @lib chat.app
       
    32 *  @since Series 60 3.0
       
    33 */
       
    34 class MCATextView
       
    35     {
       
    36     public: // Enumerations
       
    37 
       
    38         enum TPenBehaviour
       
    39             {
       
    40             EPenForwardToChild = 0,
       
    41             EPenForwardToParent,
       
    42             EPenProcessEvent,
       
    43             EPenIgnoreEvent
       
    44             };
       
    45 
       
    46     public: // New functions
       
    47 
       
    48         /**
       
    49          * Handles changed format.
       
    50          * @param aChanged Changed section of rich text
       
    51          * @param aPreserveFocus ETrue : Keeps focus of text control in place
       
    52          *                       EFalse : Focus moves with changes
       
    53          */
       
    54         virtual void HandleFormatChangedL( TCursorSelection& aChanged,
       
    55                                            TBool aPreserveFocus = EFalse ) = 0;
       
    56 
       
    57         /**
       
    58          * Handles insertion and deletion
       
    59          * @param aChanged Changed section of rich text. If this function is
       
    60          *                 being used to handle deletion only, this argument
       
    61          *                 should be of length zero and its start position
       
    62          *                 should be the beginning of the deletion.
       
    63          * @param aDeletedChars The number of deleted characters. Specify zero
       
    64          *                 if this function is being used to handle insertion
       
    65          *                 only.
       
    66          */
       
    67         virtual void HandleInsertDeleteL( TCursorSelection& aChanged,
       
    68                                           TInt aDeletedChars ) = 0;
       
    69 
       
    70         /**
       
    71          * Handles addition of text
       
    72          * @param aFirst Should be set to ETrue if
       
    73          *               this is the first addition of text
       
    74          * @param aSelection Selection
       
    75          * @param aTop If selection doesn't fit to screen, should the top of the
       
    76          *        selection be visible. I.e. If ETrue, top of the message is shown.
       
    77          *        if EFalse, bottom of the message is shown.
       
    78          */
       
    79         virtual void HandleAdditionL( TBool aFirst, TCursorSelection& aSelection,
       
    80                                       TBool aTop ) = 0;
       
    81 
       
    82         /**
       
    83          * Scrolls selection to screen and updates scroll bars
       
    84          * @param aSelection Selection
       
    85          * @param aTop If selection doesn't fit to screen, should the top of the
       
    86          *        selection be visible. I.e. If ETrue, top of the message is shown.
       
    87          *        if EFalse, bottom of the message is shown.
       
    88          */
       
    89         virtual void ScrollVisibleL( TCursorSelection& aSelection, TBool aTop ) = 0;
       
    90 
       
    91         /**
       
    92          * @return Current scroll selection (i.e. the visible part)
       
    93          */
       
    94         virtual TCursorSelection ScrollSelection() = 0;
       
    95 
       
    96         /**
       
    97          * Scrolls view up or down
       
    98          * @param aAmount Amount of lines to be scrolled
       
    99          * Use negative values for scrolling up
       
   100          */
       
   101         virtual void ScrollLinesL( TInt aAmount ) = 0;
       
   102 
       
   103         /**
       
   104          * @return ETrue if aPos is visible on screen, EFalse otherwise.
       
   105          */
       
   106         virtual TBool IsVisible( TInt aPos ) = 0;
       
   107 
       
   108         /**
       
   109          * @return ETrue if the paragraph in aPos fits to screen
       
   110          */
       
   111         virtual TBool ParagraphFits( TInt aPos ) = 0;
       
   112 
       
   113         /**
       
   114          * Redraws the view
       
   115          */
       
   116         virtual void Redraw() = 0;
       
   117 
       
   118         /**
       
   119          * Sets the behaviour of this control to pointer events.
       
   120          * see TPenBehaviour for more detailed info.
       
   121          * @param aPen How this control should react to pointer events
       
   122          */
       
   123         virtual void SetPenBehaviour( TPenBehaviour aPen ) = 0;
       
   124 
       
   125         /**
       
   126          * Return current pen behaviour state. Determines how this control
       
   127          * reacts to pointer events.
       
   128          * @return Current pen behaviour
       
   129          */
       
   130         virtual TPenBehaviour PenBehaviour() = 0;
       
   131 
       
   132         /**
       
   133          * Reformats the view after a global change has been made to the layout,
       
   134          * but without causing a redraw.
       
   135          * @since S60 v3.2
       
   136          * @param aYPosQualifier Specifies whether the visible area is to be
       
   137          *                       filled and whether the top line should be made
       
   138          *                       fully visible if possible.
       
   139          */
       
   140         virtual void HandleGlobalChangeNoRedrawL(
       
   141             TViewYPosQualifier aYPosQualifier = TViewYPosQualifier() ) = 0;
       
   142 
       
   143     protected:
       
   144 
       
   145         /**
       
   146          * This gets called when the pointer event is inside the text message.
       
   147          * @param aPointerEvent Pointer event
       
   148          */
       
   149         virtual void ProcessStylusEventL(
       
   150             const TPointerEvent& aPointerEvent ) = 0;
       
   151 
       
   152         /**
       
   153          * Destructor.
       
   154          */
       
   155         virtual ~MCATextView() {};
       
   156 
       
   157     };
       
   158 
       
   159 #endif      // MCATEXTVIEW_H
       
   160 
       
   161 // End of File