ObjXMPP  Check-in [7738fa4342]

Overview
Comment:Merge.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 7738fa434286359c76d5a536f5ad195d9aea4a805da7add06b047cafe0722b98
User & Date: js on 2012-02-03 09:40:34
Other Links: manifest | tags
Context
2012-02-03
09:40
Merge. check-in: 7738fa4342 user: js tags: trunk
08:05
Change -[XMPPMessage addBody:] to -[XMPPMessage setBody:]. check-in: 694e1355dd user: js tags: trunk
07:50
Fix typo check-in: b28575775d user: florob@babelmonkeys.de tags: trunk
2012-02-01
00:26
Document XMPPMulticastDelegate check-in: 34a22d87a9 user: florob@babelmonkeys.de tags: trunk
Changes

Modified src/XMPPConnection.h from [e09a304408] to [0771aeff14].

28
29
30
31
32
33
34




35
36
37
38
39
40
41







42
43







44
45






46







47
48







49
50







51
52







53
54






55






56






57
58
59
60
61
62
63
@class XMPPIQ;
@class XMPPMessage;
@class XMPPPresence;
@class XMPPAuthenticator;
@class SSLSocket;
@class XMPPMulticastDelegate;





@protocol XMPPConnectionDelegate
#ifndef XMPP_CONNECTION_M
    <OFObject>
#endif
#ifdef OF_HAVE_OPTIONAL_PROTOCOLS
@optional
#endif







-  (void)connection: (XMPPConnection*)connection
  didReceiveElement: (OFXMLElement*)element;







- (void)connection: (XMPPConnection*)connection
    didSendElement: (OFXMLElement*)element;






- (void)connectionWasAuthenticated: (XMPPConnection*)connection;







- (void)connection: (XMPPConnection*)connection
     wasBoundToJID: (XMPPJID*)JID;







- (BOOL)connection: (XMPPConnection*)connection
      didReceiveIQ: (XMPPIQ*)iq;







-   (void)connection: (XMPPConnection*)connection
  didReceivePresence: (XMPPPresence*)presence;







-  (void)connection: (XMPPConnection*)connection
  didReceiveMessage: (XMPPMessage*)message;






- (void)connectionWasClosed: (XMPPConnection*)connection;






- (void)connectionWillUpgradeToTLS: (XMPPConnection*)connection;






- (void)connectionDidUpgradeToTLS: (XMPPConnection*)connection;
@end

/**
 * \brief A class which abstracts a connection to an XMPP service.
 */
@interface XMPPConnection: OFObject







>
>
>
>







>
>
>
>
>
>
>


>
>
>
>
>
>
>


>
>
>
>
>
>

>
>
>
>
>
>
>


>
>
>
>
>
>
>


>
>
>
>
>
>
>


>
>
>
>
>
>
>


>
>
>
>
>
>

>
>
>
>
>
>

>
>
>
>
>
>







28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
@class XMPPIQ;
@class XMPPMessage;
@class XMPPPresence;
@class XMPPAuthenticator;
@class SSLSocket;
@class XMPPMulticastDelegate;

/**
 * \brief A protocol should be (partially) implemented
 *	  by delegates of a XMPPConnection
 */
@protocol XMPPConnectionDelegate
#ifndef XMPP_CONNECTION_M
    <OFObject>
#endif
#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

/**
 * \brief A class which abstracts a connection to an XMPP service.
 */
@interface XMPPConnection: OFObject

Modified src/XMPPMulticastDelegate.h from [7474d32e16] to [dd96fb9a11].

20
21
22
23
24
25
26



27
28
29
30
31





32






33







34
35








36
37
38
39
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import <ObjFW/OFObject.h>

@class OFDataArray;




@interface XMPPMulticastDelegate: OFObject
{
	OFDataArray *delegates;
}






- (void)addDelegate: (id)delegate;






- (void)removeDelegate: (id)delegate;







- (BOOL)broadcastSelector: (SEL)selector
	       withObject: (id)object;








- (BOOL)broadcastSelector: (SEL)selector
	       withObject: (id)object1
	       withObject: (id)object2;
@end







>
>
>





>
>
>
>
>

>
>
>
>
>
>

>
>
>
>
>
>
>


>
>
>
>
>
>
>
>




20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import <ObjFW/OFObject.h>

@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;
@end