williamr@2: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@4: // under the terms of "Eclipse Public License v1.0" williamr@2: // which accompanies this distribution, and is available williamr@4: // at the URL "http://www.eclipse.org/legal/epl-v10.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: #ifndef __COECOBS_H__ williamr@2: #define __COECOBS_H__ williamr@2: williamr@2: #include williamr@2: #include williamr@2: williamr@2: class CCoeControl; williamr@2: williamr@2: class MCoeControlObserver williamr@2: /** Interface for a control to send events to its observer control. williamr@2: williamr@2: @publishedAll williamr@2: @released */ williamr@2: { williamr@2: public: williamr@2: /** Observer event types. */ williamr@2: enum TCoeEvent williamr@2: { williamr@2: /** Request exit. williamr@2: This event is used to indicate exit from a mode when williamr@2: the user has completed an operation 'successfully'. For example, this williamr@2: event might be sent when the user has a choice list open and presses williamr@2: enter to select an item. The UI Control Framework does not use this williamr@2: event itself. */ williamr@2: EEventRequestExit, williamr@2: /** Request cancel. williamr@2: This event is used to indicate exit from a mode when the user has cancelled williamr@2: the operation that caused entry into the mode originally. For example, this williamr@2: event might be sent when the user presses escape to close the list and leave williamr@2: the choice as it was. The UI Control Framework does not use this event itself. */ williamr@2: EEventRequestCancel, williamr@2: /** Request focus. williamr@2: This event is notified by the UI Control Framework during pointer down event williamr@2: processing after EEventPrepareFocusTransition is handled. */ williamr@2: EEventRequestFocus, williamr@2: /** Prepare focus transition. williamr@2: This event is notified by the UI Control Framework during pointer down event williamr@2: processing if the control does not yet have, but could get, focus. */ williamr@2: EEventPrepareFocusTransition, williamr@2: /** State changed. williamr@2: This event can be used by a control to report that some piece of internal williamr@2: data has changed, and hence that any observer should be notified accordingly. williamr@2: The UI Control Framework does not use this value itself. */ williamr@2: EEventStateChanged, williamr@2: /** Interaction refused. williamr@2: This event is notified by the UI Control Framework during pointer down event williamr@2: processing if the control is dimmed (disabled). */ williamr@2: EEventInteractionRefused williamr@2: }; williamr@2: public: williamr@2: /** Handles an event from an observed control. williamr@2: williamr@2: This function is called when a control for which this control is the observer williamr@2: calls CCoeControl::ReportEventL(). It should be implemented by the observer williamr@2: control, and should handle all events sent by controls it observes. williamr@2: williamr@2: @param aControl The control that sent the event. williamr@2: @param aEventType The event type. */ williamr@2: virtual void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType)=0; williamr@2: protected: williamr@2: IMPORT_C MCoeControlObserver(); williamr@2: williamr@2: private: williamr@2: IMPORT_C virtual void MCoeControlObserver_Reserved1(); williamr@2: IMPORT_C virtual void MCoeControlObserver_Reserved2(); williamr@2: williamr@2: private: williamr@2: TInt iMCoeControlObserver_Reserved1; williamr@2: }; williamr@2: williamr@2: class MCoeControlStateObserver williamr@2: /** This class defines an interface which will given notification of when a CCoeControl williamr@2: changes its visibility or dimmed state. williamr@2: williamr@2: @publishedAll williamr@2: @released */ williamr@2: { williamr@2: friend class CCoeControl; williamr@2: public: williamr@2: /** The MObjectProvider framework should use this UID to know when to return a concrete instance of this interface. */ williamr@2: DECLARE_TYPE_ID(0x10285A45) williamr@2: enum TCoeState williamr@2: { williamr@2: /** This enum is used to say that the control has changed its Dimmed state */ williamr@2: EStateDimmed, williamr@2: /** This enum is used to say that the control has changed its Visibility state */ williamr@2: EStateVisibility williamr@2: }; williamr@2: private: williamr@2: /** williamr@2: If an object implementing this interface has been attached to the MObjectProvider williamr@2: hierarchy in which a CCoeControl is a member, any call to the CCoeControl's williamr@2: SetDimmed() or MakeVisible() (that results in an actual state change) will trigger williamr@2: a call to this interface. williamr@2: williamr@2: @param aControl A pointer to the control that has changed. williamr@2: @param aState An enum from TCoeState to say how the control has changed. williamr@2: @return A system wide error code, currently ignored but may not be in future.*/ williamr@2: virtual TInt HandleControlStateChange(CCoeControl* aControl,TCoeState aState)=0; williamr@2: }; williamr@2: williamr@2: #endif // __COECOBS_H__