OPAL  Version 3.18.8
OpalIMContext Class Reference

#include <im.h>

Inheritance diagram for OpalIMContext:
Collaboration diagram for OpalIMContext:

Data Structures

struct  CompositionInfo
 
struct  ConversationInfo
 
struct  DispositionInfo
 

Public Member Functions

Member variables
const PString & GetID () const
 Get conversation ID. More...
 
const PString & GetKey () const
 Get key for context based on to/from addresses. More...
 
const PURL & GetRemoteURL () const
 Get remote URL for conversation. More...
 
const PString & GetRemoteName () const
 Get remote display name for conversation. More...
 
const PURL & GetLocalURL () const
 Get local URL for conversation. More...
 
const PString & GetLocalName () const
 Get local display for conversation. More...
 
void SetLocalName (const PString &name)
 Set local display for conversation. More...
 
PStringOptions & GetAttributes ()
 Get the attributes for this presentity. More...
 
const PStringOptions & GetAttributes () const
 

Protected Member Functions

void ResetLastUsed ()
 
virtual MessageDisposition InternalSend ()
 
virtual MessageDisposition InternalSendOutsideCall (OpalIM &message)
 
virtual MessageDisposition InternalSendInsideCall (OpalIM &message)
 
virtual void InternalOnMessageSent (const DispositionInfo &info)
 
 PDECLARE_MUTEX (m_notificationMutex)
 
 PDECLARE_MUTEX (m_outgoingMessagesMutex)
 
 PDECLARE_MUTEX (m_lastUsedMutex)
 

Protected Attributes

OpalIMEndPointm_endpoint
 
PStringOptions m_attributes
 
PSafePtr< OpalCallm_call
 
bool m_weStartedCall
 
MessageDispositionNotifier m_messageDispositionNotifier
 
MessageReceivedNotifier m_messageReceivedNotifier
 
CompositionIndicationNotifier m_compositionIndicationNotifier
 
OpalIMm_currentOutgoingMessage
 
PQueue< OpalIMm_outgoingMessages
 
PTime m_lastUsed
 
PString m_conversationId
 
PURL m_localURL
 
PString m_localName
 
PURL m_remoteURL
 
PString m_remoteName
 
PString m_key
 

Friends

class OpalIMEndPoint
 
class OpalIMConnection
 

Construction

 OpalIMContext ()
 Construct base for context. More...
 
 ~OpalIMContext ()
 Destroy context. More...
 
virtual bool Open (bool byRemote)
 
virtual void Close ()
 

Message transmit

typedef PNotifierTemplate
< DispositionInfo
MessageDispositionNotifier
 Type for disposition notifiers. More...
 
 P_DECLARE_STREAMABLE_ENUM (MessageDisposition, DispositionPending, DispositionAccepted, DeliveryOK, DisplayConfirmed, ProcessedNotification, StorageNotification, DispositionErrors, GenericError, UnacceptableContent, InvalidContent, DestinationUnknown, DestinationUnavailable, TransmissionTimeout, TransportFailure, ConversationClosed, UnsupportedFeature, DeliveryFailed)
 
virtual MessageDisposition Send (OpalIM *message)
 
virtual void OnMessageDisposition (const DispositionInfo &info)
 
void SetMessageDispositionNotifier (const MessageDispositionNotifier &notifier)
 Set the notifier for the OnMessageDisposition() function. More...
 

Message receipt

typedef PNotifierTemplate< OpalIMMessageReceivedNotifier
 Type for message received notifiers. More...
 
virtual MessageDisposition OnMessageReceived (const OpalIM &message)
 
void SetMessageReceivedNotifier (const MessageReceivedNotifier &notifier)
 Set the notifier for the OnMessageReceived() function. More...
 

Message composition

typedef PNotifierTemplate
< CompositionInfo
CompositionIndicationNotifier
 Type for composition indication notifiers. More...
 
virtual bool SendCompositionIndication (const CompositionInfo &info)
 
virtual void OnCompositionIndication (const CompositionInfo &info)
 
void SetCompositionIndicationNotifier (const CompositionIndicationNotifier &notifier)
 Set the notifier for the OnCompositionIndication() function. More...
 
static const PCaselessString & CompositionIndicationActive ()
 CompositionIndication active status. More...
 
static const PCaselessString & CompositionIndicationIdle ()
 CompositionIndication idle status. More...
 

Support functions

virtual bool CheckContentType (const PString &contentType) const
 Check that the context type is valid for protocol. More...
 
virtual PStringArray GetContentTypes () const
 Return array of all valid content types. More...
 
static PString CreateKey (const PURL &from, const PURL &to)
 Calculate a key based on the from an to addresses. More...
 

Detailed Description

Class representing an Instant Messaging "conversation". This keeps the context for Instant Messages between two entities. It is an abstract class whose concrete classes are dependant on the individual protocol being used for the messages. The URL "scheme" field is usually used to distinguish the protocol.

Member Typedef Documentation

Type for composition indication notifiers.

Type for disposition notifiers.

typedef PNotifierTemplate<OpalIM> OpalIMContext::MessageReceivedNotifier

Type for message received notifiers.

Constructor & Destructor Documentation

OpalIMContext::OpalIMContext ( )
protected

Construct base for context.

OpalIMContext::~OpalIMContext ( )

Destroy context.

Member Function Documentation

virtual bool OpalIMContext::CheckContentType ( const PString &  contentType) const
virtual

Check that the context type is valid for protocol.

Parameters
contentTypeMIME Content type to check
virtual void OpalIMContext::Close ( )
virtual

Close the context (conversation) Default behaviour removes the context from the OpalIMEndPoint

static const PCaselessString& OpalIMContext::CompositionIndicationActive ( )
static

CompositionIndication active status.

static const PCaselessString& OpalIMContext::CompositionIndicationIdle ( )
static

CompositionIndication idle status.

static PString OpalIMContext::CreateKey ( const PURL &  from,
const PURL &  to 
)
static

Calculate a key based on the from an to addresses.

PStringOptions& OpalIMContext::GetAttributes ( )
inline

Get the attributes for this presentity.

References m_attributes.

const PStringOptions& OpalIMContext::GetAttributes ( ) const
inline

References m_attributes.

virtual PStringArray OpalIMContext::GetContentTypes ( ) const
virtual

Return array of all valid content types.

const PString& OpalIMContext::GetID ( ) const
inline

Get conversation ID.

const PString& OpalIMContext::GetKey ( ) const
inline

Get key for context based on to/from addresses.

References m_key.

const PString& OpalIMContext::GetLocalName ( ) const
inline

Get local display for conversation.

References m_localName.

const PURL& OpalIMContext::GetLocalURL ( ) const
inline

Get local URL for conversation.

References m_localURL.

const PString& OpalIMContext::GetRemoteName ( ) const
inline

Get remote display name for conversation.

References m_remoteName.

const PURL& OpalIMContext::GetRemoteURL ( ) const
inline

Get remote URL for conversation.

References m_remoteURL.

virtual void OpalIMContext::InternalOnMessageSent ( const DispositionInfo info)
protectedvirtual
virtual MessageDisposition OpalIMContext::InternalSend ( )
protectedvirtual
virtual MessageDisposition OpalIMContext::InternalSendInsideCall ( OpalIM message)
protectedvirtual

Reimplemented in OpalSIPIMContext.

virtual MessageDisposition OpalIMContext::InternalSendOutsideCall ( OpalIM message)
protectedvirtual

Reimplemented in OpalSIPIMContext.

virtual void OpalIMContext::OnCompositionIndication ( const CompositionInfo info)
virtual

Called when the remote composition indication changes state. The default behaviour checks for a notifier and calls that if set.

Parameters
infoNew composition state information
virtual void OpalIMContext::OnMessageDisposition ( const DispositionInfo info)
virtual

Callback indicating the dispostion of a messagesent via Send(). The default behaviour checks for a notifier and calls that if set.

Parameters
infoInformation on the message disposition
virtual MessageDisposition OpalIMContext::OnMessageReceived ( const OpalIM message)
virtual

Called when an incoming message arrives for this context. Default implementation checks for valid MIME content and then calls the notifier, if set. If no notifier is set, then the OpalManager::OnMessageReceived() function is called.

Parameters
messageReceived message

Reimplemented in OpalSIPIMContext.

virtual bool OpalIMContext::Open ( bool  byRemote)
virtual

Open the context (conversation) Default behaviour simply returns true.

Parameters
byRemoteContext was created by remote (incoming message)

Reimplemented in OpalSIPIMContext.

OpalIMContext::P_DECLARE_STREAMABLE_ENUM ( MessageDisposition  ,
DispositionPending  ,
DispositionAccepted  ,
DeliveryOK  ,
DisplayConfirmed  ,
ProcessedNotification  ,
StorageNotification  ,
DispositionErrors  ,
GenericError  ,
UnacceptableContent  ,
InvalidContent  ,
DestinationUnknown  ,
DestinationUnavailable  ,
TransmissionTimeout  ,
TransportFailure  ,
ConversationClosed  ,
UnsupportedFeature  ,
DeliveryFailed   
)

Disposition of message transmission. Get the status of the sent message throughout its life, including how it is handled by teh network, and how it is handled by the remote entity, such as described in RFC5438.

OpalIMContext::PDECLARE_MUTEX ( m_notificationMutex  )
protected
OpalIMContext::PDECLARE_MUTEX ( m_outgoingMessagesMutex  )
protected
OpalIMContext::PDECLARE_MUTEX ( m_lastUsedMutex  )
protected
void OpalIMContext::ResetLastUsed ( )
protected
virtual MessageDisposition OpalIMContext::Send ( OpalIM message)
virtual

Send message in this conversation. This is generally asynchronous and will return quickly with the message procesing happening inthe background.

The eventual disposition of the message transmission is indicated via the OnMessageDisposition() function and it's notifier.

The message parameter should be allocated by the caller and will be destroyed by the context when it is finished with.

Parameters
messageMessage to be sent
virtual bool OpalIMContext::SendCompositionIndication ( const CompositionInfo info)
virtual

Send a composition indication to remote. The text is usually either CompositionIndicationActive() or CompositionIndicationIdle(), howver other extension values may be possible.

Parameters
infoComposition information

Reimplemented in OpalSIPIMContext.

void OpalIMContext::SetCompositionIndicationNotifier ( const CompositionIndicationNotifier notifier)

Set the notifier for the OnCompositionIndication() function.

Parameters
notifierNotifier to be called by protocol
void OpalIMContext::SetLocalName ( const PString &  name)
inline

Set local display for conversation.

References m_localName.

void OpalIMContext::SetMessageDispositionNotifier ( const MessageDispositionNotifier notifier)

Set the notifier for the OnMessageDisposition() function.

Parameters
notifierNotifier to be called by protocol
void OpalIMContext::SetMessageReceivedNotifier ( const MessageReceivedNotifier notifier)

Set the notifier for the OnMessageReceived() function.

Parameters
notifierNotifier to be called by protocol

Friends And Related Function Documentation

friend class OpalIMConnection
friend
friend class OpalIMEndPoint
friend

Field Documentation

PStringOptions OpalIMContext::m_attributes
protected

Referenced by GetAttributes().

PSafePtr<OpalCall> OpalIMContext::m_call
protected
CompositionIndicationNotifier OpalIMContext::m_compositionIndicationNotifier
protected
PString OpalIMContext::m_conversationId
protected
OpalIM* OpalIMContext::m_currentOutgoingMessage
protected
OpalIMEndPoint* OpalIMContext::m_endpoint
protected
PString OpalIMContext::m_key
protected

Referenced by GetKey().

PTime OpalIMContext::m_lastUsed
protected
PString OpalIMContext::m_localName
protected

Referenced by GetLocalName(), and SetLocalName().

PURL OpalIMContext::m_localURL
protected

Referenced by GetLocalURL().

MessageDispositionNotifier OpalIMContext::m_messageDispositionNotifier
protected
MessageReceivedNotifier OpalIMContext::m_messageReceivedNotifier
protected
PQueue<OpalIM> OpalIMContext::m_outgoingMessages
protected
PString OpalIMContext::m_remoteName
protected

Referenced by GetRemoteName().

PURL OpalIMContext::m_remoteURL
protected

Referenced by GetRemoteURL().

bool OpalIMContext::m_weStartedCall
protected

The documentation for this class was generated from the following file: