Porting Notifiers to Secure Platform

This page describes how to migrate notifiers to Symbian OS v9.1.

Introduction

Notifier plug-in DLLs ("notifiers") allow components with no direct UI linkage to interact with the user through a UI element; for example, a dialog box.

You can migrate notifiers to Symbian OS v9.1 without major changes. Any notifier classes derived from MEikSrvNotifierBase must now derive from MEikSrvNotifierBase2. An enumeration is used to define an ECom-based notifier plug-in interface. This acts as a primary key to separate ECom-based notifier plug-ins from other types.

Note: The Symbian platform architecture still supports old-style (non-ECom-based) plug-ins.

Notifiers have the following features:

  • They can be installed in ROM (Z:), RAM (C:), or on a memory card (for example, E:).

  • They can be installed and un-installed using SIS files.

  • A single plug-in DLL can provide multiple notifiers. The plug-in DLL returns an array of MEikSrvNotifierBase2 class pointers through ECom.

  • Each notifier can have multiple implementations.

Notifier source code example

ECom defines standard framework functions that plug-ins implement. Here is an example of the required notifier source code:

EXPORT_C CArrayPtr<MEikSrvNotifierBase2>* NotifierArray1()
// Lib main entry point
      {...}
 
EXPORT_C CArrayPtr<MEikSrvNotifierBase2>* NotifierArray2()
// Lib main entry point
      {...}
 
// Adding ECom support
#include <ImplementationProxy.h>
const TImplementationProxy ImplementationTable[] =
      {
      IMPLEMENTATION_PROXY_ENTRY(0x10022238,NotifierArray1),
      IMPLEMENTATION_PROXY_ENTRY(0x10022237,NotifierArray2)
      }; 
EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount)
      {
      aTableCount = sizeof(ImplementationTable)/sizeof(TImplementationProxy);
      return ImplementationTable;
       }

Resource file example

ECom uses resource files to define the main elements of application GUIs. Resource file names must have the format: <dll_uid>.rss.

The following UIDs may appear in the resource file.

UID Name

Description

dll_uid

The UID of the notifier plug-in DLL.

interface_uid

The interface UID for all notifiers, which is defined in uikon.hrh as:

#define KUikonUidpluginInterfaceNotifiers    0x101fdfae.

implementation_uid

This is implementation-specific.

plug-in_UID

The notifier’s UID.

channel_UID

The channel for a notifier (for example, a screen or LED).

Together, the plug-in_UID and channel_UID uniquely identify the notifier plug-in.

The following resource file corresponds to the C++ Source code, above. It defines two implementations of the notifier interface.

// 10021239.rss
//

#include "RegistryInfo.rh"
#include "Uikon.hrh"

RESOURCE REGISTRY_INFO theInfo
   {
      dll_uid = 0x10021239;
      interfaces =
      {
      INTERFACE_INFO
            {
            interface_uid = KUikonUidPluginInterfaceNotifiers;
            implementations =
                  {
                  IMPLEMENTATION_INFO
                        {
                        implementation_uid = 0x10022237;
                        version_no = 1;
                        display_name = "TTNOTIFY2V2 Plugin 1";
                        default_data = "TTNOTIFY2V2";
                        opaque_data     = "0";
                        },
                  IMPLEMENTATION_INFO
                        {
                        implementation_uid = 0x10022238;
                        version_no = 1;
                        display_name = "TTNOTIFY2V2 Plugin 2";
                        default_data = "TTNOTIFY2V2";
                        opaque_data     = "0";
                        }
                  };
            }
      };
}

MMP file example

This is an example project specification (.mmp) file for the notifier:

target            TESTNOTIFIER.DLL 
targettype        PLUGIN 
capability         TrustedUI ProtServ 
UID                0x10009D8D 0x10021239 
sourcepath        ...
userinclude        ... 
systeminclude    \epoc32\include \epoc32\include\techview 
lang                SC 

start resource    10021239.rss  
target            TESTNOTIFIER.rsc  

start resource    TNOTDIAL.RSS 
targetpath        \private\10003a4a 
header 
end 
source            filename.cpp 
library            ECOM.LIB

Related concepts