From 064827b96c3dc895446be0929cd509da1cfd18ac Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Mon, 30 Jan 2012 23:39:15 +0100 Subject: [PATCH 1/2] Document XMPPConnectionDelegate --- src/XMPPConnection.h | 70 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/src/XMPPConnection.h b/src/XMPPConnection.h index 91213ad..bab5e1e 100644 --- a/src/XMPPConnection.h +++ b/src/XMPPConnection.h @@ -32,6 +32,10 @@ @class SSLSocket; @class XMPPMulticastDelegate; +/** + * \brief A protocol should be (partially) implemented + * by delegates of a XMPPConnection + */ @protocol XMPPConnectionDelegate #ifndef XMPP_CONNECTION_M @@ -39,21 +43,87 @@ #ifdef OF_HAVE_OPTIONAL_PROTOCOLS @optional #endif + +/** + * This callback is called when the connection received an element + * + * \param connection The connection that received the element + * \param element The element that was received + */ - (void)connection: (XMPPConnection*)connection didReceiveElement: (OFXMLElement*)element; + +/** + * This callback is called when the connection sent an element + * + * \param connection The connection that sent the element + * \param element The element that was sent + */ - (void)connection: (XMPPConnection*)connection didSendElement: (OFXMLElement*)element; + +/** + * This callback is called when the connection sucessfully authenticated + * + * \param connection The connection that was authenticated + */ - (void)connectionWasAuthenticated: (XMPPConnection*)connection; + +/** + * This callback is called when the connection was bound to a JID + * + * \param connection The connection that was bound to a JID + * \param JID The JID the conecction was bound to + */ - (void)connection: (XMPPConnection*)connection wasBoundToJID: (XMPPJID*)JID; + +/** + * This callback is called when the connection received an IQ stanza + * + * \param connection The connection that received the stanza + * \param iq The IQ stanza that was received + */ - (BOOL)connection: (XMPPConnection*)connection didReceiveIQ: (XMPPIQ*)iq; + +/** + * This callback is called when the connection received a presence stanza + * + * \param connection The connection that received the stanza + * \param presence The presence stanza that was received + */ - (void)connection: (XMPPConnection*)connection didReceivePresence: (XMPPPresence*)presence; + +/** + * This callback is called when the connection received a message stanza + * + * \param connection The connection that received the stanza + * \param message The message stanza that was received + */ - (void)connection: (XMPPConnection*)connection didReceiveMessage: (XMPPMessage*)message; + +/** + * This callback is called when the connection was closed + * + * \param connection The connection that was closed + */ - (void)connectionWasClosed: (XMPPConnection*)connection; + +/** + * This callback is called when the connection is about to upgraded to TLS + * + * \param connection The connection that will upgraded to TLS + */ - (void)connectionWillUpgradeToTLS: (XMPPConnection*)connection; + +/** + * This callback is called when the connection was upgraded to use TLS + * + * \param connection The connection that was upgraded to TLS + */ - (void)connectionDidUpgradeToTLS: (XMPPConnection*)connection; @end From b6e0e916e1e4b0983582085167fdd8f0bdee0062 Mon Sep 17 00:00:00 2001 From: Florian Zeitz Date: Wed, 1 Feb 2012 01:26:06 +0100 Subject: [PATCH 2/2] Document XMPPMulticastDelegate --- src/XMPPConnection.h | 2 +- src/XMPPMulticastDelegate.h | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/src/XMPPConnection.h b/src/XMPPConnection.h index bab5e1e..efb44be 100644 --- a/src/XMPPConnection.h +++ b/src/XMPPConnection.h @@ -34,7 +34,7 @@ /** * \brief A protocol should be (partially) implemented - * by delegates of a XMPPConnection + * by delegates of a XMPPConnection */ @protocol XMPPConnectionDelegate #ifndef XMPP_CONNECTION_M diff --git a/src/XMPPMulticastDelegate.h b/src/XMPPMulticastDelegate.h index c3abb90..aab437d 100644 --- a/src/XMPPMulticastDelegate.h +++ b/src/XMPPMulticastDelegate.h @@ -24,15 +24,44 @@ @class OFDataArray; +/** + * \brief A class to provide multiple delegates in a single class + */ @interface XMPPMulticastDelegate: OFObject { OFDataArray *delegates; } +/** + * Adds a delegate to the set of managed delegates + * + * \param delegate The delegate to add + */ - (void)addDelegate: (id)delegate; + +/** + * Removes a delegate from the set of managed delegates + * + * \param delegate The delegate to remove + */ - (void)removeDelegate: (id)delegate; + +/** + * Broadcasts a selector with one object to all managed delegates + * + * \param selector The selector to broadcast + * \param object The object to broadcast + */ - (BOOL)broadcastSelector: (SEL)selector withObject: (id)object; + +/** + * Broadcasts a selector with two objects to all managed delegates + * + * \param selector The selector to broadcast + * \param object1 The first object to broadcast + * \param object2 The second object to broadcast + */ - (BOOL)broadcastSelector: (SEL)selector withObject: (id)object1 withObject: (id)object2;