|
1 /* |
|
2 * Copyright (c) 2008 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: Java MIDlet runtime type for AppMngr2 |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef APPMNGR2MIDLETRUNTIME_H |
|
20 #define APPMNGR2MIDLETRUNTIME_H |
|
21 |
|
22 #include <appmngr2runtime.h> // CAppMngr2Runtime |
|
23 #include <javaregistryincludes.h> |
|
24 |
|
25 class MAppMngr2RuntimeObserver; |
|
26 class CAppMngr2MidletPckgInfoFactory; |
|
27 class CAppMngr2RecognizedFile; |
|
28 class CAppMngr2PackageInfo; |
|
29 class CAknIconArray; |
|
30 class CAppMngr2MidletResourceHandler; |
|
31 |
|
32 /** |
|
33 * ECom interface UID for AppMngr2 MIDlet Runtime Plugin |
|
34 */ |
|
35 const TInt KAppMngr2MidletUidValue = 0x20016BF8; |
|
36 const TUid KAppMngr2MidletUid = { KAppMngr2MidletUidValue }; |
|
37 |
|
38 /** |
|
39 * MIDlet Runtime Plug-in |
|
40 * |
|
41 * The MIDlet Runtime Plug-in provides to AppMngr: |
|
42 * - Array of MIDlet suite Installation Packages Info objects |
|
43 * based on provided file name list. |
|
44 * - Array of installed MIDlets Application Info objects. |
|
45 * - MIDlet default icons |
|
46 * - Data types supported for creating installation |
|
47 * - Additional directories for installation file scanning. |
|
48 * |
|
49 * @lib appmngr2midletplugin.dll |
|
50 * @since S60 v9.1 |
|
51 */ |
|
52 class CAppMngr2MidletRuntime : public CAppMngr2Runtime |
|
53 { |
|
54 public: // constructor and destructor |
|
55 |
|
56 /** |
|
57 * Two phase constructor |
|
58 * @param aObserver Observer implementing MAppMngr2RuntimeObserver functions |
|
59 * |
|
60 * @since S60 9.1 |
|
61 * @return instance |
|
62 */ |
|
63 static CAppMngr2MidletRuntime* NewL(MAppMngr2RuntimeObserver& aObserver); |
|
64 |
|
65 /** |
|
66 * Destructor |
|
67 * |
|
68 * @since S60 9.1 |
|
69 */ |
|
70 ~CAppMngr2MidletRuntime(); |
|
71 |
|
72 /** |
|
73 * Get the ideal size for Java raster icons in the app mgr list. |
|
74 */ |
|
75 inline TSize JavaRasterIconSize() {return iJavaRasterIconSize;}; |
|
76 |
|
77 public: // from CAppMngr2Runtime |
|
78 |
|
79 /** |
|
80 * Load plug-in specific icons. Functions CAppMngr2InfoBase::IconIndex() |
|
81 * and CAppMngr2InfoBase::IndicatorIconIndex() must return indexes to the |
|
82 * plug-in specific icons appended to aIconArray. |
|
83 * @param aIconArray Array where to append the loaded icons |
|
84 */ |
|
85 void LoadIconsL(CAknIconArray& aIconArray); |
|
86 |
|
87 /** |
|
88 * Get data types that this Runtime plug-in supports for creating installation |
|
89 * file (CAppMngr2PackageInfo) objects. When installation files are scanned, |
|
90 * recognized files are provided to the plug-in via GetPackageInfosL() function. |
|
91 * @param aDataTypeArray Array where to append supported data types |
|
92 */ |
|
93 void GetSupportedDataTypesL(CDataTypeArray& aDataTypeArray); |
|
94 |
|
95 /** |
|
96 * Create package info objects to represent installation files in "Installation |
|
97 * Files" view. Each package info object is displayed as a separate item in the |
|
98 * "Installation Files" view. Package info objects should be based on recognized |
|
99 * installation files, provided in aFileList array. All data types match to the |
|
100 * ones defined in function CAppMngr2Runtime::GetSupportedDataTypesL(). |
|
101 * @param aPackageInfos Array where to append package info objects |
|
102 * @param aFileList List of recognized files |
|
103 * @param aFsSession File server session |
|
104 * @param aStatus The request status. KErrNone on completion, |
|
105 * otherwise another of the system-wide error codes. |
|
106 */ |
|
107 void GetInstallationFilesL(RPointerArray<CAppMngr2PackageInfo>& aPackageInfos, |
|
108 const RPointerArray<CAppMngr2RecognizedFile>& aFileList, |
|
109 RFs& aFsSession, |
|
110 TRequestStatus& aStatus); |
|
111 |
|
112 /** |
|
113 * Cancel pending asynchronous GetInstallationFilesL() request. |
|
114 */ |
|
115 void CancelGetInstallationFiles(); |
|
116 |
|
117 /** |
|
118 * Create application info objects to represent installed applications in |
|
119 * "Installed" view. Each application info object is displayed as separate |
|
120 * item in "Installed" view. |
|
121 * @param aApps Array where to add application info objects |
|
122 * @param aFsSession File server session |
|
123 * @param aStatus Request status for the asynchronous request |
|
124 */ |
|
125 void GetInstalledAppsL(RPointerArray<CAppMngr2AppInfo>& aApps, |
|
126 RFs& aFsSession, TRequestStatus& aStatus); |
|
127 |
|
128 /** |
|
129 * Cancel pending asynchronous GetInstalledAppsL() request. |
|
130 */ |
|
131 void CancelGetInstalledApps(); |
|
132 |
|
133 |
|
134 private: // new functions |
|
135 |
|
136 /** |
|
137 * Constructor |
|
138 * @param aObserver Observer implementing MAppMngr2RuntimeObserver functions |
|
139 * |
|
140 * @since S60 9.1 |
|
141 */ |
|
142 CAppMngr2MidletRuntime(MAppMngr2RuntimeObserver &aObserver); |
|
143 |
|
144 /** |
|
145 * Second phase constructor |
|
146 * |
|
147 * @since S60 9.1 |
|
148 */ |
|
149 void ConstructL(); |
|
150 |
|
151 /** |
|
152 * Create Installed MIDlet suite application info object. |
|
153 * @param aApps Array where to add application info object |
|
154 * @param aFsSession File server session |
|
155 * @param aEntry Java registry MIDlet suite entry |
|
156 */ |
|
157 void GetInstalledAppL(RPointerArray<CAppMngr2AppInfo>& aApps, |
|
158 RFs& aFsSession, |
|
159 Java::CJavaRegistryPackageEntry* aEntry); |
|
160 |
|
161 private: // data |
|
162 |
|
163 /** |
|
164 * Java Registry for getting installed Java applications |
|
165 * Owned |
|
166 */ |
|
167 Java::CJavaRegistry* iJavaRegistry; |
|
168 |
|
169 /** |
|
170 * Package Info factory for getting installation packages |
|
171 * Owned |
|
172 */ |
|
173 CAppMngr2MidletPckgInfoFactory* iPckgFactory; |
|
174 |
|
175 /** |
|
176 * Resource handler |
|
177 * Owned |
|
178 */ |
|
179 CAppMngr2MidletResourceHandler* iResourceHandler; |
|
180 |
|
181 /** |
|
182 * Size of java raster icons in the app mgr list. |
|
183 */ |
|
184 TSize iJavaRasterIconSize; |
|
185 }; |
|
186 |
|
187 #endif // APPMNGR2MIDLETRUNTIME_H |
|
188 |