williamr@2: /* williamr@2: * Copyright (c) 1997-1999 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: * williamr@2: */ williamr@2: williamr@2: williamr@2: #if !defined(__EIKEDWOB_H__) williamr@2: #define __EIKEDWOB_H__ williamr@2: williamr@2: class CEikEdwin; williamr@2: williamr@2: /** williamr@2: * Interface class describing the functionality expected of an observer williamr@2: * for CEikEdwins. williamr@2: * williamr@2: * Edwin observers are informed by the edwin whenever its content is williamr@2: * changed, or whenever the user changes the cursor position. williamr@2: * williamr@2: * This class should be derived from by all observers of edwins. williamr@2: */ williamr@2: class MEikEdwinObserver williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Events from a value editor. williamr@2: */ williamr@2: enum TEdwinEvent williamr@2: { williamr@2: /** Sent whenever the content of the edwin changes. */ williamr@2: EEventFormatChanged, williamr@2: /** Sent on receipt of a navigation command. */ williamr@2: EEventNavigation, williamr@2: /** williamr@2: * Sent whenever the text of the edwin changes. To observe williamr@2: * actual changes in the contents of the editor this should williamr@2: * be preferred to EEventFormatChanged. williamr@2: */ williamr@2: EEventTextUpdate, williamr@2: /** Sent on receipt of a scroll event. */ williamr@2: EEventScroll, williamr@2: /** Sent if you explicitly call edwin's SetTextL() */ williamr@2: EEventTextUpdateAPI williamr@2: }; williamr@2: public: williamr@2: /** williamr@2: * This pure virtual function is invoked by CEikEdwin to report an event williamr@2: * to its observer. The observer may respond appropriately. williamr@2: * williamr@2: * @param aEdwin The originating edwin. williamr@2: * @param aEventType The event being reported. williamr@2: */ williamr@2: virtual void HandleEdwinEventL(CEikEdwin* aEdwin,TEdwinEvent aEventType)=0; williamr@2: }; williamr@2: williamr@2: /** williamr@2: * Interface to handle changes to an edwin's size. williamr@2: */ williamr@2: class MEikEdwinSizeObserver williamr@2: { williamr@2: public: williamr@2: /** williamr@2: * Specifies the type of event reported to the edwin observer. williamr@2: */ williamr@2: enum TEdwinSizeEvent williamr@2: { williamr@2: /** williamr@2: * Specifies a change in edwin size. When the edwin observer williamr@2: * receives an event of this type, it handles it by making williamr@2: * its view bigger or smaller according to the new edwin size. williamr@2: */ williamr@2: EEventSizeChanging williamr@2: }; williamr@2: public: williamr@2: /** williamr@2: * Handles a change in the edwin's size. If you implement this function, williamr@2: * ensure it returns ETrue if you wish to redraw the edwin. williamr@2: * williamr@2: * @param aEdwin The edwin for which the size event is being handled. williamr@2: * @param aEventType The event type. williamr@2: * @param aDesirableEdwinSize The desired size for the edwin identified williamr@2: * by aEdwin. williamr@2: * @return The return value depends on your implementation. Return williamr@2: * ETrue if you wish to redraw the edwin. EFalse otherwise. williamr@2: */ williamr@2: virtual TBool HandleEdwinSizeEventL(CEikEdwin* aEdwin, TEdwinSizeEvent aEventType, TSize aDesirableEdwinSize)=0; williamr@2: }; williamr@2: williamr@2: #endif