diff -r 89d6a7a84779 -r 25a17d01db0c Symbian3/PDK/Source/GUID-B5F98445-3CFF-5067-B89A-AC80F56C40C3.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/PDK/Source/GUID-B5F98445-3CFF-5067-B89A-AC80F56C40C3.dita Fri Jan 22 18:26:19 2010 +0000 @@ -0,0 +1,116 @@ + + + + + +Porting +Data Recognizers to Secure PlatformThis page describes how to migrate data recognizers to the secure +version of Symbian platform. +
Procedure

Converting +data recognizers into ECOM plugins

    +
  1. Changing the project +specification (.mmp) file - Change the project specification (.mmp) +file to specify an ECOM plug-in. 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

  2. +
  3. Changing the ECOM +resource file - Change the ECOM resource file to specify:

      +
    • 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 = ""; + } + }; + } + }; +}
  4. +
  5. Changing the source +code -

    Both the data recognizer's .h and .cpp files +need code adding to create the data recognizer. For example:

    example.h

    +class CExampleDataRecognizer : public CApaDataRecognizerType + { + public: + static CApaDataRecognizerType* CreateRecognizerL(); + };

    example.cpp

    +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 () + { + }
  6. +

Converting data +recognizers into pre-platform security style plugins

You can convert +data recognizers into plug-ins of the sort used before Platform Security was +introduced by:

    +
  1. Changing the project +specification (.mmp) file - Change the project specification (.mmp) +file to specify a plug-in 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

  2. +
  3. Changing the source +code - The data recognizer's .cpp file needs code +adding to create the data recognizer. For example:

    example.cpp

    EXPORT_C CApaDataRecognizerType* CreateRecognizer() + { + CExampleDataRecognizer * thing=NULL; + thing = new CExampleDataRecognizer(); + return thing; // null if new failed + }
  4. +
+
See also

Writing +a MIME Recognizer.

+
\ No newline at end of file