Symbian3/PDK/Source/GUID-33108CC9-3FF7-4076-A512-FB6F2F0BCC0D.dita
changeset 12 80ef3a206772
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Symbian3/PDK/Source/GUID-33108CC9-3FF7-4076-A512-FB6F2F0BCC0D.dita	Fri Jul 16 17:23:46 2010 +0100
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
+<!-- This component and the accompanying materials are made available under the terms of the License 
+"Eclipse Public License v1.0" which accompanies this distribution, 
+and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
+<!-- Initial Contributors:
+    Nokia Corporation - initial contribution.
+Contributors: 
+-->
+<!DOCTYPE task
+  PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
+<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
+be retrieved from the SCR using filters.</shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody>
+<prereq id="GUID-ED7444CA-D1AF-4617-91E6-ABEBFEBD6259"><p>The Client
+applications must link against <filepath>scrclient.dll</filepath>. </p></prereq>
+<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">
+<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
+to the SCR server.</cmd>
+<info><codeblock xml:space="preserve">#include &lt;usif/scr/scr.h&gt;
+Usif::RSoftwareComponentRegistry scrSession;
+scrSession.Connect();
+</codeblock></info>
+</step>
+<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
+object of <codeph>RApplicationInfoView</codeph>.</cmd>
+<info><codeblock xml:space="preserve">RApplicationInfoView subSession;</codeblock></info>
+</step>
+<step id="GUID-5EECC6C2-C7EF-48DF-ABB0-2D0F237B00C8"><cmd>Create a
+filter object of <codeph>CAppInfoFilter</codeph>.</cmd>
+<info><codeblock xml:space="preserve">CAppInfoFilter* infoFilter;
+infoFilter = CAppInfoFilter::NewL();
+</codeblock></info>
+</step>
+<step id="GUID-4E3FED58-9FB4-474D-BFD9-30267D4054B8"><cmd>Set the
+filter object properties.</cmd>
+<info><codeblock xml:space="preserve">// embeddability filter (the extent to which the application can be embedded) 
+// and screen mode (size of the screen)
+// The filter used below is used to list applications filtered by whether they are 
+// embeddable and  have a screen mode value of zero
+Usif::TEmbeddableFilter embedibilityFilter;
+embedibilityFilter.AddEmbeddability(EEmbeddable)
+infoFilter-&gt;SetEmbeddabilityFilterWithScreenMode(embedibilityFilter,0);
+</codeblock></info>
+</step>
+<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>
+<info><codeblock xml:space="preserve">subSession.OpenViewL(scrSession,infoFilter);
+</codeblock></info>
+</step>
+<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
+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>
+<info><codeblock xml:space="preserve">// GetNextAppInfoL() takes two parameters. The number of  entries to be fetched 
+// in a single call and an output parameter of type <codeph>RPointerArray</codeph>
+// for returning the array.
+TInt noOfEntries = 5;
+RPointerArray&lt;TAppRegInfo&gt; infoSet;
+do {
+   .....
+   .....
+   infoSet.ResetAndDestroy();
+   subSession.GetNextAppInfoL(noOfEntries, infoSet);
+   }while(0 != infoSet.Count());
+</codeblock></info>
+</step>
+</steps>
+</taskbody></task>
\ No newline at end of file