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