|
1 /* |
|
2 * Copyright (c) 2008 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: Implementation of detailsview plugin control container |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef C_CCAPPDETAILSVIEWCONTAINER_H |
|
19 #define C_CCAPPDETAILSVIEWCONTAINER_H |
|
20 |
|
21 // INCLUDES |
|
22 #include <aknlists.h> |
|
23 #include <ccappviewpluginakncontainer.h> |
|
24 #include <eiklbo.h> |
|
25 #include <Pbk2Commands.hrh> |
|
26 |
|
27 #include <MPbk2ContactUiControl.h> |
|
28 #include <MPbk2ContactUiControl2.h> |
|
29 |
|
30 class CPbk2UIExtensionManager; |
|
31 class CPbk2ApplicationServices; |
|
32 class CVPbkContactManager; |
|
33 class CCCAppDetailsViewListBoxModel; |
|
34 class CPbk2CommandHandler; |
|
35 |
|
36 class MVPbkStoreContact; |
|
37 class MVPbkBaseContactField; |
|
38 class MVPbkContactLink; |
|
39 class MPbk2Command; |
|
40 class MCCAppEngine; |
|
41 class CCCAppDetailsViewPlugin; |
|
42 |
|
43 // CLASS DECLARATION |
|
44 class CCCAppDetailsViewContainer : public CCCAppViewPluginAknContainer, |
|
45 public MPbk2ContactUiControl, |
|
46 public MPbk2ContactUiControl2, |
|
47 public MEikListBoxObserver |
|
48 { |
|
49 |
|
50 public: |
|
51 |
|
52 /** |
|
53 * Constructor. This is called from plugin class NewContainerL. |
|
54 */ |
|
55 CCCAppDetailsViewContainer(const TUid& aPluginUid, |
|
56 CCCAppDetailsViewPlugin& aPlugin); |
|
57 |
|
58 /** |
|
59 * Destructor. |
|
60 */ |
|
61 ~CCCAppDetailsViewContainer(); |
|
62 |
|
63 public: // MCCAppEngine setters and getters |
|
64 |
|
65 /** |
|
66 * Reference to the cca application engine |
|
67 * not owned |
|
68 */ |
|
69 MCCAppEngine& GetAppEngine() |
|
70 { |
|
71 return *iAppEngine; |
|
72 } |
|
73 void SetAppEngine(MCCAppEngine* aAppEngine) |
|
74 { |
|
75 iAppEngine = aAppEngine; |
|
76 } |
|
77 |
|
78 |
|
79 public: // From CCoeControl |
|
80 |
|
81 void SizeChanged(); |
|
82 |
|
83 void FocusChanged(TDrawNow aDrawNow); |
|
84 |
|
85 TInt CountComponentControls() const; |
|
86 |
|
87 CCoeControl* ComponentControl(TInt aIndex) const; |
|
88 |
|
89 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); |
|
90 |
|
91 void ProcessCommandL( TInt aCommandId ) const; |
|
92 |
|
93 /** |
|
94 * From MEikListBoxObserver |
|
95 * (see details from baseclass ) |
|
96 */ |
|
97 void HandleListBoxEventL( |
|
98 CEikListBox *aListBox, TListBoxEvent aEventType ); |
|
99 |
|
100 void GetHelpContext(TCoeHelpContext& aContext) const; |
|
101 |
|
102 public: // From MPbk2ContactUiControl |
|
103 |
|
104 MPbk2ContactUiControl* ParentControl() const; |
|
105 TInt NumberOfContacts() const; |
|
106 const MVPbkBaseContact* FocusedContactL() const; |
|
107 const MVPbkViewContact* FocusedViewContactL() const; |
|
108 const MVPbkStoreContact* FocusedStoreContact() const; |
|
109 void SetFocusedContactL( |
|
110 const MVPbkBaseContact& aContact ); |
|
111 void SetFocusedContactL( |
|
112 const MVPbkContactBookmark& aContactBookmark ); |
|
113 void SetFocusedContactL( |
|
114 const MVPbkContactLink& aContactLink ); |
|
115 TInt FocusedContactIndex() const; |
|
116 void SetFocusedContactIndexL( |
|
117 TInt aIndex ); |
|
118 TInt NumberOfContactFields() const; |
|
119 const MVPbkBaseContactField* FocusedField() const; |
|
120 TInt FocusedFieldIndex() const; |
|
121 void SetFocusedFieldIndex( |
|
122 TInt aIndex ); |
|
123 TBool ContactsMarked() const; |
|
124 MVPbkContactLinkArray* SelectedContactsL() const; |
|
125 MVPbkContactLinkArray* SelectedContactsOrFocusedContactL() const; |
|
126 MPbk2ContactLinkIterator* SelectedContactsIteratorL() const; |
|
127 CArrayPtr<MVPbkContactStore>* SelectedContactStoresL() const; |
|
128 void ClearMarks(); |
|
129 void SetSelectedContactL( |
|
130 TInt aIndex, |
|
131 TBool aSelected ); |
|
132 void SetSelectedContactL( |
|
133 const MVPbkContactBookmark& aContactBookmark, |
|
134 TBool aSelected ); |
|
135 void SetSelectedContactL( |
|
136 const MVPbkContactLink& aContactLink, |
|
137 TBool aSelected ); |
|
138 |
|
139 void DynInitMenuPaneL( |
|
140 TInt aResourceId, |
|
141 CEikMenuPane* aMenuPane ) const; |
|
142 void UpdateAfterCommandExecution(); |
|
143 TInt GetMenuFilteringFlagsL() const; |
|
144 CPbk2ViewState* ControlStateL() const; |
|
145 void RestoreControlStateL( |
|
146 CPbk2ViewState* aState ); |
|
147 const TDesC& FindTextL(); |
|
148 void ResetFindL(); |
|
149 void ShowThumbnail(); |
|
150 void HideThumbnail(); |
|
151 void SetBlank( |
|
152 TBool aBlank ); |
|
153 void RegisterCommand( |
|
154 MPbk2Command* aCommand ); |
|
155 void SetTextL( |
|
156 const TDesC& aText ); |
|
157 TAny* ContactUiControlExtension(TUid aExtensionUid ); |
|
158 |
|
159 public: // From MPbk2ContactUiControl2 |
|
160 TInt CommandItemCount() const; |
|
161 const MPbk2UiControlCmdItem& CommandItemAt( TInt aIndex ) const; |
|
162 const MPbk2UiControlCmdItem* FocusedCommandItem() const; |
|
163 void DeleteCommandItemL( TInt aIndex ); |
|
164 void AddCommandItemL(MPbk2UiControlCmdItem* /*aCommand*/, TInt /*aIndex*/); |
|
165 public: // implementation |
|
166 |
|
167 /** |
|
168 * |
|
169 */ |
|
170 void SetApplicationServices(CPbk2ApplicationServices* aApplicationServices); |
|
171 |
|
172 /** |
|
173 * |
|
174 */ |
|
175 CVPbkContactManager& ContactManager() const; |
|
176 |
|
177 /** |
|
178 * Helper function to get (temporary) listbox model. |
|
179 * |
|
180 * @see CCCAppDetailsViewListBoxModel |
|
181 * @return reference to listbox model object. |
|
182 */ |
|
183 CCCAppDetailsViewListBoxModel& ListBoxModel() const; |
|
184 |
|
185 private: |
|
186 |
|
187 // Called by ccapplication framework |
|
188 void ConstructL(); |
|
189 |
|
190 /** |
|
191 * See more details from CCoeControl. |
|
192 */ |
|
193 void HandleResourceChange(TInt aType); |
|
194 |
|
195 /** |
|
196 * Calls map commands. |
|
197 * |
|
198 * @param aCommandId Command id |
|
199 */ |
|
200 void DoShowMapCmdL( TPbk2CommandId aCommandId ); |
|
201 |
|
202 /* |
|
203 * Launch Call |
|
204 */ |
|
205 void HandleLaunchCallRequestL(); |
|
206 |
|
207 |
|
208 private: // data |
|
209 |
|
210 /** |
|
211 * Pointer to listbox. |
|
212 * Own. |
|
213 */ |
|
214 CAknFormDoubleGraphicStyleListBox* iListBox; |
|
215 |
|
216 /** |
|
217 * Pointer to temporary listbox model. |
|
218 * Own. |
|
219 */ |
|
220 CCCAppDetailsViewListBoxModel* iListBoxModel; |
|
221 |
|
222 /** |
|
223 * Reference to Application services. |
|
224 * Not own. |
|
225 */ |
|
226 CPbk2ApplicationServices* iAppServices; |
|
227 |
|
228 /** |
|
229 * Reference to plugin uid. |
|
230 * Not own. |
|
231 */ |
|
232 const TUid& iPluginUid; |
|
233 |
|
234 /** |
|
235 * Pointer to Pbk2 command handler. |
|
236 * Own. |
|
237 */ |
|
238 CPbk2CommandHandler* iCommandHandler; |
|
239 |
|
240 /// Ref: command in execution |
|
241 MPbk2Command* iCommand; |
|
242 |
|
243 /// Own: UI Extension manager |
|
244 CPbk2UIExtensionManager* iExtensionManager; |
|
245 |
|
246 /** |
|
247 * Reference to the cca application engine |
|
248 * not owned |
|
249 */ |
|
250 MCCAppEngine* iAppEngine; |
|
251 |
|
252 /** |
|
253 * Ref to plugin. |
|
254 * Not own. |
|
255 */ |
|
256 CCCAppDetailsViewPlugin& iPlugin; |
|
257 }; |
|
258 |
|
259 #endif // C_CCAPPDETAILSVIEWCONTAINER_H |
|
260 |
|
261 // End of File |