|
1 /* |
|
2 * Copyright (c) 2006-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 group members view. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CPGUGROUPMEMBERSVIEW_H |
|
20 #define CPGUGROUPMEMBERSVIEW_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <vwsdef.h> |
|
25 #include <MPbk2UIExtensionView.h> |
|
26 #include <eiklbo.h> |
|
27 |
|
28 // FORWARD DECLARATIONS |
|
29 class CPbk2UIExtensionView; |
|
30 class CPbk2NamesListControl; |
|
31 class CPbk2ContactNavigation; |
|
32 template<class ControlType> class CPbk2ControlContainer; |
|
33 class MPbk2ContactUiControl; |
|
34 class CGroupMembersViewActivation; |
|
35 class MVPbkContactLink; |
|
36 |
|
37 // CLASS DECLARATIONS |
|
38 |
|
39 /** |
|
40 * Phonebook group members view activation state switcher interface. |
|
41 */ |
|
42 class MPbk2GroupMembersViewActivationCallback |
|
43 { |
|
44 public: // Interface |
|
45 |
|
46 /** |
|
47 * Transforms view's activation state to ready. |
|
48 * |
|
49 * @param aGroupIndex Index of group. |
|
50 */ |
|
51 virtual void TransformViewActivationStateToReadyL( |
|
52 const TInt aGroupIndex ) = 0; |
|
53 |
|
54 /** |
|
55 * Restores previous state. |
|
56 */ |
|
57 virtual void RestoreStateL() = 0; |
|
58 |
|
59 /** |
|
60 * Returns focused contact. |
|
61 * |
|
62 * @return Link to the focused contact. |
|
63 */ |
|
64 virtual MVPbkContactLink* FocusedContact() const = 0; |
|
65 |
|
66 /** |
|
67 * Sets focused contact. |
|
68 * |
|
69 * @param aGroupLink Focused group link. |
|
70 */ |
|
71 virtual void SetFocusedContact( |
|
72 MVPbkContactLink* aGroupLink ) = 0; |
|
73 |
|
74 protected: // Disabled fuctions |
|
75 ~MPbk2GroupMembersViewActivationCallback() |
|
76 {} |
|
77 }; |
|
78 |
|
79 /** |
|
80 * Phonebook 2 group members view. |
|
81 */ |
|
82 class CPguGroupMembersView : public CBase, |
|
83 public MPbk2UIExtensionView, |
|
84 public MEikListBoxObserver, |
|
85 private MPbk2GroupMembersViewActivationCallback |
|
86 |
|
87 |
|
88 { |
|
89 public: // Construction and destruction |
|
90 |
|
91 /** |
|
92 * Creates a new instance of this class. |
|
93 * |
|
94 * @param aView The extension view. |
|
95 * @return A new instance of this class. |
|
96 */ |
|
97 static CPguGroupMembersView* NewL( |
|
98 CPbk2UIExtensionView& aView ); |
|
99 |
|
100 /** |
|
101 * Destructor. |
|
102 */ |
|
103 ~CPguGroupMembersView(); |
|
104 |
|
105 public: // From MPbk2UIExtensionView |
|
106 void HandleStatusPaneSizeChange(); |
|
107 CPbk2ViewState* ViewStateLC() const; |
|
108 TBool HandleCommandKeyL( |
|
109 const TKeyEvent& aKeyEvent, |
|
110 TEventCode aType ); |
|
111 TInt GetViewSpecificMenuFilteringFlagsL() const; |
|
112 void DoActivateL( |
|
113 const TVwsViewId& aPrevViewId, |
|
114 TUid aCustomMessageId, |
|
115 const TDesC8& aCustomMessage ); |
|
116 void DoDeactivate(); |
|
117 void HandleCommandL( |
|
118 TInt aCommand ); |
|
119 void DynInitMenuPaneL( |
|
120 TInt aResourceId, |
|
121 CEikMenuPane* aMenuPane ); |
|
122 void HandlePointerEventL( |
|
123 const TPointerEvent& aPointerEvent ); |
|
124 void HandleLongTapEventL( |
|
125 const TPoint& aPenEventLocation, |
|
126 const TPoint& aPenEventScreenLocation ); |
|
127 |
|
128 |
|
129 protected: |
|
130 // from MEikListBoxObserver |
|
131 void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType ); |
|
132 |
|
133 private: // From MPbk2GroupMembersViewActivationCallback |
|
134 void TransformViewActivationStateToReadyL( |
|
135 const TInt aGroupIndex ); |
|
136 void RestoreStateL() const; |
|
137 MVPbkContactLink* FocusedContact() const; |
|
138 void SetFocusedContact( |
|
139 MVPbkContactLink* aGroupLink ); |
|
140 |
|
141 private: // Implementation |
|
142 CPguGroupMembersView( |
|
143 CPbk2UIExtensionView& aView ); |
|
144 void StoreStateL(); |
|
145 void RestoreStateL(); |
|
146 void UpdateViewStateL( |
|
147 const TUid aCustomMessageId, |
|
148 const TDesC8& aCustomMessage ); |
|
149 class CGroupMembersViewImpl; |
|
150 class CGroupMembersAllGroupsNotReady; |
|
151 class CGroupMembersAllGroupsReady; |
|
152 void ReturnToPreviousViewL() const; |
|
153 void ShowContextMenuL(); |
|
154 |
|
155 |
|
156 private: // Data |
|
157 /// Ref: View that contains this extension view |
|
158 CPbk2UIExtensionView& iView; |
|
159 /// Own: Stored control state |
|
160 CPbk2ViewState* iControlState; |
|
161 /// Own: Focused group |
|
162 MVPbkContactLink* iFocusedGroup; |
|
163 /// Own: The view which this view was activated from |
|
164 TVwsViewId iPreviousViewId; |
|
165 /// Own: View activation state machine |
|
166 CGroupMembersViewImpl* iViewImpl; |
|
167 }; |
|
168 |
|
169 #endif // CPGUGROUPMEMBERSVIEW_H |
|
170 |
|
171 // End of File |