27 #define __SISLAUNCHERCLIENT_H__ |
27 #define __SISLAUNCHERCLIENT_H__ |
28 |
28 |
29 #include <e32base.h> |
29 #include <e32base.h> |
30 #include <f32file.h> |
30 #include <f32file.h> |
31 #include "sislauncherdefs.h" |
31 #include "sislauncherdefs.h" |
32 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
32 |
33 #include <usif/scr/appregentries.h> |
|
34 #include <usif/scr/screntries_platform.h> |
|
35 #endif |
|
36 const TInt KDefaultShutdownTimeout = 10000000; |
33 const TInt KDefaultShutdownTimeout = 10000000; |
37 |
34 |
38 namespace Swi |
35 namespace Swi |
39 { |
36 { |
40 class CSisRegistryFileDescription; |
37 class CSisRegistryFileDescription; |
41 class CSoftwareTypeRegInfo; |
38 class CSoftwareTypeRegInfo; |
42 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
43 class TAppUpdateInfo; |
|
44 #endif |
|
45 |
39 |
46 class RSisLauncherSession : public RSessionBase |
40 class RSisLauncherSession : public RSessionBase |
47 { |
41 { |
48 public: |
42 public: |
49 /** |
43 /** |
50 * Connects to the SIS launcher server. |
44 * Connects to the SIS launcher server. |
51 */ |
45 */ |
52 IMPORT_C TInt Connect(); |
46 IMPORT_C TInt Connect(); |
53 |
47 |
54 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
48 /** |
55 /** |
49 * Launches an executable. |
56 * Closes to the SIS launcher session. |
50 * |
57 */ |
51 * @param aFileName The file name of the executable. |
58 IMPORT_C void Close(); |
52 * @param aWait If true, then this call waits for the executable to terminate. |
59 #endif |
53 */ |
60 |
54 IMPORT_C void RunExecutableL(const TDesC& aFileName, TBool aWait); |
61 /** |
55 |
62 * Launches an executable. |
56 /** |
63 * |
57 * Opens a document. |
64 * @param aFileName The file name of the executable. |
58 * @param aFileName The file name of the document to open. |
65 * @param aWait If true, then this call waits for the executable to terminate. |
59 * @param aWait If true, then this call waits for the document to close. |
66 */ |
60 */ |
67 IMPORT_C void RunExecutableL(const TDesC& aFileName, TBool aWait); |
61 IMPORT_C void StartDocumentL(const TDesC& aFileName, TBool aWait); |
68 |
62 |
69 /** |
63 /** |
70 * Opens a document. |
64 * Opens a document using the mime-type to determine the helper application. |
71 * @param aFileName The file name of the document to open. |
65 * @param aFileName The file name of the document to open. |
72 * @param aWait If true, then this call waits for the document to close. |
66 * @param aMimeType The mime type of the document. |
73 */ |
67 * @param aWait If true, then this call waits for the document to close. |
74 IMPORT_C void StartDocumentL(const TDesC& aFileName, TBool aWait); |
68 */ |
75 |
69 IMPORT_C void StartByMimeL(const TDesC& aFileName, const TDesC8& aMimeType, TBool aWait); |
76 /** |
70 |
77 * Opens a document using the mime-type to determine the helper application. |
|
78 * @param aFileName The file name of the document to open. |
|
79 * @param aMimeType The mime type of the document. |
|
80 * @param aWait If true, then this call waits for the document to close. |
|
81 */ |
|
82 IMPORT_C void StartByMimeL(const TDesC& aFileName, const TDesC8& aMimeType, TBool aWait); |
|
83 |
|
84 |
71 |
85 /** |
72 /** |
86 * Opens a document. |
73 * Opens a document. |
87 * @param aFile The file handle of the document to open. |
74 * @param aFile The file handle of the document to open. |
88 * @param aWait If true, then this call waits for the document to close. |
75 * @param aWait If true, then this call waits for the document to close. |
89 */ |
76 */ |
90 IMPORT_C void StartDocumentL(RFile& aFile, TBool aWait); |
77 IMPORT_C void StartDocumentL(RFile& aFile, TBool aWait); |
91 |
78 |
92 /** |
79 /** |
93 * Opens a document using the mime-type to determine the helper application. |
80 * Opens a document using the mime-type to determine the helper application. |
94 * @param aFile The file handle of the document to open. |
81 * @param aFile The file handle of the document to open. |
95 * @param aMimeType The mime type of the document. |
82 * @param aMimeType The mime type of the document. |
96 * @param aWait If true, then this call waits for the document to close. |
83 * @param aWait If true, then this call waits for the document to close. |
97 */ |
84 */ |
98 IMPORT_C void StartByMimeL(RFile& aFile, const TDesC8& aMimeType, TBool aWait); |
85 IMPORT_C void StartByMimeL(RFile& aFile, const TDesC8& aMimeType, TBool aWait); |
99 |
86 |
100 IMPORT_C void ShutdownAllL(); |
87 IMPORT_C void ShutdownAllL(); |
101 |
88 |
102 /** |
89 /** |
103 * Checks if the application is running. This function will leave with error KErrInUse if an |
90 * Checks if the application is running. This function will leave with error KErrInUse if an |
104 * application is busy. Else it will leave with error KErrNone |
91 * application is busy. Else it will leave with error KErrNone |
105 * |
92 * |
106 * @param aUid The UID of the application to check. |
93 * @param aUid The UID of the application to check. |
107 */ |
94 */ |
108 |
95 |
109 IMPORT_C void CheckApplicationInUseL(RArray<TAppInUse>& aUidList); |
96 IMPORT_C void CheckApplicationInUseL(RArray<TAppInUse>& aUidList); |
110 |
97 |
111 /** |
98 /** |
112 * Shuts down an application. If the aUid parameter is null then all non system/hidden |
99 * Shuts down an application. If the aUid parameter is null then all non system/hidden |
113 * applications are closed. This function will leave with error KErrInUse if an |
100 * applications are closed. This function will leave with error KErrInUse if an |
114 * application is busy. |
101 * application is busy. |
115 * |
102 * |
116 * @param aUid The UID of the application to close. |
103 * @param aUid The UID of the application to close. |
117 * @param aTimeout Timeout value in microseconds used when shutting down individual exe. |
104 * @param aTimeout Timeout value in microseconds used when shutting down individual exe. |
118 */ |
105 */ |
119 IMPORT_C void ShutdownL(const RArray<TUid>& aUidList, TInt aTimeout); |
106 IMPORT_C void ShutdownL(const RArray<TUid>& aUidList, TInt aTimeout); |
120 |
107 |
121 /** |
108 /** |
122 * Notifies APPARC of new registration files. Causes APPARC to rescan its |
109 * Notifies APPARC of new registration files. Causes APPARC to rescan its |
123 * import/apps directory, so avoid calling unnecessarily. This call |
110 * import/apps directory, so avoid calling unnecessarily. This call |
124 * supports DEF084847 by telling APPARC which apps to treat as registered |
111 * supports DEF084847 by telling APPARC which apps to treat as registered |
125 * even though installation is not quite complete. |
112 * even though installation is not quite complete. |
126 * |
113 * |
127 * @param aFiles The array of filenames that have appeared during this installation. |
114 * @param aFiles The array of filenames that have appeared during this installation. |
128 */ |
115 */ |
129 IMPORT_C void NotifyNewAppsL(const RPointerArray<TDesC>& aFiles); |
116 IMPORT_C void NotifyNewAppsL(const RPointerArray<TDesC>& aFiles); |
130 |
117 |
131 /** |
118 /** |
132 * Waits for ECOM to notify of changes before attempting to launch the files. |
119 * Waits for ECOM to notify of changes before attempting to launch the files. |
133 * Files are opened client side before sending them to the server to avoid capability issues. |
120 * Files are opened client side before sending them to the server to avoid capability issues. |
134 * |
121 * |
135 * As SWI may shutdown before ECOM will process delivered plug-ins |
122 * As SWI may shutdown before ECOM will process delivered plug-ins |
136 * the launcher will not terminate the usual 2secs after the last client. Instead a |
123 * the launcher will not terminate the usual 2secs after the last client. Instead a |
137 * longer running timeout is used for two reasons. |
124 * longer running timeout is used for two reasons. |
138 * a) to allow ECOM a 'reasonable' amount of time to do its work - we don't want to |
125 * a) to allow ECOM a 'reasonable' amount of time to do its work - we don't want to |
139 * kill the launcher while ECOM is still busy. |
126 * kill the launcher while ECOM is still busy. |
140 * b) to shutdown correctly where SWI has incorrectly identified a plug-in resource file - |
127 * b) to shutdown correctly where SWI has incorrectly identified a plug-in resource file - |
141 * we don't want to hang around forever waiting for an event that will never come. |
128 * we don't want to hang around forever waiting for an event that will never come. |
142 * */ |
129 * */ |
143 IMPORT_C void RunAfterEcomNotificationL(const RPointerArray<CSisRegistryFileDescription>& aFileList); |
130 IMPORT_C void RunAfterEcomNotificationL(const RPointerArray<CSisRegistryFileDescription>& aFileList); |
144 |
131 |
145 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
132 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
146 IMPORT_C void ParseSwTypeRegFileL(RFile& aFile, RPointerArray<Usif::CSoftwareTypeRegInfo>& aSwTypeRegInfoArray); |
133 IMPORT_C void ParseSwTypeRegFileL(RFile& aFile, RPointerArray<CSoftwareTypeRegInfo>& aSwTypeRegInfoArray); |
147 |
134 |
148 IMPORT_C void RegisterSifLauncherMimeTypesL(const RPointerArray<HBufC8>& aMimeTypes); |
135 IMPORT_C void RegisterSifLauncherMimeTypesL(const RPointerArray<HBufC8>& aMimeTypes); |
149 |
136 |
150 IMPORT_C void UnregisterSifLauncherMimeTypesL(const RPointerArray<HBufC8>& aMimeTypes); |
137 IMPORT_C void UnregisterSifLauncherMimeTypesL(const RPointerArray<HBufC8>& aMimeTypes); |
151 |
138 |
152 /** |
|
153 * Populate CApplicationRegistrationData from the specified resource file, for the given languages and pass the data size back to the caller in TRequestStatus |
|
154 * |
|
155 * @param An already opened file handle. |
|
156 * @param aAppLanguages List of the languages |
|
157 * @return Return size of buffer needed in TRequestStatus |
|
158 */ |
|
159 IMPORT_C void AsyncParseResourceFileSizeL(const RFile& aRegistrationFile, const RArray<TLanguage>& aAppLanguages, TRequestStatus& aStatus); |
|
160 |
|
161 /** |
|
162 * Return populate CApplicationRegistrationData |
|
163 * |
|
164 * @param aDataSize Size of buffer needed for CApplicationRegistrationData. |
|
165 * @return Pointer to a CApplicationRegistrationData (caller owns it) |
|
166 */ |
|
167 IMPORT_C Usif::CApplicationRegistrationData* AsyncParseResourceFileDataL(TInt aDataSize); |
|
168 |
|
169 /** |
|
170 * @param aRegistrationFileName registration file name to be parsed |
|
171 * @return Pointer to a CApplicationRegistrationData (caller owns it) |
|
172 */ |
|
173 IMPORT_C Usif::CApplicationRegistrationData* SyncParseResourceFileL(const RFile& aRegistrationFile, const RArray<TLanguage>& aAppLanguages); |
|
174 |
|
175 /** |
|
176 * Notifies APPARC of new applications. This call |
|
177 * informs APPARC which apps to treat as registered |
|
178 * even though installation is not quite complete. |
|
179 * |
|
180 * @param aFiles The array of application information to be treated as registered before this current installation completes. |
|
181 */ |
|
182 IMPORT_C void NotifyNewAppsL(const RPointerArray<Usif::CApplicationRegistrationData>& aAppRegData); |
|
183 |
|
184 /** |
|
185 * Notifies APPARC of applications which are removed/upgraded during installation |
|
186 * @param aAppUpdateInfo , array of app uids along with the action(remove/upgrade) |
|
187 */ |
|
188 IMPORT_C void NotifyNewAppsL(const RArray<TAppUpdateInfo>& aAppUpdateInfo); |
|
189 |
|
190 private: |
139 private: |
191 void RegisterSifLauncherMimeTypesImplL(const RPointerArray<HBufC8>& aMimeTypes, TBool aRegister); |
140 void RegisterSifLauncherMimeTypesImplL(const RPointerArray<HBufC8>& aMimeTypes, TBool aRegister); |
192 HBufC8* iBuffForLanguages; |
|
193 #endif |
141 #endif |
194 }; |
142 }; |
195 |
|
196 #ifdef SYMBIAN_UNIVERSAL_INSTALL_FRAMEWORK |
|
197 enum InstallActions |
|
198 { |
|
199 EAppInstalled = 0, |
|
200 EAppUninstalled |
|
201 }; |
|
202 |
|
203 class TAppUpdateInfo |
|
204 { |
|
205 public: |
|
206 IMPORT_C void InternalizeL(RReadStream& aReadStream); |
|
207 IMPORT_C void ExternalizeL(RWriteStream& aWriteStream) const; |
|
208 IMPORT_C TAppUpdateInfo(TUid aAppUid, InstallActions aAction); |
|
209 IMPORT_C TAppUpdateInfo(); |
|
210 public: |
|
211 TUid iAppUid; |
|
212 InstallActions iAction; |
|
213 }; |
|
214 #endif |
|
215 |
|
216 } //namespace |
143 } //namespace |
217 |
144 |
218 #endif |
145 #endif |
219 |
|