|
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: MsgNaviPaneControl declaration |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CMSGNAVIPANECONTROL_H |
|
21 #define CMSGNAVIPANECONTROL_H |
|
22 |
|
23 // ========== INCLUDE FILES ================================ |
|
24 |
|
25 #include <coecntrl.h> |
|
26 #include <MuiuMessageIterator.h> // for CMessageIterator |
|
27 #include <MsgEditorCommon.h> |
|
28 |
|
29 // ========== CONSTANTS ==================================== |
|
30 |
|
31 // ========== MACROS ======================================= |
|
32 |
|
33 // ========== DATA TYPES =================================== |
|
34 |
|
35 // ========== FUNCTION PROTOTYPES ========================== |
|
36 |
|
37 // ========== FORWARD DECLARATIONS ========================= |
|
38 class CEikImage; |
|
39 class TAknsItemID; |
|
40 class TAknLayoutRect; |
|
41 class CEikLabel; |
|
42 class CMessageIterator; |
|
43 class CMsvSession; |
|
44 class TMsvEntry; |
|
45 class CCoeControlArray; |
|
46 class MMsgNaviPaneControlObserver; |
|
47 |
|
48 // ========== CLASS DECLARATION ============================ |
|
49 |
|
50 /** |
|
51 * Navigation pane control for message viewers. |
|
52 * |
|
53 * @since 5.0 |
|
54 * |
|
55 * @library CMsgEditorAppUi |
|
56 */ |
|
57 NONSHARABLE_CLASS( CMsgNaviPaneControl ) : public CCoeControl, |
|
58 public MMessageIteratorObserver |
|
59 { |
|
60 public: // Enumerations |
|
61 |
|
62 enum TMsgNaviControlId |
|
63 { |
|
64 EMsgNaviTimeControlId, |
|
65 EMsgNaviPriorityControlId, |
|
66 EMsgNaviLeftArrowControlId, |
|
67 EMsgNaviRightArrowControlId, |
|
68 EMsgNaviNavigationControlId |
|
69 }; |
|
70 |
|
71 public: // Constructors and destructor |
|
72 |
|
73 /** |
|
74 * Factory method. |
|
75 * |
|
76 * @param aParent Parent control. |
|
77 * |
|
78 * @return pointer to new CMsgNaviPaneControl object |
|
79 */ |
|
80 IMPORT_C static CMsgNaviPaneControl* NewL( const CCoeControl* aParent ); |
|
81 |
|
82 /** |
|
83 * Destructor. |
|
84 */ |
|
85 virtual ~CMsgNaviPaneControl(); |
|
86 |
|
87 public: // New functions |
|
88 |
|
89 /** |
|
90 * Sets time indicator to the control. |
|
91 * |
|
92 * @since 5.0 |
|
93 * |
|
94 * @param aTime New time |
|
95 * @param aUtcTime ETrue if given time is UTC time, |
|
96 * EFalse if given time is local time. |
|
97 */ |
|
98 IMPORT_C void SetTimeIndicatorL( TTime aTime, TBool aUtcTime = EFalse ); |
|
99 |
|
100 /** |
|
101 * Sets priority indicator to the control |
|
102 * |
|
103 * @since 5.0 |
|
104 * |
|
105 * @param aPriority New priority |
|
106 */ |
|
107 IMPORT_C void SetPriorityIndicatorL( TMsgEditorMsgPriority aPriority ); |
|
108 |
|
109 /** |
|
110 * Sets navigation indicator to the control. |
|
111 * |
|
112 * @since 5.0 |
|
113 * |
|
114 * @param aSession Message server session. |
|
115 * @param aCurrentMessage Current message entry. |
|
116 */ |
|
117 IMPORT_C void SetNavigationIndicatorL( CMsvSession& aSession, |
|
118 const TMsvEntry& aCurrentMessage ); |
|
119 |
|
120 /** |
|
121 * Sets navigation control observer. |
|
122 * |
|
123 * @since 5.0 |
|
124 * |
|
125 * @param aObserver Pointer to new observer. Setting observer to null |
|
126 * removes the observer. |
|
127 */ |
|
128 IMPORT_C void SetNavigationControlObserver( MMsgNaviPaneControlObserver* aObserver ); |
|
129 |
|
130 public: // Functions from base classes |
|
131 |
|
132 /** |
|
133 * From CoeControl |
|
134 * See the documentation from the coecntrl.h |
|
135 */ |
|
136 TInt CountComponentControls() const; |
|
137 |
|
138 /** |
|
139 * From CCoeControl |
|
140 * See the documentation from the coecntrl.h |
|
141 */ |
|
142 CCoeControl* ComponentControl( TInt aIndex ) const; |
|
143 |
|
144 /** |
|
145 * From CCoeControl |
|
146 * See the documentation from the coecntrl.h |
|
147 */ |
|
148 void SizeChanged(); |
|
149 |
|
150 /** |
|
151 * From CCoeControl |
|
152 * See the documentation from the coecntrl.h |
|
153 */ |
|
154 void PositionChanged(); |
|
155 |
|
156 /** |
|
157 * From CCoeControl |
|
158 * See the documentation from the coecntrl.h |
|
159 */ |
|
160 void HandlePointerEventL( const TPointerEvent& aPointerEvent ); |
|
161 |
|
162 /** |
|
163 * From CCoeControl |
|
164 * For handling resource change events. |
|
165 */ |
|
166 void HandleResourceChange( TInt aType ); |
|
167 |
|
168 /** |
|
169 * From MMessageIteratorObserver |
|
170 * See the documentation from the MuiuMessageIterator.h |
|
171 */ |
|
172 void HandleIteratorEventL( TMessageIteratorEvent aEvent ); |
|
173 |
|
174 private: |
|
175 |
|
176 /** |
|
177 * Default C++ constructor. |
|
178 */ |
|
179 CMsgNaviPaneControl(); |
|
180 |
|
181 /** |
|
182 * By default Symbian 2nd phase constructor is private. |
|
183 */ |
|
184 void ConstructL( const CCoeControl* aParent ); |
|
185 |
|
186 /** |
|
187 * Initializes indicator. |
|
188 */ |
|
189 void InitializeIconIndicatorL( CEikImage*& aIndicator, |
|
190 const TAknsItemID& aItem, |
|
191 const TInt aBitmapIndex, |
|
192 const TInt aMaskIndex ) const; |
|
193 |
|
194 /** |
|
195 * Sets specified icons extent to given one. |
|
196 */ |
|
197 void SetIconIndicatorExtent( CEikImage* aIconIndicator, |
|
198 const TAknLayoutRect& aExtent) const; |
|
199 |
|
200 /** |
|
201 * Sets correct layout for all indicators. |
|
202 */ |
|
203 void LayoutIndicators(); |
|
204 |
|
205 /** |
|
206 * Sets correct layout for navigation indicator. |
|
207 */ |
|
208 void LayoutNavigationIndicators(); |
|
209 |
|
210 /** |
|
211 * Sets correct layout for priority indicator. |
|
212 */ |
|
213 void LayoutPriorityIndicator(); |
|
214 |
|
215 /** |
|
216 * Sets correct layout for time indicator. |
|
217 */ |
|
218 void LayoutTimeIndicator(); |
|
219 |
|
220 /** |
|
221 * Updates navigation indicators (left and right arrows and message icon) |
|
222 * according to current message count. |
|
223 */ |
|
224 void UpdateNavigationIndicatorsL(); |
|
225 |
|
226 /** |
|
227 * Updates priority indicator according to current priority. |
|
228 */ |
|
229 void UpdatePriorityIndicatorL(); |
|
230 |
|
231 /** |
|
232 * Updates time indicator according to current time. |
|
233 */ |
|
234 void UpdateTimeIndicatorL(); |
|
235 |
|
236 /** |
|
237 * Adds control to controls array |
|
238 */ |
|
239 void AddToControlArrayL( CCoeControl* aControl, TMsgNaviControlId aControlId ); |
|
240 |
|
241 /** |
|
242 * Adds control to controls array |
|
243 */ |
|
244 void RemoveFromControlArray( TMsgNaviControlId aControlId ); |
|
245 |
|
246 /** |
|
247 * Handles skin change event. |
|
248 */ |
|
249 void HandleSkinChangeL(); |
|
250 /** |
|
251 * Updates the vaient type(between 1..4) to be used for Right left arrows and touch layouts |
|
252 */ |
|
253 void UpdateVarientId(); |
|
254 |
|
255 private: // data |
|
256 |
|
257 /** Message time */ |
|
258 TTime iTime; |
|
259 |
|
260 /** Message priority */ |
|
261 TMsgEditorMsgPriority iPriority; |
|
262 |
|
263 /** Message iterator */ |
|
264 CMessageIterator* iMessageIterator; |
|
265 |
|
266 /** Control array */ |
|
267 CCoeControlArray* iControlArray; |
|
268 |
|
269 /** Used to keep track of focused control between pointer events. */ |
|
270 CCoeControl* iPreviouslyFocusedControl; |
|
271 |
|
272 /** Control observer. */ |
|
273 MMsgNaviPaneControlObserver* iObserver; |
|
274 |
|
275 /** Touch areas from LAF for arrow icons */ |
|
276 TRect iLeftArrowTouchRect; |
|
277 TRect iRightArrowTouchRect; |
|
278 TBool iPriorityIndicator; |
|
279 TInt iVarientId; |
|
280 }; |
|
281 |
|
282 #endif // CMSGNAVIPANECONTROL_H |
|
283 |
|
284 // End of File |