|
1 /* |
|
2 * Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Phonebook 2 control observer interface. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MPBK2CONTROLOBSERVER_H |
|
20 #define MPBK2CONTROLOBSERVER_H |
|
21 |
|
22 // FORWARD DECLARATIONS |
|
23 class MPbk2ContactUiControl; |
|
24 |
|
25 // CLASS DECLARATION |
|
26 |
|
27 /** |
|
28 * Phonebook 2 control observer event type. |
|
29 */ |
|
30 class TPbk2ControlEvent |
|
31 { |
|
32 public: // Types |
|
33 |
|
34 /** |
|
35 * Event types. |
|
36 */ |
|
37 enum TEventType |
|
38 { |
|
39 /// Control unavailable |
|
40 EUnavailable, |
|
41 /// Control ready |
|
42 /// @see MVPbkContactViewObserver::ContactViewReady |
|
43 EReady, |
|
44 /// Item added to the control |
|
45 /// @see MVPbkContactViewObserver::ContactAddedToView |
|
46 EItemAdded, |
|
47 /// Item removed from the control |
|
48 /// @see MVPbkContactViewObserver::ContactRemovedFromView |
|
49 EItemRemoved, |
|
50 /// Sent when contact selection status changes because of |
|
51 /// the user actions. Selection changes caused programmically |
|
52 /// by control API calls are not reported. |
|
53 EContactSelected, |
|
54 /// Sent when contact selection status changes because of |
|
55 /// the user actions. Selection changes caused programmically |
|
56 /// by control API calls are not reported. |
|
57 EContactUnselected, |
|
58 /// Sent when contact selection status changes because of |
|
59 /// the user actions. Selection changes caused programmically |
|
60 /// by control API calls are not reported. |
|
61 EContactUnselectedAll, |
|
62 /// Sent when the control enters busy state |
|
63 EEnterBusy, |
|
64 /// Sent when the control exits busy state |
|
65 EExitBusy, |
|
66 /// Sent when the control's content is changed |
|
67 /// because of the find filtering |
|
68 EContactSetChanged, |
|
69 /// Sent when user taps a contact item in a list. This might be |
|
70 /// the only event sent if selection accepter prevents the focused |
|
71 /// contact from being selected e.g. in a multi-selection fetch. |
|
72 EContactTapped, |
|
73 /// Sent when user double-taps a contact item in a list. In this |
|
74 /// case, EContactTapped is not sent. |
|
75 EContactDoubleTapped, |
|
76 /// Sent when the control's logical state changes |
|
77 EControlStateChanged, |
|
78 /// Sent when listbox enters selection mode if the control |
|
79 /// supports selection. Selection mode is enabled by |
|
80 /// long pressing shift, ctrl or hash keys (when hash key |
|
81 /// marking is enabled). |
|
82 EControlEntersSelectionMode, |
|
83 /// Sent when listbox leaves the selection mode if the control |
|
84 /// supports selection. |
|
85 EControlLeavesSelectionMode, |
|
86 /// Sent when focus changed in listbox. |
|
87 EControlFocusChanged, |
|
88 /// Sent when enter was pressed in listbox. |
|
89 EControlEnterKeyPressed |
|
90 }; |
|
91 |
|
92 public: // Constructor |
|
93 |
|
94 /** |
|
95 * Constructor. |
|
96 * |
|
97 * @param aEventType Event type. |
|
98 */ |
|
99 inline TPbk2ControlEvent( |
|
100 TEventType aEventType ) : |
|
101 iEventType( aEventType ), |
|
102 iInt( KErrNotFound ) |
|
103 { |
|
104 } |
|
105 |
|
106 public: // Data |
|
107 /// Own: Event type |
|
108 TEventType iEventType; |
|
109 /// Own: Index |
|
110 TInt iInt; |
|
111 }; |
|
112 |
|
113 |
|
114 /** |
|
115 * Phonebook 2 control observer interface. |
|
116 */ |
|
117 class MPbk2ControlObserver |
|
118 { |
|
119 public: // Interface |
|
120 |
|
121 /** |
|
122 * Handles Phonebook 2 control event. |
|
123 * |
|
124 * @param aControl The control. |
|
125 * @param aEvent The event. |
|
126 */ |
|
127 virtual void HandleControlEventL( |
|
128 MPbk2ContactUiControl& aControl, |
|
129 const TPbk2ControlEvent& aEvent ) = 0; |
|
130 |
|
131 protected: // Protected functions |
|
132 /** |
|
133 * Destructor. |
|
134 */ |
|
135 virtual ~MPbk2ControlObserver() |
|
136 {} |
|
137 }; |
|
138 |
|
139 #endif // MPBK2CONTROLOBSERVER_H |
|
140 |
|
141 // End of File |