classicui_plat/editors_api/inc/EIKEDWOB.H
changeset 49 31c16e0c5e3e
equal deleted inserted replaced
40:7165f928e888 49:31c16e0c5e3e
       
     1 /*
       
     2 * Copyright (c) 1997-1999 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 *
       
    16 */
       
    17 
       
    18 
       
    19 #if !defined(__EIKEDWOB_H__)
       
    20 #define __EIKEDWOB_H__
       
    21 
       
    22 class CEikEdwin;
       
    23 
       
    24 /**
       
    25  * Interface class describing the functionality expected of an observer
       
    26  * for CEikEdwins.
       
    27  * 
       
    28  * Edwin observers are informed by the edwin whenever its content is
       
    29  * changed, or whenever the user changes the cursor position.
       
    30  * 
       
    31  * This class should be derived from by all observers of edwins.
       
    32  */
       
    33 class MEikEdwinObserver
       
    34 	{
       
    35 public:
       
    36     /**
       
    37      * Events from a value editor.
       
    38      */
       
    39 	enum TEdwinEvent
       
    40 		{
       
    41 		/** Sent whenever the content of the edwin changes. */
       
    42 		EEventFormatChanged,
       
    43 		/** Sent on receipt of a navigation command. */
       
    44 		EEventNavigation,
       
    45 		/**
       
    46 		 * Sent whenever the text of the edwin changes. To observe
       
    47 		 * actual changes in the contents of the editor this should
       
    48 		 * be preferred to EEventFormatChanged.
       
    49 		 */
       
    50 		EEventTextUpdate,
       
    51 		/** Sent on receipt of a scroll event. */
       
    52 		EEventScroll,
       
    53 		/** Sent if you explicitly call edwin's SetTextL() */
       
    54 		EEventTextUpdateAPI,
       
    55 		EEventChinesePopupOpen,
       
    56 		EEventChinesePopupClose,
       
    57         EEventPartialScreenEnable,
       
    58         EEventPartialScreenDisable
       
    59 		};
       
    60 public:
       
    61     /**
       
    62      * This pure virtual function is invoked by CEikEdwin to report an event
       
    63      * to its observer. The observer may respond appropriately.
       
    64      * 
       
    65      * @param aEdwin  The originating edwin. 
       
    66      * @param aEventType  The event being reported. 
       
    67      */
       
    68 	virtual void HandleEdwinEventL(CEikEdwin* aEdwin,TEdwinEvent aEventType)=0;
       
    69 	};
       
    70 
       
    71 /**
       
    72  * Interface to handle changes to an edwin's size.
       
    73  */
       
    74 class MEikEdwinSizeObserver
       
    75 	{
       
    76 public:
       
    77     /**
       
    78      * Specifies the type of event reported to the edwin observer.
       
    79      */
       
    80 	enum TEdwinSizeEvent
       
    81 		{
       
    82 		/**
       
    83 		 * Specifies a change in edwin size. When the edwin observer
       
    84 		 * receives an event of this type, it handles it by making
       
    85 		 * its view bigger or smaller according to the new edwin size.
       
    86 		 */
       
    87 		EEventSizeChanging
       
    88 		};
       
    89 public:
       
    90     /**
       
    91      * Handles a change in the edwin's size. If you implement this function,
       
    92      * ensure it returns ETrue if you wish to redraw the edwin.
       
    93      * 
       
    94      * @param aEdwin The edwin for which the size event is being handled.
       
    95      * @param aEventType The event type.
       
    96      * @param aDesirableEdwinSize The desired size for the edwin identified
       
    97      * by aEdwin.
       
    98      * @return The return value depends on your implementation. Return
       
    99      * ETrue if you wish to redraw the edwin. EFalse otherwise.
       
   100      */
       
   101 	virtual TBool HandleEdwinSizeEventL(CEikEdwin* aEdwin, TEdwinSizeEvent aEventType, TSize aDesirableEdwinSize)=0;
       
   102 	};
       
   103 
       
   104 #endif