|
1 /* |
|
2 * Copyright (c) 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: Container class for Events Management UI startup view view. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_EVTMGMTUISTARTUPCONTAINER_H |
|
20 #define C_EVTMGMTUISTARTUPCONTAINER_H |
|
21 |
|
22 // SYSTEM INCLUDES |
|
23 #include <coecntrl.h> |
|
24 #include <eiklbo.h> |
|
25 |
|
26 #include "evtdefs.h" |
|
27 #include "evtmgmtuicmdhdlr.h" |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CAknIconArray; |
|
31 class CEvtMgmtUiListBox; |
|
32 class CEvtMgmtUiModel; |
|
33 class CEikMenuPane; |
|
34 class CAknSearchField; |
|
35 /** |
|
36 * Events management UI start-up view's container class. This class is |
|
37 * the chief windowing component of Events management UI start-up view |
|
38 * |
|
39 * @lib evtmgmtui.exe |
|
40 * @since S60 v5.0 |
|
41 */ |
|
42 class CEvtMgmtUiStartupContainer : public CCoeControl, |
|
43 public MEikListBoxObserver |
|
44 { |
|
45 public: |
|
46 /** |
|
47 * Static Two phase constructor |
|
48 * |
|
49 * @param[in] aRect, Client Rectangle for this window owning control. |
|
50 */ |
|
51 static CEvtMgmtUiStartupContainer* NewL( const TRect& aRect, CEvtMgmtUiModel* aModel, |
|
52 MEvtMgmtUiCmdHdlr& aCmdHandler ); |
|
53 |
|
54 /** |
|
55 * Virtual destructor |
|
56 */ |
|
57 ~CEvtMgmtUiStartupContainer(); |
|
58 |
|
59 /** |
|
60 * Returns the help context |
|
61 * |
|
62 * @param aContext The help context that has to be determined |
|
63 */ |
|
64 void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
65 |
|
66 public : //New functions |
|
67 |
|
68 /** |
|
69 * Update listbox |
|
70 */ |
|
71 void UpdateListBoxL(TInt aSelectedItemIndex); |
|
72 |
|
73 /** |
|
74 * Return the index of the selected item |
|
75 */ |
|
76 TInt CurrentItemIndex(); |
|
77 |
|
78 /** |
|
79 * Set the Title text |
|
80 */ |
|
81 void MakeTitleL(); |
|
82 |
|
83 /** |
|
84 * It will handle mark functionality. |
|
85 */ |
|
86 void HandleMarkCmdL( TInt aIndex, TBool aIsMarked ); |
|
87 |
|
88 /** |
|
89 * It will display mark menu items dynamically. |
|
90 */ |
|
91 void HandleMarkableListDynInitMenuPane(TInt aResourceId, CEikMenuPane *aMenu); |
|
92 |
|
93 /* |
|
94 * It will return count of marked items |
|
95 */ |
|
96 TInt NumberOfMarkedItems(); |
|
97 |
|
98 /* |
|
99 * It will return marked items |
|
100 */ |
|
101 const CArrayFix<TInt>* MarkItems(); |
|
102 |
|
103 /* |
|
104 * It will return Filtered Index of the passed index |
|
105 */ |
|
106 TInt FilteredIndex(TInt aIndex); |
|
107 |
|
108 /* |
|
109 * It will return Filtered number of list items |
|
110 */ |
|
111 TInt FilteredCount(); |
|
112 |
|
113 private: //new functions |
|
114 |
|
115 /** |
|
116 * Creates the List box and List box model. |
|
117 */ |
|
118 void CreateListboxL(CEvtMgmtUiModel* aModel); |
|
119 |
|
120 /** |
|
121 * Creates the Find Box. |
|
122 */ |
|
123 void CreateFindBoxL(); |
|
124 |
|
125 /** |
|
126 * Check for FindBox Visibilty. |
|
127 */ |
|
128 void HandleFindBoxVisibility(); |
|
129 |
|
130 /** |
|
131 * Update icons |
|
132 */ |
|
133 void UpdateIconsL(); |
|
134 |
|
135 /** |
|
136 * Append icon to icon array. CAknIconArray owns icons so it is |
|
137 * easier to it leave safely. |
|
138 * @param aIcons icon array |
|
139 * @param aIconFileWithPath icon file name with path |
|
140 * @param aSkinID skin id of the icon |
|
141 * @param aIconGraphicsIndex picture index |
|
142 * @param aIconGraphicsMaskIndex mask index |
|
143 */ |
|
144 void AddIconL( CAknIconArray& aIcons, |
|
145 const TDesC& aIconFileWithPath, |
|
146 TAknsItemID aSkinID, |
|
147 TInt aIconGraphicsIndex, |
|
148 TInt aIconGraphicsMaskIndex ); |
|
149 |
|
150 /** |
|
151 * Append Color icon to icon array. CAknIconArray owns icons so it is |
|
152 * easier to it leave safely. |
|
153 * @param aIcons icon array |
|
154 * @param aIconFileWithPath icon file name with path |
|
155 * @param aSkinID skin id of the icon |
|
156 * @param aIconGraphicsIndex picture index |
|
157 * @param aIconGraphicsMaskIndex mask index |
|
158 */ |
|
159 void AddColorIconL( CAknIconArray& aIcons, |
|
160 const TDesC& aIconFileWithPath, |
|
161 TAknsItemID aSkinID, |
|
162 TInt aIconGraphicsIndex, |
|
163 TInt aIconGraphicsMaskIndex ); |
|
164 |
|
165 /** |
|
166 * Gets Events Management UI icon file path and name. Ownership |
|
167 * is transferred, item is left in the cleanup stack. |
|
168 * @return TFileName* The full name of the Events UI icon file. |
|
169 */ |
|
170 TFileName* IconFileNameLC() const; |
|
171 |
|
172 |
|
173 |
|
174 protected: // Inherited from Base classes |
|
175 /** |
|
176 * Inherited from CCoeControl |
|
177 */ |
|
178 void SizeChanged(); |
|
179 |
|
180 /** |
|
181 * Inherited from CCoeControl |
|
182 */ |
|
183 void FocusChanged( TDrawNow aDrawNow ); |
|
184 |
|
185 /** |
|
186 * Inherited from CCoeControl |
|
187 */ |
|
188 TInt CountComponentControls() const; |
|
189 |
|
190 /** |
|
191 * Inherited from CCoeControl |
|
192 */ |
|
193 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
194 |
|
195 /** |
|
196 * Inherited from CCoeControl |
|
197 */ |
|
198 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, |
|
199 TEventCode aType ); |
|
200 |
|
201 /** |
|
202 * Inherited from CCoeControl |
|
203 */ |
|
204 void HandleResourceChange( TInt aType ); |
|
205 |
|
206 /** |
|
207 * Inherited from MEikListBoxObserver |
|
208 */ |
|
209 void HandleListBoxEventL( CEikListBox* aListBox, |
|
210 TListBoxEvent aEventType ); |
|
211 |
|
212 private: |
|
213 |
|
214 /** |
|
215 * C++ Default constructor |
|
216 */ |
|
217 CEvtMgmtUiStartupContainer(MEvtMgmtUiCmdHdlr& aCmdHandler); |
|
218 |
|
219 /** |
|
220 * Second phase of the two phase constructor |
|
221 */ |
|
222 void ConstructL( const TRect& aRect, CEvtMgmtUiModel* aModel ); |
|
223 |
|
224 private: |
|
225 /** |
|
226 * List box |
|
227 * Owns |
|
228 */ |
|
229 CEvtMgmtUiListBox* iListBox; |
|
230 |
|
231 /** |
|
232 * Find box |
|
233 * Owns |
|
234 */ |
|
235 CAknSearchField* iFindBox; |
|
236 |
|
237 /** |
|
238 * Help context |
|
239 */ |
|
240 TCoeContextName iContextName; |
|
241 |
|
242 /** |
|
243 * Command Handler |
|
244 */ |
|
245 MEvtMgmtUiCmdHdlr& iCmdHandler; |
|
246 |
|
247 /** |
|
248 * List Model Count before List model is updated. |
|
249 */ |
|
250 TInt iPrevCount; |
|
251 |
|
252 }; |
|
253 |
|
254 #endif // C_EVTMGMTUISTARTUPCONTAINER_H |
|
255 |
|
256 // End of File |