MessageEventFilter Class Reference

This class adds Message Event (JEP-0022) support to a MessageSession. More...

#include <messageeventfilter.h>

Inherits MessageFilter.

Inheritance diagram for MessageEventFilter:

Inheritance graph
[legend]
Collaboration diagram for MessageEventFilter:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MessageEventFilter (MessageSession *parent, int defaultEvents=MessageEventOffline|MessageEventDelivered|MessageEventDisplayed|MessageEventComposing)
virtual ~MessageEventFilter ()
void raiseMessageEvent (MessageEventType event)
void registerMessageEventHandler (MessageEventHandler *meh)
void removeMessageEventHandler ()
virtual void decorate (Tag *tag)
virtual void filter (Stanza *stanza)

Detailed Description

This class adds Message Event (JEP-0022) support to a MessageSession.

This implementation of Message Events is fully transparent to the user of the class. If the remote entity does not request message events, MessageEventFilter will not send any, even if the user requests it. (This is required by the protocol specification.)

Author:
Jakob Schroeter <js@camaya.net>
Since:
0.8

Definition at line 37 of file messageeventfilter.h.


Constructor & Destructor Documentation

MessageEventFilter ( MessageSession parent,
int  defaultEvents = MessageEventOffline|MessageEventDelivered|MessageEventDisplayed|MessageEventComposing 
)

Contstructs a new Message Event filter for a MessageSession.

Parameters:
parent The MessageSession to decorate.
defaultEvents Bit-wise ORed MessageEventType's which shall be requested for every message sent. Default: all.

Definition at line 22 of file messageeventfilter.cpp.

~MessageEventFilter (  )  [virtual]

Virtual destructor.

Definition at line 28 of file messageeventfilter.cpp.


Member Function Documentation

void raiseMessageEvent ( MessageEventType  event  ) 

Use this function to raise an event as defined in JEP-0022.

Note:
The Spec states that Message Events shall not be sent to an entity which did not request them. Reasonable effort is taken in this function to avoid spurious event sending. You should be safe to call this even if Message Events were not requested by the remote entity. However, calling raiseMessageEvent( MESSAGE_EVENT_COMPOSING ) for every keystroke still is discouraged. ;)
Parameters:
event The event to raise.

Definition at line 72 of file messageeventfilter.cpp.

void registerMessageEventHandler ( MessageEventHandler meh  ) 

The MessageEventHandler registered here will receive Message Events according to JEP-0022.

Parameters:
meh The MessageEventHandler to register.

Definition at line 135 of file messageeventfilter.cpp.

void removeMessageEventHandler (  ) 

This function clears the internal pointer to the MessageEventHandler. Message Events will not be delivered anymore after calling this function until another MessageEventHandler is registered.

Definition at line 140 of file messageeventfilter.cpp.

void decorate ( Tag tag  )  [virtual]

This function receives a message right before it is sent out (there may be other filters which get to see the message after this filter, though).

Parameters:
tag The tag to decorate. It contains the message to be sent.

Implements MessageFilter.

Definition at line 116 of file messageeventfilter.cpp.

void filter ( Stanza stanza  )  [virtual]

This function receives a message stanza right after it was received (there may be other filters which got to see the stanza before this filter, though).

Parameters:
stanza The complete message stanza.

Implements MessageFilter.

Definition at line 32 of file messageeventfilter.cpp.


The documentation for this class was generated from the following files:
Generated on Tue May 1 14:20:24 2007 for gloox by  doxygen 1.5.1