21 #include <coecntrl.h> |
21 #include <coecntrl.h> |
22 #include "eikscrlb.h" |
22 #include "eikscrlb.h" |
23 |
23 |
24 #include "AknDoubleSpanScrollIndicatorItem.h" |
24 #include "AknDoubleSpanScrollIndicatorItem.h" |
25 |
25 |
|
26 class CAknDoubleSpanScrollIndicatorBGExtension; |
|
27 |
|
28 NONSHARABLE_CLASS( TBitmapFx ) |
|
29 { |
|
30 public: |
|
31 struct TRGB |
|
32 { |
|
33 TInt iR; |
|
34 TInt iG; |
|
35 TInt iB; |
|
36 }; |
|
37 struct THSL |
|
38 { |
|
39 TInt iH; |
|
40 TInt iS; |
|
41 TInt iL; |
|
42 }; |
|
43 |
|
44 static void PixelEffect( TUint16* aPixelData ); |
|
45 static TInt HueToRGB( TInt v1, TInt v2, TInt aH ); |
|
46 }; |
|
47 |
26 NONSHARABLE_CLASS(CAknDoubleSpanScrollIndicator) : public CCoeControl |
48 NONSHARABLE_CLASS(CAknDoubleSpanScrollIndicator) : public CCoeControl |
27 { |
49 { |
28 public: // public construction and destruction methods |
50 public: // public construction and destruction methods |
29 |
51 |
30 /** |
52 /** |
195 * @return ETrue, if the handle highlight is on. |
217 * @return ETrue, if the handle highlight is on. |
196 */ |
218 */ |
197 TBool HandleHighlight() const; |
219 TBool HandleHighlight() const; |
198 |
220 |
199 /** |
221 /** |
|
222 * Sets the touch area control. |
|
223 * |
|
224 * @since 5.0 |
|
225 * @param aTouchAreaControl A pointer to the control which is drawn |
|
226 * along with this indicator. |
|
227 */ |
|
228 void SetTouchAreaControl( CCoeControl* aTouchAreaControl ); |
|
229 |
|
230 /** |
200 * Sets the background drag highlight. |
231 * Sets the background drag highlight. |
201 * |
232 * |
202 * @since 5.0 |
233 * @since 5.0 |
203 * @param aHandleHighlight If ETrue, turn the handle highlight on. |
234 * @param aHandleHighlight If ETrue, turn the handle highlight on. |
204 */ |
235 */ |
253 * |
284 * |
254 * @since 2.6 |
285 * @since 2.6 |
255 */ |
286 */ |
256 void CreateScrollBarItemsL(); |
287 void CreateScrollBarItemsL(); |
257 |
288 |
258 TInt HandleMaxSizeInPixels(); |
289 TInt ScrollHandleMaxVisibleSizeInPixels(); |
|
290 TInt HandleBackgroundMinSizeInPixels(); |
259 TInt HandleMinSizeInPixels(); |
291 TInt HandleMinSizeInPixels(); |
260 |
292 |
261 /** |
293 /** |
262 * Handles background drawing |
294 * Handles background drawing |
263 * |
295 * |
264 * @since 3.1 |
296 * @since 3.1 |
265 * |
297 * |
266 */ |
298 */ |
267 void DrawBackground() const; |
299 void DrawBackground() const; |
|
300 |
|
301 /** |
|
302 * Handles background bitmap creation for window owning scrollbar |
|
303 * |
|
304 * @since 3.1 |
|
305 * |
|
306 */ |
|
307 void CreateBackgroundBitmapL(); |
|
308 |
|
309 /** |
|
310 * Layout scrollbar handle |
|
311 * |
|
312 * @since 3.1 |
|
313 * |
|
314 */ |
|
315 void LayoutHandleGraphics(); |
|
316 |
|
317 /** |
|
318 * Used for highlighting handle skin graphics. Takes a bitmap, creates |
|
319 * a copy and optionally applies an effect for the pixels in the |
|
320 * bitmap. Returns the new bitmap, so caller must take ownership. |
|
321 * Note that the effect only works for EColor64K bitmaps. |
|
322 * |
|
323 * @since 5.0 |
|
324 * @param aSource The source bitmap. |
|
325 * @param aCopyOnly If ETrue, doesn't apply effect. |
|
326 * @return The new bitmap. |
|
327 */ |
|
328 CFbsBitmap* CopyAndApplyEffectL( const CFbsBitmap* aSource, TBool aCopyOnly = EFalse ); |
268 |
329 |
269 CAknDoubleSpanScrollIndicatorItem* LoadScrollIndicatorItemL( |
330 CAknDoubleSpanScrollIndicatorItem* LoadScrollIndicatorItemL( |
270 const TAknsItemID &aTopId, |
331 const TAknsItemID &aTopId, |
271 const TAknsItemID &aMidId, |
332 const TAknsItemID &aMidId, |
272 const TAknsItemID &aBottomId); |
333 const TAknsItemID &aBottomId); |
282 TInt iFocusPosition; // Position of the current field in the list. |
343 TInt iFocusPosition; // Position of the current field in the list. |
283 TInt iWindowSize; // Size of the visible part of the list. |
344 TInt iWindowSize; // Size of the visible part of the list. |
284 TInt iFieldPosition; // Size of the current field. (Optional double span) |
345 TInt iFieldPosition; // Size of the current field. (Optional double span) |
285 TInt iFieldSize; // Position inside the current field. (Optional double span) |
346 TInt iFieldSize; // Position inside the current field. (Optional double span) |
286 TBool iOwnsWindow; // Is window owning |
347 TBool iOwnsWindow; // Is window owning |
|
348 TInt iSpare; |
287 |
349 |
288 TRect iBackgroundRect; // Rect for scrollbar background. |
350 TRect iBackgroundRect; // Rect for scrollbar background. |
289 TRect iHandleBackgroundRect; // Rect for scrollbar handle background. |
351 TRect iHandleBackgroundRect; // Rect for scrollbar handle background. |
290 TRect iHandleRect; // Rect for scrollbar handle. |
352 TRect iHandleRect; // Rect for scrollbar handle. |
291 |
353 |
292 TBool iTransparentBackground; // A flag which tells if we have transparent bg |
354 TBool iTransparentBackground; // A flag which tells if we have transparent bg |
293 TBool iDrawBackground; // do we draw any background |
355 TBool iDrawBackground; // do we draw any background |
294 TBool iForceDrawBackground; // draw background |
|
295 |
356 |
296 TBool iHandleHighlight; // is handle drag highlight on? |
357 TBool iHandleHighlight; // is handle drag highlight on? |
297 |
358 |
298 TBool iBackgroundHighlight; //is background highlight on? |
359 TBool iBackgroundHighlight; //is background highlight on? |
299 |
360 |
|
361 |
|
362 mutable TBool iDrawBackgroundBitmap; // do we draw the background to the background bitmap before it is drawn |
300 TRect iOldRect; // the old scb retangle, to optimize unneccessary resizing |
363 TRect iOldRect; // the old scb retangle, to optimize unneccessary resizing |
301 |
364 |
302 CEikScrollBar::TOrientation iOrientation; // Vertical or horizontal scrollbar |
365 CEikScrollBar::TOrientation iOrientation; // Vertical or horizontal scrollbar |
303 |
366 |
304 CAknDoubleSpanScrollIndicatorItem* iBackgroundBar; |
367 CAknDoubleSpanScrollIndicatorItem* iBackgroundBar; |
305 CAknDoubleSpanScrollIndicatorItem* iHighlightBackgroundBar; |
368 CAknDoubleSpanScrollIndicatorItem* iHighlightBackgroundBar; |
306 CAknDoubleSpanScrollIndicatorItem* iHandleBar; |
369 CAknDoubleSpanScrollIndicatorItem* iHandleBar; |
307 CAknDoubleSpanScrollIndicatorItem* iHighlightHandleBar; |
370 CAknDoubleSpanScrollIndicatorItem* iHighlightHandleBar; |
308 |
371 |
|
372 |
309 TInt iHeadItemSize; |
373 TInt iHeadItemSize; |
|
374 TInt iMidItemSize; |
310 TInt iTailItemSize; |
375 TInt iTailItemSize; |
311 |
376 |
312 /** |
377 CCoeControl* iTouchAreaControl; // Not own. |
313 * Minimum handle size. |
|
314 */ |
|
315 TInt iHandleMinSize; |
|
316 |
|
317 /** |
|
318 * Maximum handle size. |
|
319 */ |
|
320 TInt iHandleMaxSize; |
|
321 }; |
378 }; |
322 |
379 |
323 #endif |
380 #endif |
324 |
381 |