|
1 /* |
|
2 * Copyright (c) 2010 Ixonos Plc. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "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 * Ixonos Plc |
|
14 * |
|
15 * Description: |
|
16 * ImageEditor container class header file. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef IMAGEEDITORUICONTAINER_H |
|
22 #define IMAGEEDITORUICONTAINER_H |
|
23 |
|
24 |
|
25 // INCLUDES |
|
26 #include <coecntrl.h> |
|
27 |
|
28 #include "ImageEditorUIView.h" |
|
29 #include <AknNaviDecoratorObserver.h> |
|
30 |
|
31 #ifdef RD_TACTILE_FEEDBACK |
|
32 class MTouchFeedback; |
|
33 #endif /* RD_TACTILE_FEEDBACK */ |
|
34 |
|
35 // FORWARD DECLARATIONS |
|
36 class CImageEditorControlBase; |
|
37 class CFbsBitmap; |
|
38 class CPluginInfo; |
|
39 class CAknsBasicBackgroundControlContext; |
|
40 class CWaitIndicator; |
|
41 |
|
42 /* CLASS: CImageEditorUIContainer |
|
43 * |
|
44 * Container control for Image Editor UI. |
|
45 * |
|
46 */ |
|
47 class CImageEditorUIContainer : public CCoeControl, |
|
48 public MCoeControlObserver, |
|
49 public MAknNaviDecoratorObserver |
|
50 { |
|
51 |
|
52 public: |
|
53 |
|
54 /** @name Methods:*/ |
|
55 //@{ |
|
56 |
|
57 /* Second phase constructor |
|
58 * |
|
59 * @param aRect - frame rectangle for container |
|
60 * @return |
|
61 */ |
|
62 void ConstructL (const TRect & aRect); |
|
63 |
|
64 /* Destructor |
|
65 * |
|
66 * @param - |
|
67 * @return - |
|
68 */ |
|
69 ~CImageEditorUIContainer(); |
|
70 |
|
71 /* SetImage |
|
72 * |
|
73 * Set bitmap for preview pane. |
|
74 * |
|
75 * @param aBitmap - pointer to bitmap image |
|
76 * @return - |
|
77 */ |
|
78 void SetImageL (CFbsBitmap * aBitmap); |
|
79 |
|
80 /* SetControl |
|
81 * |
|
82 * Set plug-in control to UI. |
|
83 * |
|
84 * @param aControl - plug-in control |
|
85 * @return - |
|
86 */ |
|
87 void SetControl (CCoeControl * aControl); |
|
88 |
|
89 /* Setter for view reference, non-const |
|
90 * |
|
91 * @param aView - CImageEditorUIView pointer |
|
92 * @return - |
|
93 */ |
|
94 void SetView (CImageEditorUIView * aView); |
|
95 |
|
96 /* OfferKeyEventL |
|
97 * |
|
98 * Handles key events. When a key event occurs, the control framework |
|
99 * calls this function for each control on the control stack, until one |
|
100 * of them can process the key event (and returns EKeyWasConsumed). |
|
101 * |
|
102 * @param aKeyEvent - the key event |
|
103 * @param aType - type of key event |
|
104 * @return indicator for event to be handled |
|
105 */ |
|
106 virtual TKeyResponse OfferKeyEventL ( |
|
107 const TKeyEvent & aKeyEvent, |
|
108 TEventCode aType |
|
109 ); |
|
110 |
|
111 /* HandlePointerEventL |
|
112 * |
|
113 * Handles pointer events gotten from the framework. This function gets |
|
114 * called whenever a pointer event occurs in the control. |
|
115 * |
|
116 * @param aKeyEvent - the key event |
|
117 * @return - |
|
118 */ |
|
119 virtual void CImageEditorUIContainer::HandlePointerEventL( |
|
120 const TPointerEvent &aPointerEvent ); |
|
121 |
|
122 /* CountComponentControls |
|
123 * |
|
124 * Gets the number of controls in compound control. |
|
125 * |
|
126 * @param - |
|
127 * @return number of controls |
|
128 * @see CoeControl |
|
129 */ |
|
130 TInt CountComponentControls() const; |
|
131 |
|
132 /* ComponentControl |
|
133 * |
|
134 * Gets special component control indexed with aIndex. |
|
135 * |
|
136 * @param aIndex - component control index |
|
137 * @return pointer to component control |
|
138 * @see CoeControl |
|
139 */ |
|
140 CCoeControl * ComponentControl (TInt aIndex) const; |
|
141 |
|
142 /* SetBusy |
|
143 * |
|
144 * Sets busy, when busy UI does not handle key events. |
|
145 * |
|
146 * @param - |
|
147 * @return - |
|
148 */ |
|
149 void SetBusy(); |
|
150 |
|
151 /* ResetBusy |
|
152 * |
|
153 * Resets busy, when busy UI does not handle key events. |
|
154 * |
|
155 * @param - |
|
156 * @return - |
|
157 */ |
|
158 void ResetBusy(); |
|
159 |
|
160 /* Busy |
|
161 * |
|
162 * Returns the busy value, when busy UI does not handle key events |
|
163 * |
|
164 * @param - |
|
165 * @return - |
|
166 */ |
|
167 TBool Busy() const; |
|
168 |
|
169 /* SetFullScreen |
|
170 * |
|
171 * Sets full screen flag. When full screen flag is set, the view is in |
|
172 * full screen mode. Normal screen item is shown in menu. |
|
173 * |
|
174 * @param - |
|
175 * @return - |
|
176 */ |
|
177 void SetFullScreen(); |
|
178 |
|
179 /* ResetFullScreen |
|
180 * |
|
181 * Resets full screen flag. When full screen flag is reset, the view is |
|
182 * in normal screen mode. Full screen item is shown in menu. |
|
183 * |
|
184 * @param - |
|
185 * @return - |
|
186 */ |
|
187 void ResetFullScreen(); |
|
188 |
|
189 /* GetHelpContext |
|
190 * |
|
191 * @see CCoeControl |
|
192 * |
|
193 */ |
|
194 virtual void GetHelpContext(TCoeHelpContext& aContext) const; |
|
195 |
|
196 /* GetDragDirections |
|
197 * |
|
198 * Resets full screen flag. When full screen flag is reset, the view is |
|
199 * in normal screen mode. Full screen item is shown in menu. |
|
200 * |
|
201 * @since S60 v5.0 |
|
202 * @param - xMovement x-directional change on screen |
|
203 * @param - yMovement y-directional change on screen |
|
204 * @return - |
|
205 */ |
|
206 void GetDragDirections( TInt& xMovement, TInt& yMovement ); |
|
207 |
|
208 //@} |
|
209 |
|
210 public: //From MAknNaviDecoratorObserver |
|
211 |
|
212 /* HandleNaviDecoratorEventL |
|
213 * |
|
214 * Method for handling touch events on navigator (navi pane) |
|
215 * |
|
216 * @since S60 v5.0 |
|
217 * @param aEventID Id of the event. |
|
218 * |
|
219 */ |
|
220 void HandleNaviDecoratorEventL( TInt aEventID ); |
|
221 |
|
222 void ShowWaitNote(); |
|
223 |
|
224 void HideWaitNote(); |
|
225 |
|
226 protected: |
|
227 |
|
228 /** @name Methods:*/ |
|
229 //@{ |
|
230 |
|
231 /* SizeChanged |
|
232 * |
|
233 * Sets the size and position of the contents of the container according |
|
234 * to container size changes. This methods is called whenever SetExtent, |
|
235 * SetSize, SetRect, SetCornerAndSize or SetExtentToWholeScreen is called. |
|
236 * |
|
237 * @param - |
|
238 * @return - |
|
239 * @see CoeControl |
|
240 */ |
|
241 virtual void SizeChanged(); |
|
242 |
|
243 /* MopSupplyObject |
|
244 * |
|
245 * @see CoeControl |
|
246 */ |
|
247 virtual TTypeUid::Ptr MopSupplyObject( TTypeUid aId ); |
|
248 |
|
249 |
|
250 //@} |
|
251 |
|
252 /** @name Members:*/ |
|
253 //@{ |
|
254 //@} |
|
255 |
|
256 private: |
|
257 |
|
258 /** @name Methods:*/ |
|
259 //@{ |
|
260 |
|
261 /* Draw |
|
262 * |
|
263 * Draw controls, called by window server. |
|
264 * |
|
265 * @param aRect - region of control in need of redrawing |
|
266 * @return - |
|
267 * @see CoeControl |
|
268 */ |
|
269 void Draw (const TRect & aRect) const; |
|
270 |
|
271 /* HandleControlEventL |
|
272 * |
|
273 * Handles an event sent from the observed (this control being observer). |
|
274 * |
|
275 * @param aControl - pointer to control that sent the event |
|
276 * @param aEventType - control event type |
|
277 * @return - |
|
278 * @see MCoeControlObserver |
|
279 */ |
|
280 void HandleControlEventL ( |
|
281 CCoeControl * aControl, |
|
282 TCoeEvent aEventType |
|
283 ); |
|
284 |
|
285 //@} |
|
286 |
|
287 /** @name Members:*/ |
|
288 //@{ |
|
289 /// Reference to the view class |
|
290 CImageEditorUIView * iEditorView; |
|
291 /// Preview image |
|
292 CFbsBitmap * iPreview; |
|
293 /// Plug-in control |
|
294 CCoeControl * iControl; |
|
295 /// Editor rectangle |
|
296 TRect iEditorRect; |
|
297 // Busy flag |
|
298 TBool iBusy; |
|
299 // Full screen flag |
|
300 TBool iFullScreen; |
|
301 |
|
302 /// Control context that provides a layout background with a |
|
303 /// background bitmap and its layout rectangle. |
|
304 CAknsBasicBackgroundControlContext* iBgContext; |
|
305 |
|
306 //TouchPan enablers |
|
307 TPoint iTappedPosition; |
|
308 TInt iXDirChange; |
|
309 TInt iYDirChange; |
|
310 |
|
311 // Wait indicator (own) |
|
312 CWaitIndicator* iWaitIndicator; |
|
313 |
|
314 // Feedback for screen touch: |
|
315 #ifdef RD_TACTILE_FEEDBACK |
|
316 MTouchFeedback* iTouchFeedBack; |
|
317 #endif /* RD_TACTILE_FEEDBACK */ |
|
318 |
|
319 //@} |
|
320 }; |
|
321 |
|
322 #endif |
|
323 |
|
324 // End of File |