1 apaid.h |
1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef __APAID_H__ |
|
17 #define __APAID_H__ |
|
18 |
|
19 #if !defined(__E32BASE_H__) |
|
20 #include <e32base.h> |
|
21 #endif |
|
22 #if !defined(__APADEF_H__) |
|
23 #include <apadef.h> |
|
24 #endif |
|
25 |
|
26 #include "apmstd.h" |
|
27 |
|
28 |
|
29 // classes defined: |
|
30 class TApaAppIdentifier; |
|
31 class TApaAppEntry; |
|
32 class CApaAppFinder; |
|
33 // |
|
34 // classes referenced: |
|
35 class RReadStream; |
|
36 class RWriteStream; |
|
37 class RFs; |
|
38 // |
|
39 |
|
40 |
|
41 class TApaAppIdentifier |
|
42 /** The identity of an application. |
|
43 |
|
44 An object of this type contains two pieces of information: |
|
45 |
|
46 The application specific UID |
|
47 |
|
48 The file name and extension of the application DLL |
|
49 |
|
50 All persisted documents associated with this application have a stream containing |
|
51 this information. |
|
52 |
|
53 @publishedAll |
|
54 @released |
|
55 @see CApaProcess::ReadRootStreamLC() |
|
56 @see CApaProcess::WriteRootStreamL() |
|
57 @see CApaProcess::ReadAppIdentifierL() |
|
58 @see CApaProcess::WriteAppIdentifierL() */ |
|
59 { |
|
60 public: |
|
61 IMPORT_C TApaAppIdentifier(); |
|
62 IMPORT_C TApaAppIdentifier(TUid aAppUidType,const TFileName& aDllName); |
|
63 IMPORT_C void ExternalizeL(RWriteStream& aStream)const; |
|
64 IMPORT_C void InternalizeL(RReadStream& aStream); |
|
65 |
|
66 public: |
|
67 /** The application-specific UID. */ |
|
68 TUid iAppUid; |
|
69 /** The full path name of the application DLL. */ |
|
70 TFileName iFullName; |
|
71 |
|
72 private: |
|
73 TInt iTApaAppIdentifier_Reserved1; |
|
74 }; |
|
75 |
|
76 |
|
77 class TApaAppEntry |
|
78 /** An application entry. |
|
79 |
|
80 An object of this type contains two pieces of information: |
|
81 |
|
82 the full path name of the application DLL |
|
83 |
|
84 the UID type (or compound identifier) of the application DLL. |
|
85 |
|
86 @publishedAll |
|
87 @released */ |
|
88 { |
|
89 public: |
|
90 IMPORT_C TApaAppEntry(); |
|
91 IMPORT_C TApaAppEntry(const TUidType& aAppUidType,const TFileName& aDllName); |
|
92 IMPORT_C void ExternalizeL(RWriteStream& aStream)const; |
|
93 IMPORT_C void InternalizeL(RReadStream& aStream); |
|
94 public: |
|
95 /** The UID type (or compound identifier) of the application DLL. */ |
|
96 TUidType iUidType; |
|
97 /** The full path name of the application DLL. */ |
|
98 TFileName iFullName; |
|
99 private: |
|
100 TInt iTApaAppEntry_Reserved1; |
|
101 }; |
|
102 |
|
103 |
|
104 class TApaAppInfo |
|
105 /** Application information. |
|
106 |
|
107 An object of this type contains four pieces of information: |
|
108 |
|
109 the application specific UID |
|
110 |
|
111 the full path name of the application DLL |
|
112 |
|
113 the application's caption |
|
114 |
|
115 a short caption; how this is used is up to the UI |
|
116 |
|
117 @publishedAll |
|
118 @released */ |
|
119 { |
|
120 public: |
|
121 IMPORT_C TApaAppInfo(); |
|
122 IMPORT_C TApaAppInfo(TUid aAppUid,const TFileName& aDllName,const TApaAppCaption& aCaption); |
|
123 IMPORT_C TApaAppInfo(TUid aAppUid,const TFileName& aDllName,const TApaAppCaption& aCaption,const TApaAppCaption& aShortCaption); |
|
124 IMPORT_C void ExternalizeL(RWriteStream& aStream)const; |
|
125 IMPORT_C void InternalizeL(RReadStream& aStream); |
|
126 public: |
|
127 /** The application specific UID. */ |
|
128 TUid iUid; |
|
129 /** The full path name of the application DLL. */ |
|
130 TFileName iFullName; |
|
131 /** The caption for the application. */ |
|
132 TApaAppCaption iCaption; |
|
133 /** The short caption for the application. */ |
|
134 TApaAppCaption iShortCaption; |
|
135 |
|
136 private: |
|
137 TInt iTApaAppInfo_Reserved1; |
|
138 }; |
|
139 |
|
140 |
|
141 class TApaAppViewInfo |
|
142 /** Contains the basic information about an application view. |
|
143 |
|
144 An object of this type contains two pieces of information: |
|
145 |
|
146 The UID that identifies the view |
|
147 |
|
148 The application's caption. |
|
149 |
|
150 Objects of this type are returned in an array populated by a call to RApaLsSession::GetAppViews(). |
|
151 |
|
152 @publishedAll |
|
153 @released |
|
154 @see CApaAppViewArray |
|
155 @see TUid */ |
|
156 { |
|
157 public: |
|
158 IMPORT_C TApaAppViewInfo(); |
|
159 IMPORT_C TApaAppViewInfo(TUid aViewUid,const TApaAppCaption& aViewCaption,TInt aScreenMode); |
|
160 IMPORT_C void ExternalizeL(RWriteStream& aStream)const; |
|
161 IMPORT_C void InternalizeL(RReadStream& aStream); |
|
162 public: |
|
163 /** The UID identifying the view. */ |
|
164 TUid iUid; |
|
165 /** The application caption. */ |
|
166 TApaAppCaption iViewCaption; |
|
167 TInt iScreenMode; |
|
168 private: |
|
169 TInt iTApaAppViewInfo_Reserved1; |
|
170 }; |
|
171 |
|
172 |
|
173 /** Defines an array of TApaAppViewInfo objects contained within a flat dynamic |
|
174 buffer. |
|
175 |
|
176 An array of this type is populated with TApaAppViewInfo objects in a call |
|
177 to RApaLsSession::GetAppViews(). |
|
178 |
|
179 @publishedAll |
|
180 @released */ |
|
181 typedef CArrayFixFlat<TApaAppViewInfo> CApaAppViewArray; |
|
182 |
|
183 |
|
184 class TApaAppCapability |
|
185 // expandable class - add new members to the end, add them to the end of int/ext also, and increment the version no. |
|
186 // default value for all data members must be 0 |
|
187 /** Application capabilities. |
|
188 |
|
189 @publishedAll |
|
190 @released */ |
|
191 { |
|
192 public: |
|
193 IMPORT_C static void CopyCapability(TDes8& aDest,const TDesC8& aSource); |
|
194 IMPORT_C void InternalizeL(RReadStream& aStream); |
|
195 IMPORT_C void Internalize7_0L(RReadStream& aStream); // deprecated |
|
196 IMPORT_C void ExternalizeL(RWriteStream& aStream) const; |
|
197 private: |
|
198 IMPORT_C void Externalize7_0L(RWriteStream& aStream) const; // deprecated |
|
199 void DoInternalizeL(RReadStream& aStream, TBool& aLaunchInBackground, TApaAppGroupName& aGroupName); |
|
200 public: |
|
201 // |
|
202 /** Defines an application's support for embeddability. */ |
|
203 enum TEmbeddability { |
|
204 /** An application cannot be embedded. */ |
|
205 ENotEmbeddable=0, |
|
206 /** An application can be run embedded or standalone and can read/write embedded document-content. */ |
|
207 EEmbeddable=1, |
|
208 /** An application can only be run embedded and can read/write embedded document-content. */ |
|
209 EEmbeddableOnly=2, |
|
210 /** An application can be run embedded or standalone and cannot read/write embedded document-content. */ |
|
211 EEmbeddableUiOrStandAlone=5, |
|
212 /** An application can only be run embedded and cannot read/write embedded document-content. */ |
|
213 EEmbeddableUiNotStandAlone=6 }; |
|
214 /** Defines an application's attributes as a set of bit flags. */ |
|
215 enum TCapabilityAttribute |
|
216 { |
|
217 /** If set, the application was built as a DLL, otherwise it was built as an EXE. */ |
|
218 EBuiltAsDll = 0x00000001, |
|
219 /** If set, the application provides control panel functionality. */ |
|
220 EControlPanelItem = 0x00000002, |
|
221 /** If set, the application is not a native executable, and hence the "path" and "extension" (as well as the "name") must be provided in the app_file field of the APP_REGISTRATION_INFO resource. */ |
|
222 ENonNative = 0x00000004 |
|
223 }; |
|
224 public: |
|
225 /** Indicates the extent to which the application can be embedded. */ |
|
226 TEmbeddability iEmbeddability; |
|
227 /** Indicates whether the application is document-based and supports being asked |
|
228 to create a new file. */ |
|
229 TBool iSupportsNewFile; |
|
230 /** Indicates whether the existence of the application should be advertised to the |
|
231 user. If this is set to ETrue, the application does not appear on the Extras |
|
232 Bar (or equivalent). */ |
|
233 TBool iAppIsHidden; // not shown in the Shell etc. |
|
234 /** Allows the application to be launched in the foreground (when set to EFalse) |
|
235 or in the background (when set to ETrue). */ |
|
236 TBool iLaunchInBackground; // Series 60 extension to allow apps to be launched in the background |
|
237 /** Stores the application's logical group name. */ |
|
238 TApaAppGroupName iGroupName; // Series 60 extension to allow apps to be categorized according a logical group name, e.g. 'games' |
|
239 /** Indicates the application attributes. One or more values from TCapabilityAttribute may be specified. */ |
|
240 TUint iAttributes; |
|
241 private: |
|
242 enum { EVersion=4 }; |
|
243 private: |
|
244 TInt iTApaAppCapability_Reserved1; |
|
245 }; |
|
246 |
|
247 /** Packages the TApaAppCapability class. |
|
248 |
|
249 @publishedAll |
|
250 @released */ |
|
251 typedef TPckgBuf<TApaAppCapability> TApaAppCapabilityBuf; |
|
252 |
|
253 |
|
254 /** Filter used to define the subset of applications returned by RApaLsSession::GetNextApp() |
|
255 |
|
256 @publishedAll |
|
257 @released |
|
258 */ |
|
259 class TApaEmbeddabilityFilter |
|
260 { |
|
261 public: |
|
262 IMPORT_C TApaEmbeddabilityFilter(); |
|
263 IMPORT_C void AddEmbeddability(TApaAppCapability::TEmbeddability aEmbeddability); |
|
264 IMPORT_C TBool MatchesEmbeddability(TApaAppCapability::TEmbeddability aEmbeddability) const; |
|
265 private: |
|
266 TUint iEmbeddabilityFlags; |
|
267 private: |
|
268 TInt iTApaEmbeddabilityFilter_Reserved1; |
|
269 }; |
|
270 |
|
271 |
|
272 class CApaAppFinder : public CBase |
|
273 /** |
|
274 @publishedPartner |
|
275 @deprecated |
|
276 */ |
|
277 { |
|
278 public: |
|
279 virtual void FindAllAppsL()=0; // sets up a scan for all apps |
|
280 virtual TBool NextL(TApaAppEntry& aEntry)=0; // increments a scan for all apps |
|
281 virtual TFileName FindAppL(const TDesC& aFileName,TUid aFileUid)=0; // searches for a particular app - should support wildcards in aFileName |
|
282 // |
|
283 virtual TFileName DefaultAppInfoFileName()const=0; // should return the full name, path and drive of the default icon file |
|
284 protected: |
|
285 IMPORT_C CApaAppFinder(); |
|
286 |
|
287 private: |
|
288 IMPORT_C virtual void CApaAppFinder_Reserved1(); |
|
289 IMPORT_C virtual void CApaAppFinder_Reserved2(); |
|
290 }; |
|
291 |
|
292 /** |
|
293 The uid for the Open service. |
|
294 |
|
295 @publishedPartner |
|
296 @released |
|
297 */ |
|
298 const TUid KOpenServiceUid = { 0x10208DCA }; |
|
299 |
|
300 /** Application service information. |
|
301 |
|
302 Encapsulates a service UID and associated opaque data. |
|
303 |
|
304 An instance of this class provides information about |
|
305 a specific implementation of the service identified by |
|
306 the encapsulated service UID. |
|
307 |
|
308 @publishedPartner |
|
309 @released |
|
310 */ |
|
311 class TApaAppServiceInfo |
|
312 { |
|
313 public: |
|
314 TApaAppServiceInfo(); |
|
315 TApaAppServiceInfo(TUid aUid, CArrayFixFlat<TDataTypeWithPriority>* aDataTypes, |
|
316 HBufC8* aOpaqueData); |
|
317 void ExternalizeL(RWriteStream& aStream) const; |
|
318 void InternalizeL(RReadStream& aStream); |
|
319 void Release(); |
|
320 CArrayFixFlat<TDataTypeWithPriority>& DataTypes(); |
|
321 IMPORT_C TUid Uid() const; |
|
322 IMPORT_C const CArrayFixFlat<TDataTypeWithPriority>& DataTypes() const; |
|
323 IMPORT_C const TDesC8& OpaqueData() const; |
|
324 private: |
|
325 TUid iUid; |
|
326 CArrayFixFlat<TDataTypeWithPriority>* iDataTypes; |
|
327 HBufC8* iOpaqueData; |
|
328 TInt iTApaAppServiceInfo; |
|
329 }; |
|
330 |
|
331 /** Application service information array. |
|
332 |
|
333 Owns an array of TApaAppServiceInfo objects. |
|
334 |
|
335 @see TApaAppServiceInfo |
|
336 @publishedPartner |
|
337 @released |
|
338 */ |
|
339 class CApaAppServiceInfoArray : public CBase |
|
340 { |
|
341 protected: |
|
342 CApaAppServiceInfoArray(); |
|
343 public: |
|
344 /** Provides access to the encapsulated array of |
|
345 TApaAppServiceInfo objects. |
|
346 |
|
347 @return A generic array of TApaAppServiceInfo objects. */ |
|
348 virtual TArray<TApaAppServiceInfo> Array()=0; |
|
349 |
|
350 private: |
|
351 IMPORT_C virtual void CApaAppServiceInfoArray_Reserved1(); |
|
352 IMPORT_C virtual void CApaAppServiceInfoArray_Reserved2(); |
|
353 |
|
354 private: |
|
355 TInt iCApaAppServiceInfoArray_Reserved1; |
|
356 }; |
|
357 |
|
358 #endif |