|
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 concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-B5F98445-3CFF-5067-B89A-AC80F56C40C3" xml:lang="en"><title>Porting |
|
13 Data Recognizers to Secure Platform</title><shortdesc>This page describes how to migrate data recognizers to the secure |
|
14 version of Symbian platform. </shortdesc><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
15 <section><title>Procedure</title> <p id="GUID-37D4A6C5-1A14-5CE3-A852-1AAD412C57DA"><b>Converting |
|
16 data recognizers into ECOM plugins</b> </p> <ol id="GUID-56EF676C-103E-5B68-85A1-D6A66B9EC046"> |
|
17 <li id="GUID-18ED65F4-B508-5DC7-8869-A5035C7922B3"><b>Changing the project |
|
18 specification (.mmp) file</b> - Change the project specification (<filepath>.mmp</filepath>) |
|
19 file to specify an ECOM plug-in. For example: <p><codeblock id="GUID-8AD243FE-63AE-5971-98BA-D105E2756FCA" xml:space="preserve">target EXAMPLEREC.DLL |
|
20 targettype PLUGIN |
|
21 UID 0x10009D8D <DLLUID> |
|
22 capability ProtServ |
|
23 sourcepath ..\path |
|
24 systeminclude ..\inc |
|
25 systeminclude ..\inc\ecom |
|
26 source EXAMPLEREC.CPP |
|
27 start resource <DLLUID>.RSC |
|
28 TARGET examplerec.rsc |
|
29 library EUSER.LIB APMIME.LIB</codeblock> </p> </li> |
|
30 <li id="GUID-202CFB50-4DE2-5BD5-8F3B-03C3305DD992"><p><b>Changing the ECOM |
|
31 resource file</b> - Change the ECOM resource file to specify:</p> <ul> |
|
32 <li id="GUID-E0038901-3017-5B9D-9F2E-4ACC3877AEE6"><p>interface UID. This |
|
33 identifies the plugin scheme, and should be <codeph>0x101F7D87</codeph> for |
|
34 data recognizers </p> </li> |
|
35 <li id="GUID-C4D4DAB8-DD0B-597D-A9A8-E3A202A15688"><p>implementation UID. |
|
36 This uniquely identifies the plugin. </p> </li> |
|
37 </ul><p>For example: </p> <codeblock id="GUID-47351321-C97D-553C-8E32-6D3F9D08C380" xml:space="preserve">#include <RegistryInfo.rh> |
|
38 RESOURCE REGISTRY_INFO r_registry |
|
39 { |
|
40 dll_uid = <DLLUID>; // Should match the name of this file |
|
41 // The name of the resource file is <DLLUID>.rss |
|
42 interfaces = |
|
43 { |
|
44 INTERFACE_INFO |
|
45 { |
|
46 interface_uid = 0x101F7D87; // Const for all data recognizers |
|
47 implementations = |
|
48 { |
|
49 IMPLEMENTATION_INFO |
|
50 { |
|
51 implementation_uid = <Unique Implementation Uid>; |
|
52 version_no = 1; |
|
53 display_name = "DataRecName"; |
|
54 default_data = ""; |
|
55 opaque_data = ""; |
|
56 } |
|
57 }; |
|
58 } |
|
59 }; |
|
60 }</codeblock></li> |
|
61 <li id="GUID-0C63777C-524D-55F3-9C17-34D2FB26A1E3"><p><b>Changing the source |
|
62 code</b> - </p> Both the data recognizer's <filepath>.h</filepath> and <filepath>.cpp</filepath> files |
|
63 need code adding to create the data recognizer. For example: <p><b>example.h</b> </p> <codeblock id="GUID-7571422C-2A48-53D6-8385-6F3AAA07BC3F" xml:space="preserve"> |
|
64 class CExampleDataRecognizer : public CApaDataRecognizerType |
|
65 { |
|
66 public: |
|
67 static CApaDataRecognizerType* CreateRecognizerL(); |
|
68 };</codeblock> <p><b>example.cpp</b> </p> <codeblock id="GUID-CC663D38-25C1-58D9-8E27-054AEC4C08F4" xml:space="preserve"> |
|
69 CApaDataRecognizerType* CExampleDataRecognizer::CreateRecognizerL() |
|
70 { |
|
71 return new (ELeave) CExampleDataRecognizer (); |
|
72 } |
|
73 |
|
74 const TImplementationProxy ImplementationTable[] = |
|
75 { |
|
76 IMPLEMENTATION_PROXY_ENTRY(UNIQUE IMPLEMENTATION UID, CExampleDataRecognizer::CreateRecognizerL) |
|
77 }; |
|
78 |
|
79 EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) |
|
80 { |
|
81 aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); |
|
82 return ImplementationTable; |
|
83 } |
|
84 |
|
85 // Remove the previously EXPORTED function |
|
86 EXPORT_C CApaDataRecognizerType* CreateRecognizer () |
|
87 { |
|
88 }</codeblock></li> |
|
89 </ol> <p id="GUID-7AA2AA79-4CD2-5C44-BE9B-66051E22514F"><b>Converting data |
|
90 recognizers into pre-platform security style plugins</b> </p> <p>You can convert |
|
91 data recognizers into plug-ins of the sort used before Platform Security was |
|
92 introduced by: </p> <ol id="GUID-BC2F8B96-B270-58A2-A4BD-D09EDB7F7A7A"> |
|
93 <li id="GUID-BA29280D-2CE5-5E8C-8805-8D841EB364C7"><b>Changing the project |
|
94 specification (.mmp) file</b> - Change the project specification (<filepath>.mmp</filepath>) |
|
95 file to specify a plug-in of the style used before Platform Security was introduced. |
|
96 For example: <p><codeblock id="GUID-521E33C5-9A00-5C8A-AC4A-E1D509F82DAA" xml:space="preserve"> |
|
97 target EXAMPLEREC.MDL |
|
98 targettype DLL |
|
99 UID 0x10003A37 <DLLUID> |
|
100 capability TrustedUI ProtServ |
|
101 sourcepath ..\path |
|
102 systeminclude ..\inc |
|
103 source EXAMPLEREC.CPP |
|
104 library EUSER.LIB APMIME.LIB</codeblock> </p> </li> |
|
105 <li id="GUID-757324F0-742B-5FC7-A809-DBAC0ECFA5F9"><p><b>Changing the source |
|
106 code</b> - The data recognizer's <filepath>.cpp</filepath> file needs code |
|
107 adding to create the data recognizer. For example:</p> <p><b>example.cpp</b> </p> <codeblock id="GUID-A16D2566-2C14-5015-AB9B-D54FE96DB906" xml:space="preserve">EXPORT_C CApaDataRecognizerType* CreateRecognizer() |
|
108 { |
|
109 CExampleDataRecognizer * thing=NULL; |
|
110 thing = new CExampleDataRecognizer(); |
|
111 return thing; // null if new failed |
|
112 }</codeblock></li> |
|
113 </ol> </section> |
|
114 <section><title>See also</title> <p><xref href="GUID-1AAA88BB-19AD-5B8E-993C-11F4B7CD90EB.dita">Writing |
|
115 a MIME Recognizer</xref>. </p> </section> |
|
116 </conbody></concept> |