epoc32/include/coecobs.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 coecobs.h
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // 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
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __COECOBS_H__
       
    17 #define __COECOBS_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 #include <coemop.h>
       
    21 
       
    22 class CCoeControl;
       
    23 
       
    24 class MCoeControlObserver
       
    25 /** Interface for a control to send events to its observer control. 
       
    26 
       
    27 @publishedAll 
       
    28 @released */
       
    29 	{
       
    30 public:
       
    31 	/** Observer event types. */
       
    32 	enum TCoeEvent
       
    33 		{
       
    34 		/** Request exit. 
       
    35 		This event is used to indicate exit from a mode when 
       
    36 		the user has completed an operation 'successfully'. For example, this 
       
    37 		event might be sent when the user has a choice list open and presses 
       
    38 		enter to select an item. The UI Control Framework does not use this 
       
    39 		event itself. */
       
    40 		EEventRequestExit,
       
    41 		/** Request cancel.
       
    42 		This event is used to indicate exit from a mode when the user has cancelled 
       
    43 		the operation that caused entry into the mode originally. For example, this 
       
    44 		event might be sent when the user presses escape to close the list and leave 
       
    45 		the choice as it was. The UI Control Framework does not use this event itself. */
       
    46 		EEventRequestCancel,
       
    47 		/** Request focus.
       
    48 		This event is notified by the UI Control Framework during pointer down event 
       
    49 		processing after EEventPrepareFocusTransition is handled. */
       
    50 		EEventRequestFocus,
       
    51 		/** Prepare focus transition.
       
    52 		This event is notified by the UI Control Framework during pointer down event 
       
    53 		processing if the control does not yet have, but could get, focus. */
       
    54 		EEventPrepareFocusTransition,
       
    55 		/** State changed.
       
    56 		This event can be used by a control to report that some piece of internal 
       
    57 		data has changed, and hence that any observer should be notified accordingly. 
       
    58 		The UI Control Framework does not use this value itself. */
       
    59 		EEventStateChanged,
       
    60 		/** Interaction refused.
       
    61 		This event is notified by the UI Control Framework during pointer down event 
       
    62 		processing if the control is dimmed (disabled). */
       
    63 		EEventInteractionRefused
       
    64 		};
       
    65 public:
       
    66 	/** Handles an event from an observed control.
       
    67 	
       
    68 	This function is called when a control for which this control is the observer 
       
    69 	calls CCoeControl::ReportEventL(). It should be implemented by the observer 
       
    70 	control, and should handle all events sent by controls it observes.
       
    71 	
       
    72 	@param aControl The control that sent the event.
       
    73 	@param aEventType The event type. */
       
    74 	virtual void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType)=0;
       
    75 protected:
       
    76     IMPORT_C MCoeControlObserver();
       
    77     
       
    78 private:
       
    79     IMPORT_C virtual void MCoeControlObserver_Reserved1();
       
    80     IMPORT_C virtual void MCoeControlObserver_Reserved2();
       
    81     
       
    82 private:
       
    83     TInt iMCoeControlObserver_Reserved1;
       
    84 	};
       
    85 
       
    86 class MCoeControlStateObserver
       
    87 /** This class defines an interface which will given notification of when a CCoeControl
       
    88 changes its visibility or dimmed state.
       
    89 
       
    90 @publishedAll
       
    91 @released */
       
    92 	{
       
    93 	friend class CCoeControl;
       
    94 public:
       
    95 	/** The MObjectProvider framework should use this UID to know when to return a concrete instance of this interface. */
       
    96 	DECLARE_TYPE_ID(0x10285A45)
       
    97 	enum TCoeState
       
    98 		{
       
    99 		/** This enum is used to say that the control has changed its Dimmed state */
       
   100 		EStateDimmed,
       
   101 		/** This enum is used to say that the control has changed its Visibility state */
       
   102 		EStateVisibility
       
   103 		};
       
   104 private:
       
   105 	/**
       
   106 	If an object implementing this interface has been attached to the MObjectProvider
       
   107 	hierarchy in which a CCoeControl is a member, any call to the CCoeControl's
       
   108 	SetDimmed() or MakeVisible() (that results in an actual state change) will trigger
       
   109 	a call to this interface.
       
   110 
       
   111 	@param aControl	A pointer to the control that has changed.
       
   112 	@param aState	An enum from TCoeState to say how the control has changed.
       
   113 	@return 		A system wide error code, currently ignored but may not be in future.*/
       
   114 	virtual TInt HandleControlStateChange(CCoeControl* aControl,TCoeState aState)=0;
       
   115 	};
       
   116 
       
   117 #endif	// __COECOBS_H__