Yate
JGEvent Class Reference

A Jingle event. More...

#include <yatejingle.h>

Public Types

enum  Type {
  Jingle , ResultOk , ResultError , ResultTimeout ,
  Terminated , Destroy
}
 

Public Member Functions

virtual ~JGEvent ()
 
Type type () const
 
const char * name ()
 
JGSessionsession () const
 
XmlElementelement () const
 
XmlElementjingle () const
 
JGSession::Action action () const
 
const char * actionName () const
 
const Stringid () const
 
const Stringreason () const
 
const Stringtext () const
 
XmlElementreleaseXml ()
 
bool final () const
 
bool confirmElement (XMPPError::Type error=XMPPError::NoError, const char *text=0, XMPPError::ErrorType type=XMPPError::TypeModify)
 
void setConfirmed ()
 
void setAction (JGSession::Action act)
 

Static Public Member Functions

static const char * lookupType (int type)
 

Public Attributes

ObjList m_contents
 
ObjList m_streamHosts
 

Static Public Attributes

static const TokenDict s_typeName []
 

Protected Member Functions

 JGEvent (Type type, JGSession *session, XmlElement *element=0, const char *reason=0, const char *text=0)
 
 JGEvent (JGSession::Action act, JGSession *session, XmlElement *element, const char *reason=0, const char *text=0)
 

Friends

class JGSession
 
class JGSession0
 
class JGSession1
 

Detailed Description

A Jingle event.

This class holds an event generated by a Jingle session

Member Enumeration Documentation

◆ Type

enum Type

Jingle events enumeration

Constructor & Destructor Documentation

◆ ~JGEvent()

virtual ~JGEvent ( )
virtual

Destructor. Deref the session. Delete the XML element

◆ JGEvent() [1/2]

JGEvent ( Type type,
JGSession * session,
XmlElement * element = 0,
const char * reason = 0,
const char * text = 0 )
inlineprotected

Constructor. Set the id parameter if the element is valid

Parameters
typeEvent type
sessionThe session that generated this event
elementOptional XML element that generated this event
reasonOptional reason data
textOptional text data

References element(), reason(), session(), text(), and type().

◆ JGEvent() [2/2]

JGEvent ( JGSession::Action act,
JGSession * session,
XmlElement * element,
const char * reason = 0,
const char * text = 0 )
inlineprotected

Constructor. Create a Jingle event. Set the id parameter if the element is valid

Parameters
actThe jingle action
sessionThe session that generated this event
elementXML element that generated this event
reasonOptional reason data
textOptional text data

References element(), reason(), session(), setAction(), and text().

Member Function Documentation

◆ action()

JGSession::Action action ( ) const
inline

Get the jingle action as enumeration

Returns
The jingle action as enumeration

◆ actionName()

const char * actionName ( ) const
inline

Get the name of an action

Returns
The name of an action

References JGSession::lookupAction().

◆ confirmElement()

bool confirmElement ( XMPPError::Type error = XMPPError::NoError,
const char * text = 0,
XMPPError::ErrorType type = XMPPError::TypeModify )
inline

Confirm the element carryied by this event. See JGSession::confirm() for details

Parameters
errorThe error condition
textOptional text to add to the error element
typeError type
Returns
False if send failed or element is 0

References element(), releaseXml(), text(), and type().

◆ element()

XmlElement * element ( ) const
inline

Get the XML element that generated this event

Returns
The XML element that generated this event

Referenced by confirmElement(), JGEvent(), and JGEvent().

◆ final()

bool final ( ) const
inline

Check if this event is a final one (Terminated or Destroy)

Returns
True if it is

◆ id()

const String & id ( ) const
inline

Get the id

Returns
The id

◆ jingle()

XmlElement * jingle ( ) const
inline

Get the Jingle child of the XML element carried by the event Don't delete it after use: it is owned by the event

Returns
The Jingle child of the XML element carried by the event

◆ lookupType()

static const char * lookupType ( int type)
inlinestatic

Get the name of an event type

Returns
The name of an event type

References s_typeName, and type().

Referenced by name().

◆ name()

const char * name ( )
inline

Get the name of this

Returns
The name of this event

References lookupType().

◆ reason()

const String & reason ( ) const
inline

Get the reason

Returns
The reason

Referenced by JGEvent(), and JGEvent().

◆ releaseXml()

XmlElement * releaseXml ( )
inline

Get the XML element that generated this event and set it to 0

Returns
The XML element that generated this event

Referenced by confirmElement().

◆ session()

JGSession * session ( ) const
inline

Get the session that generated this event

Returns
The session that generated this event

Referenced by JGEvent(), and JGEvent().

◆ setAction()

void setAction ( JGSession::Action act)

Set the jingle action as enumeration. Set confirmation flag if the element don't require it

Parameters
actThe jingle action as enumeration

Referenced by JGEvent().

◆ setConfirmed()

void setConfirmed ( )
inline

Set the confirmed flag. Use it for action with delayed response

◆ text()

const String & text ( ) const
inline

Get the text

Returns
The text

Referenced by confirmElement(), JGEvent(), and JGEvent().

◆ type()

Type type ( ) const
inline

Get the type of this event

Returns
The type of this event as enumeration

Referenced by confirmElement(), JGEvent(), and lookupType().

Member Data Documentation

◆ m_contents

ObjList m_contents

The list of session contents if used

◆ m_streamHosts

ObjList m_streamHosts

The list of stream hosts if used

◆ s_typeName

const TokenDict s_typeName[]
static

Dictionary with event type names

Referenced by lookupType().


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