|
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-7F4692A0-1801-5D91-8F28-06075AC45DE2" xml:lang="en"><title>Filtering |
|
13 Implementations by Vendor ID </title><shortdesc>The Plug-in framework clients can be restricted to use plug-ins |
|
14 supplied by a particular company. This enables to enhance security and improve |
|
15 functionality of the framework. </shortdesc><prolog><metadata><keywords/></metadata></prolog><taskbody> |
|
16 <context><p>Platform security provides a mechanism to mark the plug-ins with |
|
17 a vendor identifier by using the <codeph>vendorid</codeph> keyword in the <xref href="GUID-641A276D-F618-50CE-BA5A-658DCC26BAB5.dita">project file</xref>. This |
|
18 information is used for plug-in selection. </p><p>To filter implementations |
|
19 by vendor id there is no need to use the <codeph>TEComResolverParams</codeph> object. |
|
20 Instead, follow the steps described below: </p> </context> |
|
21 <steps id="GUID-C7923C51-397D-5E3B-B47C-F19AD21743FF"> |
|
22 <step id="GUID-7E2CAE34-C937-50E7-BA83-44CB02E95A1A"><cmd/> |
|
23 <info>Retrieve the list of available implementations of an interface using <xref href="GUID-1344F049-81C4-3D17-AF46-8B5584680ADB.dita#GUID-1344F049-81C4-3D17-AF46-8B5584680ADB/GUID-AE9D4F24-8554-3151-AAF3-D63F400821C4"><apiname>REComSession::ListImplementationsL()</apiname></xref>. </info> |
|
24 </step> |
|
25 <step id="GUID-82D683A5-7BE6-5E4D-9686-30869F71E617"><cmd/> |
|
26 <info>Retrieve the vendor ID of the implementation, using <xref href="GUID-3107B19B-0607-3E9E-AEA5-BAD07EEC59D0.dita#GUID-3107B19B-0607-3E9E-AEA5-BAD07EEC59D0/GUID-372E7F18-EAA3-3B85-950D-72E3C09072C8"><apiname> |
|
27 CImplementationInformation::VendorId()</apiname></xref>. </info> |
|
28 <info>If the matching vendor ID is returned, use the plug-in as required. </info> |
|
29 </step> |
|
30 </steps> |
|
31 <example id="GUID-F6140DF5-515F-5C42-B905-E8BC64380410"><title>Filtering implementations |
|
32 by vendor ID example</title> <codeblock id="GUID-21D942BD-CDC5-5976-A760-2607A1D88F7F" xml:space="preserve">// Specify interface for which to get implementations |
|
33 TUid interfaceUid={0111111111}; |
|
34 RImplInfoPtrArray implArray; |
|
35 // get list of implementations into the array |
|
36 REComSession::ListImplementationsL(interfaceUid, implArray); |
|
37 |
|
38 // loop through implementations |
|
39 TInt implCount = implArray.Count(); |
|
40 for(TInt count = 0; count < implCount; count++) |
|
41 { |
|
42 // read vendor ID |
|
43 const CImplementationInformation* implInfo = implArray[count]; |
|
44 TVendorId vid = implInfo->VendorId(); |
|
45 |
|
46 . . . |
|
47 |
|
48 } |
|
49 |
|
50 . . . |
|
51 |
|
52 implArray.ResetAndDestroy(); |
|
53 REComSession::FinalClose();</codeblock> </example> |
|
54 </taskbody></task> |