epoc32/include/mw/eikedwob.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000 (2010-03-16)
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.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 		};
    56 public:
    57     /**
    58      * This pure virtual function is invoked by CEikEdwin to report an event
    59      * to its observer. The observer may respond appropriately.
    60      * 
    61      * @param aEdwin  The originating edwin. 
    62      * @param aEventType  The event being reported. 
    63      */
    64 	virtual void HandleEdwinEventL(CEikEdwin* aEdwin,TEdwinEvent aEventType)=0;
    65 	};
    66 
    67 /**
    68  * Interface to handle changes to an edwin's size.
    69  */
    70 class MEikEdwinSizeObserver
    71 	{
    72 public:
    73     /**
    74      * Specifies the type of event reported to the edwin observer.
    75      */
    76 	enum TEdwinSizeEvent
    77 		{
    78 		/**
    79 		 * Specifies a change in edwin size. When the edwin observer
    80 		 * receives an event of this type, it handles it by making
    81 		 * its view bigger or smaller according to the new edwin size.
    82 		 */
    83 		EEventSizeChanging
    84 		};
    85 public:
    86     /**
    87      * Handles a change in the edwin's size. If you implement this function,
    88      * ensure it returns ETrue if you wish to redraw the edwin.
    89      * 
    90      * @param aEdwin The edwin for which the size event is being handled.
    91      * @param aEventType The event type.
    92      * @param aDesirableEdwinSize The desired size for the edwin identified
    93      * by aEdwin.
    94      * @return The return value depends on your implementation. Return
    95      * ETrue if you wish to redraw the edwin. EFalse otherwise.
    96      */
    97 	virtual TBool HandleEdwinSizeEventL(CEikEdwin* aEdwin, TEdwinSizeEvent aEventType, TSize aDesirableEdwinSize)=0;
    98 	};
    99 
   100 #endif