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 |
|
19 #ifndef CVIMPSTDETAILSVIEWCONTAINER_H |
|
20 #define CVIMPSTDETAILSVIEWCONTAINER_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <aknlists.h> |
|
25 #include <ccappviewpluginakncontainer.h> |
|
26 #include "cvimpstdetailscontacthandler.h" |
|
27 |
|
28 // forward declaration |
|
29 class CVIMPSTDetailsViewListBoxModel; |
|
30 class CVIMPSTDetailsViewBrandHandler; |
|
31 class CVIMPSTDetailsHeaderControl; |
|
32 class MEikListBoxObserver; |
|
33 class CAknsBasicBackgroundControlContext; |
|
34 class RResourceFile; |
|
35 class MVIMPSTDetailsPresenceHandler; |
|
36 class MVPbkStoreContact; |
|
37 |
|
38 // CLASS DECLARATION |
|
39 |
|
40 /** |
|
41 * Class implementing CCCAppViewPluginAknContainer interface from cca. This is |
|
42 * this class is responsible for creating the control to show |
|
43 * this creates the two control , one is header and another is list box |
|
44 * |
|
45 * @lib vimpstdetailsviewplugin.dll |
|
46 * @since S60 v5.0 |
|
47 */ |
|
48 |
|
49 class CVIMPSTDetailsViewContainer : public CCCAppViewPluginAknContainer, |
|
50 public MEikListBoxObserver |
|
51 { |
|
52 public: |
|
53 |
|
54 /** |
|
55 * Constructor. This is called from plugin class NewContainerL. |
|
56 * @param aPluginUid, plugin uid |
|
57 * @param aBrandHandler, reference to brand handler |
|
58 * @param aLaunchParameter, reference to presence handler |
|
59 * @param aFocusedListIndex, field index to focus |
|
60 */ |
|
61 CVIMPSTDetailsViewContainer(const TUid& aPluginUid, |
|
62 CVIMPSTDetailsViewBrandHandler& aBrandHandler , |
|
63 MVIMPSTDetailsPresenceHandler& aPresenceHandler, |
|
64 TInt aFocusedListIndex ); |
|
65 |
|
66 /** |
|
67 * Destructor. |
|
68 */ |
|
69 virtual ~CVIMPSTDetailsViewContainer(); |
|
70 |
|
71 public: // from base class CCCAppViewPluginAknContainer |
|
72 |
|
73 /** |
|
74 * From CCoeControl |
|
75 * (see details from baseclass ) |
|
76 * @param aRect, a rect layout |
|
77 */ |
|
78 void Draw( const TRect& aRect ) const; |
|
79 |
|
80 /** |
|
81 * From CCoeControl |
|
82 * (see details from baseclass ) |
|
83 */ |
|
84 virtual void SizeChanged(); |
|
85 |
|
86 |
|
87 /** |
|
88 * From CCoeControl |
|
89 * (see details from baseclass ) |
|
90 * @param aId, object type uid |
|
91 */ |
|
92 TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); |
|
93 |
|
94 /** |
|
95 * From CCoeControl |
|
96 * (see details from baseclass ) |
|
97 * @param aDrawNow, reference to draNow class |
|
98 */ |
|
99 void FocusChanged( TDrawNow aDrawNow ); |
|
100 |
|
101 |
|
102 /** |
|
103 * From CCCAppViewPluginAknContainer. |
|
104 * (see baseclass for details) |
|
105 * @return control count |
|
106 * @since S60 v5.0 |
|
107 */ |
|
108 TInt CountComponentControls() const; |
|
109 |
|
110 /** |
|
111 * From CCCAppViewPluginAknContainer. |
|
112 * (see baseclass for details) |
|
113 * @param aIndex, index of control |
|
114 * @return selected control |
|
115 * @since S60 v5.0 |
|
116 */ |
|
117 CCoeControl* ComponentControl(TInt aIndex) const; |
|
118 |
|
119 /** |
|
120 * From CCCAppViewPluginAknContainer. |
|
121 * (see baseclass for details) |
|
122 * @param aKeyEvent, a event |
|
123 * @param aType, a event type |
|
124 * @return key response |
|
125 * @since S60 v5.0 |
|
126 */ |
|
127 TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType); |
|
128 |
|
129 /** |
|
130 * From CCoeControl |
|
131 * (see details from baseclass ) |
|
132 * @param aContext, a reference to help context |
|
133 */ |
|
134 void GetHelpContext(TCoeHelpContext& aContext) const; |
|
135 |
|
136 /** |
|
137 * From MEikListBoxObserver |
|
138 * (see details from baseclass ) |
|
139 * @param aListBox, a pointer to list box |
|
140 * @param aEventType, alist box event type |
|
141 */ |
|
142 void HandleListBoxEventL( CEikListBox *aListBox, TListBoxEvent aEventType ); |
|
143 |
|
144 public: |
|
145 |
|
146 /** |
|
147 * Helper function to get listbox. |
|
148 * |
|
149 * @see CAknDoubleStyleListBox |
|
150 * @since S60 5.0 |
|
151 * @return reference to listbox object. |
|
152 */ |
|
153 CAknFormDoubleGraphicStyleListBox& ListBox() const; |
|
154 |
|
155 /** |
|
156 * Helper function to get (temporary) listbox model. |
|
157 * |
|
158 * @see CVIMPSTDetailsViewListBoxModel |
|
159 * @since S60 5.0 |
|
160 * @return reference to listbox model object. |
|
161 */ |
|
162 CVIMPSTDetailsViewListBoxModel& ListBoxModel() const; |
|
163 |
|
164 /** |
|
165 * called from plugin |
|
166 * notification call back from presence handler about presence change |
|
167 * @since s60 v5.0 |
|
168 */ |
|
169 void PresenceChangedL() ; |
|
170 |
|
171 /** |
|
172 * contact retrived |
|
173 * @param aContact, a contact fetched from store |
|
174 */ |
|
175 void CreatePresentationL( MVPbkStoreContact& aContact,TDesC& aServiceName,TStoreType aStoreType ) ; |
|
176 |
|
177 /** |
|
178 * show no data in view |
|
179 */ |
|
180 void CreateEmptyPresentationL() ; |
|
181 |
|
182 /** |
|
183 * create the title text based on service store typoe |
|
184 * @param aStoreType, store type |
|
185 * object is pushed on clean up stack if valid |
|
186 * @return HBufC pointer , Ownership is given to caller |
|
187 */ |
|
188 HBufC* GetTitleTextLC( TStoreType aStoreType ); |
|
189 |
|
190 private: |
|
191 |
|
192 |
|
193 // Called by ccapplication framework |
|
194 void ConstructL(); |
|
195 |
|
196 /** |
|
197 * See more details from CCoeControl. |
|
198 * @param aType, resource type |
|
199 */ |
|
200 void HandleResourceChange(TInt aType); |
|
201 |
|
202 |
|
203 private: // data |
|
204 |
|
205 /** |
|
206 * not owns : Reference to plugin uid. |
|
207 */ |
|
208 const TUid& iPluginUid; |
|
209 |
|
210 /** |
|
211 * not owns : Reference to barnd handler |
|
212 */ |
|
213 CVIMPSTDetailsViewBrandHandler& iBrandHandler; |
|
214 |
|
215 /** |
|
216 * not Owns : reference to presence |
|
217 */ |
|
218 MVIMPSTDetailsPresenceHandler& iPresenceHandler; |
|
219 |
|
220 /** |
|
221 * owns : pointer to the list box |
|
222 */ |
|
223 CAknFormDoubleGraphicStyleListBox* iListBox; |
|
224 |
|
225 /** |
|
226 * owns : pointer to the list box model |
|
227 */ |
|
228 CVIMPSTDetailsViewListBoxModel* iListBoxModel; |
|
229 |
|
230 /** |
|
231 * owns : Reference to plugin uid. |
|
232 */ |
|
233 CVIMPSTDetailsHeaderControl* iHeaderCtrl; |
|
234 |
|
235 /** |
|
236 * owns : pointer to background context |
|
237 */ |
|
238 CAknsBasicBackgroundControlContext* iBackground; |
|
239 |
|
240 /** |
|
241 * Owns : focus field index in the display list |
|
242 */ |
|
243 TInt iFocusedListIndex; |
|
244 |
|
245 /** |
|
246 * owns : resource files |
|
247 */ |
|
248 RResourceFile iResourceFile; |
|
249 |
|
250 }; |
|
251 |
|
252 #endif // CVIMPSTDETAILSVIEWCONTAINER_H |
|
253 |
|
254 // End of File |
|