|
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 public: // from CAppMngr2Runtime |
|
73 |
|
74 /** |
|
75 * Load plug-in specific icons. Functions CAppMngr2InfoBase::IconIndex() |
|
76 * and CAppMngr2InfoBase::IndicatorIconIndex() must return indexes to the |
|
77 * plug-in specific icons appended to aIconArray. |
|
78 * @param aIconArray Array where to append the loaded icons |
|
79 */ |
|
80 void LoadIconsL(CAknIconArray& aIconArray); |
|
81 |
|
82 /** |
|
83 * Get data types that this Runtime plug-in supports for creating installation |
|
84 * file (CAppMngr2PackageInfo) objects. When installation files are scanned, |
|
85 * recognized files are provided to the plug-in via GetPackageInfosL() function. |
|
86 * @param aDataTypeArray Array where to append supported data types |
|
87 */ |
|
88 void GetSupportedDataTypesL(CDataTypeArray& aDataTypeArray); |
|
89 |
|
90 /** |
|
91 * Create package info objects to represent installation files in "Installation |
|
92 * Files" view. Each package info object is displayed as a separate item in the |
|
93 * "Installation Files" view. Package info objects should be based on recognized |
|
94 * installation files, provided in aFileList array. All data types match to the |
|
95 * ones defined in function CAppMngr2Runtime::GetSupportedDataTypesL(). |
|
96 * @param aPackageInfos Array where to append package info objects |
|
97 * @param aFileList List of recognized files |
|
98 * @param aFsSession File server session |
|
99 * @param aStatus The request status. KErrNone on completion, |
|
100 * otherwise another of the system-wide error codes. |
|
101 */ |
|
102 void GetInstallationFilesL(RPointerArray<CAppMngr2PackageInfo>& aPackageInfos, |
|
103 const RPointerArray<CAppMngr2RecognizedFile>& aFileList, |
|
104 RFs& aFsSession, |
|
105 TRequestStatus& aStatus); |
|
106 |
|
107 /** |
|
108 * Cancel pending asynchronous GetInstallationFilesL() request. |
|
109 */ |
|
110 void CancelGetInstallationFiles(); |
|
111 |
|
112 /** |
|
113 * Create application info objects to represent installed applications in |
|
114 * "Installed" view. Each application info object is displayed as separate |
|
115 * item in "Installed" view. |
|
116 * @param aApps Array where to add application info objects |
|
117 * @param aFsSession File server session |
|
118 * @param aStatus Request status for the asynchronous request |
|
119 */ |
|
120 void GetInstalledAppsL(RPointerArray<CAppMngr2AppInfo>& aApps, |
|
121 RFs& aFsSession, TRequestStatus& aStatus); |
|
122 |
|
123 /** |
|
124 * Cancel pending asynchronous GetInstalledAppsL() request. |
|
125 */ |
|
126 void CancelGetInstalledApps(); |
|
127 |
|
128 |
|
129 private: // new functions |
|
130 |
|
131 /** |
|
132 * Constructor |
|
133 * @param aObserver Observer implementing MAppMngr2RuntimeObserver functions |
|
134 * |
|
135 * @since S60 9.1 |
|
136 */ |
|
137 CAppMngr2MidletRuntime(MAppMngr2RuntimeObserver &aObserver); |
|
138 |
|
139 /** |
|
140 * Second phase constructor |
|
141 * |
|
142 * @since S60 9.1 |
|
143 */ |
|
144 void ConstructL(); |
|
145 |
|
146 /** |
|
147 * Create Installed MIDlet suite application info object. |
|
148 * @param aApps Array where to add application info object |
|
149 * @param aFsSession File server session |
|
150 * @param aEntry Java registry MIDlet suite entry |
|
151 */ |
|
152 void GetInstalledAppL(RPointerArray<CAppMngr2AppInfo>& aApps, |
|
153 RFs& aFsSession, |
|
154 Java::CJavaRegistryPackageEntry* aEntry); |
|
155 |
|
156 private: // data |
|
157 |
|
158 /** |
|
159 * Java Registry for getting installed Java applications |
|
160 * Owned |
|
161 */ |
|
162 Java::CJavaRegistry* iJavaRegistry; |
|
163 |
|
164 /** |
|
165 * Package Info factory for getting installation packages |
|
166 * Owned |
|
167 */ |
|
168 CAppMngr2MidletPckgInfoFactory* iPckgFactory; |
|
169 |
|
170 /** |
|
171 * Resource handler |
|
172 * Owned |
|
173 */ |
|
174 CAppMngr2MidletResourceHandler* iResourceHandler; |
|
175 }; |
|
176 |
|
177 #endif // APPMNGR2MIDLETRUNTIME_H |
|
178 |