epoc32/include/coecobs.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
     1.1 --- a/epoc32/include/coecobs.h	Tue Nov 24 13:55:44 2009 +0000
     1.2 +++ b/epoc32/include/coecobs.h	Tue Mar 16 16:12:26 2010 +0000
     1.3 @@ -1,1 +1,117 @@
     1.4 -coecobs.h
     1.5 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +// All rights reserved.
     1.7 +// This component and the accompanying materials are made available
     1.8 +// 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
     1.9 +// which accompanies this distribution, and is available
    1.10 +// at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
    1.11 +//
    1.12 +// Initial Contributors:
    1.13 +// Nokia Corporation - initial contribution.
    1.14 +//
    1.15 +// Contributors:
    1.16 +//
    1.17 +// Description:
    1.18 +//
    1.19 +
    1.20 +#ifndef __COECOBS_H__
    1.21 +#define __COECOBS_H__
    1.22 +
    1.23 +#include <e32base.h>
    1.24 +#include <coemop.h>
    1.25 +
    1.26 +class CCoeControl;
    1.27 +
    1.28 +class MCoeControlObserver
    1.29 +/** Interface for a control to send events to its observer control. 
    1.30 +
    1.31 +@publishedAll 
    1.32 +@released */
    1.33 +	{
    1.34 +public:
    1.35 +	/** Observer event types. */
    1.36 +	enum TCoeEvent
    1.37 +		{
    1.38 +		/** Request exit. 
    1.39 +		This event is used to indicate exit from a mode when 
    1.40 +		the user has completed an operation 'successfully'. For example, this 
    1.41 +		event might be sent when the user has a choice list open and presses 
    1.42 +		enter to select an item. The UI Control Framework does not use this 
    1.43 +		event itself. */
    1.44 +		EEventRequestExit,
    1.45 +		/** Request cancel.
    1.46 +		This event is used to indicate exit from a mode when the user has cancelled 
    1.47 +		the operation that caused entry into the mode originally. For example, this 
    1.48 +		event might be sent when the user presses escape to close the list and leave 
    1.49 +		the choice as it was. The UI Control Framework does not use this event itself. */
    1.50 +		EEventRequestCancel,
    1.51 +		/** Request focus.
    1.52 +		This event is notified by the UI Control Framework during pointer down event 
    1.53 +		processing after EEventPrepareFocusTransition is handled. */
    1.54 +		EEventRequestFocus,
    1.55 +		/** Prepare focus transition.
    1.56 +		This event is notified by the UI Control Framework during pointer down event 
    1.57 +		processing if the control does not yet have, but could get, focus. */
    1.58 +		EEventPrepareFocusTransition,
    1.59 +		/** State changed.
    1.60 +		This event can be used by a control to report that some piece of internal 
    1.61 +		data has changed, and hence that any observer should be notified accordingly. 
    1.62 +		The UI Control Framework does not use this value itself. */
    1.63 +		EEventStateChanged,
    1.64 +		/** Interaction refused.
    1.65 +		This event is notified by the UI Control Framework during pointer down event 
    1.66 +		processing if the control is dimmed (disabled). */
    1.67 +		EEventInteractionRefused
    1.68 +		};
    1.69 +public:
    1.70 +	/** Handles an event from an observed control.
    1.71 +	
    1.72 +	This function is called when a control for which this control is the observer 
    1.73 +	calls CCoeControl::ReportEventL(). It should be implemented by the observer 
    1.74 +	control, and should handle all events sent by controls it observes.
    1.75 +	
    1.76 +	@param aControl The control that sent the event.
    1.77 +	@param aEventType The event type. */
    1.78 +	virtual void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType)=0;
    1.79 +protected:
    1.80 +    IMPORT_C MCoeControlObserver();
    1.81 +    
    1.82 +private:
    1.83 +    IMPORT_C virtual void MCoeControlObserver_Reserved1();
    1.84 +    IMPORT_C virtual void MCoeControlObserver_Reserved2();
    1.85 +    
    1.86 +private:
    1.87 +    TInt iMCoeControlObserver_Reserved1;
    1.88 +	};
    1.89 +
    1.90 +class MCoeControlStateObserver
    1.91 +/** This class defines an interface which will given notification of when a CCoeControl
    1.92 +changes its visibility or dimmed state.
    1.93 +
    1.94 +@publishedAll
    1.95 +@released */
    1.96 +	{
    1.97 +	friend class CCoeControl;
    1.98 +public:
    1.99 +	/** The MObjectProvider framework should use this UID to know when to return a concrete instance of this interface. */
   1.100 +	DECLARE_TYPE_ID(0x10285A45)
   1.101 +	enum TCoeState
   1.102 +		{
   1.103 +		/** This enum is used to say that the control has changed its Dimmed state */
   1.104 +		EStateDimmed,
   1.105 +		/** This enum is used to say that the control has changed its Visibility state */
   1.106 +		EStateVisibility
   1.107 +		};
   1.108 +private:
   1.109 +	/**
   1.110 +	If an object implementing this interface has been attached to the MObjectProvider
   1.111 +	hierarchy in which a CCoeControl is a member, any call to the CCoeControl's
   1.112 +	SetDimmed() or MakeVisible() (that results in an actual state change) will trigger
   1.113 +	a call to this interface.
   1.114 +
   1.115 +	@param aControl	A pointer to the control that has changed.
   1.116 +	@param aState	An enum from TCoeState to say how the control has changed.
   1.117 +	@return 		A system wide error code, currently ignored but may not be in future.*/
   1.118 +	virtual TInt HandleControlStateChange(CCoeControl* aControl,TCoeState aState)=0;
   1.119 +	};
   1.120 +
   1.121 +#endif	// __COECOBS_H__