|
1 /* |
|
2 * Copyright (c) 2005-2006 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: Implements Xuikon image component. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef _XNBITMAPADAPTER_H |
|
21 #define _XNBITMAPADAPTER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include "xncontroladapter.h" |
|
25 |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CXnNodePluginIf; |
|
29 |
|
30 // CLASS DECLARATION |
|
31 /** |
|
32 * @ingroup group_xnbitmapfactory |
|
33 * @lib xn3bitmapfactory.dll |
|
34 * @since Series 60 3.1 |
|
35 */ |
|
36 class CXnBitmapAdapter : public CXnControlAdapter |
|
37 { |
|
38 public: |
|
39 /** |
|
40 * 2 phase construction. |
|
41 */ |
|
42 static CXnBitmapAdapter* NewL(CXnNodePluginIf& aNode); |
|
43 |
|
44 /** |
|
45 * Destructor. |
|
46 */ |
|
47 virtual ~CXnBitmapAdapter(); |
|
48 |
|
49 |
|
50 public: // New functions |
|
51 /** |
|
52 * Sets content bitmaps. Ownership is transferred. |
|
53 * @since Series 60 3.1 |
|
54 * @param aBitmap Bitmap to draw |
|
55 * @param aMask Mask to use |
|
56 */ |
|
57 void SetContentBitmaps(CFbsBitmap* aBitmap, CFbsBitmap* aMask); |
|
58 |
|
59 /** |
|
60 * Gets content bitmaps. Ownership not is transferred. |
|
61 * @since Series 60 3.1 |
|
62 * @param aBitmap Bitmap to draw |
|
63 * @param aMask Mask to use |
|
64 */ |
|
65 void ContentBitmaps(CFbsBitmap*& aBitmap, CFbsBitmap*& aMask); |
|
66 |
|
67 public: // From Base classes |
|
68 /** |
|
69 * From CXnControlAdapter Handles the property changes. |
|
70 * @since Series 60 3.1 |
|
71 * @return void. |
|
72 */ |
|
73 void DoHandlePropertyChangeL(CXnProperty* aProperty = NULL); |
|
74 |
|
75 /** |
|
76 * From CCoeControl Handles the resource change. |
|
77 * @since Series 60 3.1 |
|
78 * @param aType A type of the resource change |
|
79 * @return void. |
|
80 */ |
|
81 void HandleScreenDeviceChangedL(); |
|
82 |
|
83 /** |
|
84 * See CCoeControl documentation |
|
85 */ |
|
86 void HandlePointerEventL( const TPointerEvent& aPointerEvent ); |
|
87 /** |
|
88 * From CCoeControl Handles the skin change |
|
89 * @since Series 60 3.2 |
|
90 * @return void. |
|
91 */ |
|
92 void SkinChanged(); |
|
93 |
|
94 protected: |
|
95 /** |
|
96 * Size change notification |
|
97 */ |
|
98 void SizeChanged(); |
|
99 void Draw(const TRect& aRect) const; |
|
100 |
|
101 private: |
|
102 CXnBitmapAdapter(CXnNodePluginIf& aNode); |
|
103 void ConstructL(CXnNodePluginIf& aNode); |
|
104 |
|
105 void InitializeBitmapsL(); |
|
106 private: // Data |
|
107 // UI node, not owned |
|
108 CXnNodePluginIf& iNode; |
|
109 // Whether the bitmaps has been loaded or not. |
|
110 mutable TBool iAreBitmapsLoaded; |
|
111 // Whether the data API has been used or not. |
|
112 TBool iAreBitmapsSet; |
|
113 // Path of the bitmap |
|
114 HBufC* iPath; |
|
115 // The size of the current bitmap |
|
116 TSize iBitmapSize; |
|
117 // The path of the fallback image |
|
118 HBufC* iFallbackPath; |
|
119 // Whether fallback path has changed and bitmaps need to be reloaded |
|
120 TBool iFallbackPathChange; |
|
121 }; |
|
122 |
|
123 |
|
124 |
|
125 #endif // XNBITMAPADAPTER_H |
|
126 |
|
127 // End of File |