|
||
This page describes how to migrate data recognizers to the secure version of Symbian OS. It describes:
You can find more information in How to write a data recognizer.
Convert data recognizers into ECOM plugins by:
Change the project specification (.mmp
) file to specify an
ECOM plugin. For example:
target EXAMPLEREC.DLL
targettype PLUGIN
UID 0x10009D8D <DLLUID>
capability ProtServ
sourcepath ..\path
systeminclude ..\inc
systeminclude ..\inc\ecom
source EXAMPLEREC.CPP
start resource <DLLUID>.RSC
TARGET examplerec.rsc
library EUSER.LIB APMIME.LIB
Change the ECOM resource file to specify the:
interface UID. This identifies the plugin scheme, and should be
0x101F7D87
for data recognizers
implementation UID. This uniquely identifies the plugin.
For example:
#include <RegistryInfo.rh>
RESOURCE REGISTRY_INFO r_registry
{
dll_uid = <DLLUID>; // Should match the name of this file
// The name of the resource file is <DLLUID>.rss
interfaces =
{
INTERFACE_INFO
{
interface_uid = 0x101F7D87; // Const for all data recognizers
implementations =
{
IMPLEMENTATION_INFO
{
implementation_uid = <Unique Implementation Uid>;
version_no = 1;
display_name = "DataRecName";
default_data = "";
opaque_data = "";
}
};
}
};
}
Both the data recognizer's .h
and .cpp
files
need code adding to create the data recognizer. For example:
class CExampleDataRecognizer : public CApaDataRecognizerType
{
public:
static CApaDataRecognizerType* CreateRecognizerL();
};
CApaDataRecognizerType* CExampleDataRecognizer::CreateRecognizerL()
{
return new (ELeave) CExampleDataRecognizer ();
}
const TImplementationProxy ImplementationTable[] =
{
IMPLEMENTATION_PROXY_ENTRY(UNIQUE IMPLEMENTATION UID, CExampleDataRecognizer::CreateRecognizerL)
};
EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
{
aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy);
return ImplementationTable;
}
// Remove the previously EXPORTED function
EXPORT_C CApaDataRecognizerType* CreateRecognizer ()
{
}
You can convert data recognizers into plugins of the sort used before Platform Security was introduced by:
Change the project specification (.mmp
) file to specify a
plugin of the style used before Platform Security was introduced. For example:
target EXAMPLEREC.MDL
targettype DLL
UID 0x10003A37 <DLLUID>
capability TrustedUI ProtServ
sourcepath ..\path
systeminclude ..\inc
source EXAMPLEREC.CPP
library EUSER.LIB APMIME.LIB
The data recognizer's .cpp
file needs code adding to
create the data recognizer. For example:
EXPORT_C CApaDataRecognizerType* CreateRecognizer()
{
CExampleDataRecognizer * thing=NULL;
thing = new CExampleDataRecognizer();
return thing; // null if new failed
}