Symbian
Symbian Developer Library

SYMBIAN OS V9.4

Feedback

[Index] [Previous] [Next]


How To Port Guide: Notifiers

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

[Top]


Overview

Notifier plugin DLLs ("notifiers") allow components with no direct UI linkage to interact with the user via 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 plugin interface. This acts as a primary key to separate ECOM-based notifier plugins from other types.

Note: The new OS architecture still supports old-style (non-ECOM-based) plugins.

Notifiers have the following features:

[Top]


Notifier source code example

ECOM defines standard framework functions that plugins 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;
       }

[Top]


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 plugin 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 plugin.

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

// 10021239.rss
//
// Copyright (c) 2006 Symbian Ltd. All rights reserved.

#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";
                        }
                  };
            }
      };
}

[Top]


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