MXIMPContextObserver Class Reference

class MXIMPContextObserver

Interface for XIMP context event observer. This interface must be implemented by the client which is using the XIMP Framework services, to receive status and data notification callbacks from XIMP Framework.

All callbacks from XIMP Framework XIMP context to client direction happen through this interface HandlePresenceContextEvent() method. Data content in callbacks is presented to client with following event specific interfaces:

See event interface type specific documentation for further information about different event types.

Client can dispatch and cast event types on its own event callback implementation in following way:
        void CMyObserverClass::HandlePresenceContextEvent(
      const MXIMPContext& aContext,
      const MXIMPBase& aEvent )
      {
      switch( aEvent.GetInterfaceId() )
          {
          case MXIMPRequestCompleteEvent::KInterfaceId:
              {
              const MXIMPRequestCompleteEvent* complEvent =
                  TXIMPGetInterface< const MXIMPRequestCompleteEvent >::From( aEvent,
                                                                              MXIMPBase::EPanicIfUnknown );

              // Do here request complete event specific handling
              complEvent->RequestId();

              break;
              }


          case MXIMPContextStateEvent::KInterfaceId:
              {
              const MXIMPContextStateEvent* ctxtStateEvent =
                  TXIMPGetInterface< const MXIMPContextStateEvent >::From( aEvent,
                                                                                   MXIMPBase::EPanicIfUnknown );
              // Do here context state event specific handling
              ctxtStateEvent->ContextState();

              break;
              }


          default:
              {
              // New event types may be introduced in newer XIMP Framework
              // versions, so handle unknown event types gracefully.
              break;
              }
          }
      }
       
Since
S60 v3.2

Constructor & Destructor Documentation

~MXIMPContextObserver()

~MXIMPContextObserver ( ) [protected, inline, virtual]

Protected destructor. Observer instancies can't be destroyed via this interface.

Member Functions Documentation

HandlePresenceContextEvent(const MXIMPContext &, const MXIMPBase &)

void HandlePresenceContextEvent ( const MXIMPContext & aContext,
const MXIMPBase & aEvent
) [pure virtual]

Event callback.

Events are delivered as MXIMPBase typed objects to client. Client can use MXIMPBase::GetInterfaceId() to determine the real event interface type.

Parameters

const MXIMPContext & aContext Presence context object from where this event is coming. Provided as reference for client, so client can distinguish events from different contexts.
const MXIMPBase & aEvent The event object. Client can use MXIMPBase::GetInterfaceId() to determine real event type and TXIMPGetInterface helper to cast base typed object to real event interface. Object ownership isn't transfered to client.

PresenceContextObserverExtensionOrNull(TInt32)

TAny * PresenceContextObserverExtensionOrNull ( TInt32 aInterfaceId ) [inline, virtual]

Extension point for this observer interface.

Returns an pointer to MXIMPContextObserver extension interface or NULL if the concrete observer implementation doesn't support requested extension.

Parameters

TInt32 aInterfaceId Interface ID identifying the requested extension interface.