|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE task |
|
11 PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd"> |
|
12 <task id="GUID-33108CC9-3FF7-4076-A512-FB6F2F0BCC0D" xml:lang="en"><title>Retrieving application information using filters</title><shortdesc>This tutorial describes how application information can |
|
13 be retrieved from the SCR using filters.</shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody> |
|
14 <prereq id="GUID-ED7444CA-D1AF-4617-91E6-ABEBFEBD6259"><p>The Client |
|
15 applications must link against <filepath>scrclient.dll</filepath>. </p></prereq> |
|
16 <steps id="GUID-4DD07DEC-6017-4237-BE46-1D69E5FBD744-GENID-1-12-1-5-1-1-6-1-6-1-4-1-5-1-3-2"> |
|
17 <step id="GUID-9A69E5AD-E938-4092-A8C2-CB65C37C8962-GENID-1-12-1-5-1-1-6-1-6-1-4-1-5-1-3-2-1"><cmd>Connect |
|
18 to the SCR server.</cmd> |
|
19 <info><codeblock xml:space="preserve">#include <usif/scr/scr.h> |
|
20 Usif::RSoftwareComponentRegistry scrSession; |
|
21 scrSession.Connect(); |
|
22 </codeblock></info> |
|
23 </step> |
|
24 <step id="GUID-52B25417-323F-46D8-B572-A65C4B1F8DBA-GENID-1-12-1-5-1-1-6-1-6-1-4-1-5-1-3-2-2"><cmd>Create an |
|
25 object of <codeph>RApplicationInfoView</codeph>.</cmd> |
|
26 <info><codeblock xml:space="preserve">RApplicationInfoView subSession;</codeblock></info> |
|
27 </step> |
|
28 <step id="GUID-5EECC6C2-C7EF-48DF-ABB0-2D0F237B00C8"><cmd>Create a |
|
29 filter object of <codeph>CAppInfoFilter</codeph>.</cmd> |
|
30 <info><codeblock xml:space="preserve">CAppInfoFilter* infoFilter; |
|
31 infoFilter = CAppInfoFilter::NewL(); |
|
32 </codeblock></info> |
|
33 </step> |
|
34 <step id="GUID-4E3FED58-9FB4-474D-BFD9-30267D4054B8"><cmd>Set the |
|
35 filter object properties.</cmd> |
|
36 <info><codeblock xml:space="preserve">// embeddability filter (the extent to which the application can be embedded) |
|
37 // and screen mode (size of the screen) |
|
38 // The filter used below is used to list applications filtered by whether they are |
|
39 // embeddable and have a screen mode value of zero |
|
40 Usif::TEmbeddableFilter embedibilityFilter; |
|
41 embedibilityFilter.AddEmbeddability(EEmbeddable) |
|
42 infoFilter->SetEmbeddabilityFilterWithScreenMode(embedibilityFilter,0); |
|
43 </codeblock></info> |
|
44 </step> |
|
45 <step id="GUID-90F67FCC-E2E4-4BFD-927F-AF59651B8A2D-GENID-1-12-1-5-1-1-6-1-6-1-4-1-5-1-3-2-5"><cmd>Open a <xref href="GUID-5DD9E56F-CDBC-3BBC-B949-8FE10F29152B.dita"><apiname>RApplicationInfoView</apiname></xref> subsession with the filter.</cmd> |
|
46 <info><codeblock xml:space="preserve">subSession.OpenViewL(scrSession,infoFilter); |
|
47 </codeblock></info> |
|
48 </step> |
|
49 <step id="GUID-0D7AF719-87D6-4191-96AE-23193C58C236-GENID-1-12-1-5-1-1-6-1-6-1-4-1-5-1-3-2-6"><cmd>Retrieve |
|
50 the information using <xref href="GUID-5DD9E56F-CDBC-3BBC-B949-8FE10F29152B.dita#GUID-5DD9E56F-CDBC-3BBC-B949-8FE10F29152B/GUID-8B1BB35A-91A3-3E74-82F8-B3A56542551D"><apiname>RApplicationInfoView::GetNextAppInfoL()</apiname></xref>.</cmd> |
|
51 <info><codeblock xml:space="preserve">// GetNextAppInfoL() takes two parameters. The number of entries to be fetched |
|
52 // in a single call and an output parameter of type <codeph>RPointerArray</codeph> |
|
53 // for returning the array. |
|
54 TInt noOfEntries = 5; |
|
55 RPointerArray<TAppRegInfo> infoSet; |
|
56 do { |
|
57 ..... |
|
58 ..... |
|
59 infoSet.ResetAndDestroy(); |
|
60 subSession.GetNextAppInfoL(noOfEntries, infoSet); |
|
61 }while(0 != infoSet.Count()); |
|
62 </codeblock></info> |
|
63 </step> |
|
64 </steps> |
|
65 </taskbody></task> |