|
1 /* |
|
2 * Copyright (c) 2005 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: Class definition for the background image API |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef BACKGROUNDIMAGE_H |
|
22 #define BACKGROUNDIMAGE_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <centralrepository.h> |
|
26 #include <fbs.h> |
|
27 |
|
28 #include <RPhCltServer.h> |
|
29 #include "gsasyncimagehandling.h" |
|
30 |
|
31 |
|
32 // CONSTANTS |
|
33 const TInt KGSBackgroundImageValue = 0; |
|
34 |
|
35 // DATA TYPES |
|
36 enum TGSWallpaperType |
|
37 { |
|
38 EGSWallpaperIdle, |
|
39 EGSWallpaperPinboard, |
|
40 EGSWallpaperWelcome, |
|
41 EGSVTStillImage |
|
42 }; |
|
43 |
|
44 // FORWARD DECLARATIONS |
|
45 class RSharedDataClient; |
|
46 |
|
47 // CLASS DECLARATION |
|
48 |
|
49 /** |
|
50 * CGSBackgroundImage is the background image API class of GS app. |
|
51 * It provides functions to get and set background image values. |
|
52 */ |
|
53 class CGSBackgroundImage : public CBase |
|
54 { |
|
55 public: // Constructors and destructor |
|
56 |
|
57 /** |
|
58 * Two-phased constructor. |
|
59 */ |
|
60 IMPORT_C static CGSBackgroundImage* NewL(); |
|
61 |
|
62 /** |
|
63 * Destructor. |
|
64 */ |
|
65 IMPORT_C ~CGSBackgroundImage(); |
|
66 |
|
67 public: // New functions |
|
68 |
|
69 /** |
|
70 * Returns background image mode. |
|
71 * @return 0: no image |
|
72 * 1: image |
|
73 */ |
|
74 IMPORT_C TInt BackgroundImageL(); |
|
75 |
|
76 /** |
|
77 * Stores background image mode to shared data. |
|
78 * @param aImage Background image mode. |
|
79 */ |
|
80 IMPORT_C void SetBackgroundImageL(const TInt aImage); |
|
81 |
|
82 /** |
|
83 * Converts an idle background image to bitmap and scales it to fit the |
|
84 * screen if necessary. |
|
85 * |
|
86 * After successful conversion, the background image path is stored |
|
87 * into shared data. |
|
88 * |
|
89 * @param aImagePath Descriptor which contains the background image |
|
90 * path. Max length is KGSMaxImagePath. |
|
91 */ |
|
92 IMPORT_C void SetBackgroundImagePathL(const TDesC& aImagePath); |
|
93 |
|
94 /** |
|
95 * Converts an idle background image to bitmap, scales it to fit the |
|
96 * screen if necessary, and stores it to the given file. |
|
97 * |
|
98 * Background image path is not stored into shared data, but must be |
|
99 * set separately. |
|
100 * |
|
101 * @param aImagePath Descriptor which contains the background image |
|
102 * path. Max length is KGSMaxImagePath. |
|
103 * @param aBmpFileName Descriptor which contains the bitmap file name. |
|
104 * Converted image is again stored back in this variable. |
|
105 */ |
|
106 IMPORT_C void SetBackgroundImagePathL(const TDesC& aImagePath, |
|
107 TDes& aBmpFileName); |
|
108 |
|
109 /** |
|
110 * Converts the welcome note image to bitmap, scales it to fit the screen if |
|
111 * necessary. |
|
112 * Stores the bitmap to mbm file. Stores welcome note image path to shared data. |
|
113 * |
|
114 * @param aImagePath Descriptor which contains the welcome note image path. |
|
115 * Max length is KGSMaxImagePath. |
|
116 */ |
|
117 IMPORT_C void SetWelcomeNoteImageL(const TDesC& aImagePath, |
|
118 CGSAsyncImageHandling& aImgHandler ); |
|
119 |
|
120 |
|
121 /** |
|
122 * Converts the background image to bitmap, scales it to fit the |
|
123 * screen if necessary, and stores it to the given file. |
|
124 * |
|
125 * Background image path is not stored into shared data, but must be |
|
126 * set separately. |
|
127 * |
|
128 * @since 2.6 |
|
129 * |
|
130 * @param aImagePath Descriptor which contains the background image |
|
131 * path. Max length is KGSMaxImagePath. |
|
132 * @param aBmpFileName Descriptor which contains the bitmap file name. |
|
133 * Converted image is again stored back in this variable. |
|
134 * @param aWallpaperType Type of the wallpaper. |
|
135 */ |
|
136 IMPORT_C void SetBackgroundImagePathL( |
|
137 const TDesC& aImagePath, |
|
138 TDes& aBmpFileName, |
|
139 TGSWallpaperType aWallpaperType ); |
|
140 |
|
141 /** |
|
142 * Set the current image path for Still Image |
|
143 * |
|
144 */ |
|
145 IMPORT_C void SetVTStillImagePathL( const TDesC& aImagePath, |
|
146 CGSAsyncImageHandling& aImgHandler ); |
|
147 |
|
148 /* |
|
149 * Returns if Personalisation application exists in device |
|
150 * @return 1: Personalisation application exists in device |
|
151 * otherwise: Personalisation application does not exist in device |
|
152 */ |
|
153 IMPORT_C TInt GetPlnsStatus(); |
|
154 |
|
155 /* |
|
156 * Checking presence of the personalisation application on the |
|
157 * device |
|
158 */ |
|
159 IMPORT_C void IsPersonalisationApplicationL(); |
|
160 |
|
161 /* |
|
162 * Removing image |
|
163 * |
|
164 */ |
|
165 IMPORT_C void DeleteImageL( const TDesC& aImagePath ); |
|
166 |
|
167 |
|
168 private: |
|
169 |
|
170 /** |
|
171 * C++ default constructor. |
|
172 */ |
|
173 CGSBackgroundImage(); |
|
174 |
|
175 /** |
|
176 * By default Symbian 2nd phase constructor is private. |
|
177 */ |
|
178 void ConstructL(); |
|
179 |
|
180 private: |
|
181 |
|
182 void LoadImageL( const TDesC& aImagePath, |
|
183 TInt aWidth, TInt aHeight, |
|
184 TBool aBgImage, |
|
185 TGSWallpaperType aWallpaperType ); |
|
186 |
|
187 void SaveBitmapsL( TDes& aBmpFileName, |
|
188 const TDesC& aOriginalFullname ); |
|
189 public: // Data |
|
190 TInt iPlnsInDevice; //for personalisation app check |
|
191 |
|
192 private: // Data |
|
193 RSharedDataClient* iClient; //handle to shared data client |
|
194 CFbsBitmap* iBitmap; //for scaling/dithering of bitmap |
|
195 |
|
196 CRepository* iPersonalizationRepository; |
|
197 CRepository* iStartupConfRepository; |
|
198 CRepository* iTelephonyRepository; |
|
199 TDisplayMode iDisplayMode; //4k/64k display support |
|
200 |
|
201 RPhCltServer iPhoneClient; |
|
202 RLibrary iLibrary; |
|
203 |
|
204 CGSAsyncImageHandling* iImgHandler; |
|
205 |
|
206 // Reserved pointer for future extension |
|
207 //TAny* iReserved; |
|
208 |
|
209 }; |
|
210 |
|
211 #endif // CGSBACKGROUNDIMAGE_H |
|
212 |
|
213 // End of File |