112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
-
-
+
+
-
-
+
+
-
-
+
+
|
/**
* \brief This callback is called when the connection was closed.
*
* \param connection The connection that was closed
*/
- (void)connectionWasClosed: (XMPPConnection*)connection;
/**
* \brief This callback is called when the connection threw an exception.
/*!
* @brief This callback is called when the connection threw an exception.
*
* This is only called for connections on which \ref handleConnection: has been
* called.
* This is only called for connections on which
* @ref XMPPConnection::handleConnection has been called.
*
* \param connection The connection which threw an exception
* \param exception The exception the connection threw
* @param connection The connection which threw an exception
* @param exception The exception the connection threw
*/
- (void)connection: (XMPPConnection*)connection
didThrowException: (OFException*)exception;
/**
* \brief This callback is called when the connection is about to upgrade to
* TLS.
|
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
|
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
|
-
-
|
* \brief A class which abstracts a connection to an XMPP service.
*/
@interface XMPPConnection: OFObject
#ifdef OF_HAVE_OPTONAL_PROTOCOLS
<OFXMLParserDelegate, OFXMLElementBuilderDelegate>
#endif
{
/// \cond internal
id _socket;
OFXMLParser *_parser, *_oldParser;
OFXMLElementBuilder *_elementBuilder, *_oldElementBuilder;
OFString *_username, *_password, *_server, *_resource;
OFString *_privateKeyFile, *_certificateFile;
OFString *_domain, *_domainToASCII;
XMPPJID *_JID;
uint16_t _port;
id <XMPPStorage> _dataStorage;
OFString *_language;
XMPPMulticastDelegate *_delegates;
OFMutableDictionary *_callbacks;
XMPPAuthenticator *_authModule;
BOOL _streamOpen;
BOOL _needsSession;
BOOL _encryptionRequired, _encrypted;
BOOL _supportsRosterVersioning;
BOOL _supportsStreamManagement;
unsigned int _lastID;
/// \endcond
}
#ifdef OF_HAVE_PROPERTIES
/// \brief The username to use for authentication
@property (copy) OFString *username;
/// \brief The password to use for authentication
@property (copy) OFString *password;
|
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
|
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
|
-
-
+
+
+
-
-
+
+
-
+
-
-
+
+
+
-
+
-
+
|
/**
* \brief Sends an OFXMLElement, usually an XMPPStanza.
*
* \param element The element to send
*/
- (void)sendStanza: (OFXMLElement*)element;
/**
* \brief Sends an XMPPIQ, registering a callback method.
/*!
* @brief Sends an XMPPIQ, registering a callback method.
*
* @param IQ The IQ to send
* \param target The object that contains the callback method
* \param selector The selector of the callback method,
* @param target The object that contains the callback method
* @param selector The selector of the callback method,
* must take exactly one parameter of type XMPPIQ*
*/
- (void)sendIQ: (XMPPIQ*)iq
- (void)sendIQ: (XMPPIQ*)IQ
callbackTarget: (id)target
selector: (SEL)selector;
#ifdef OF_HAVE_BLOCKS
/**
* \brief Sends an XMPPIQ, registering a callback block.
/*!
* @brief Sends an XMPPIQ, registering a callback block.
*
* @param IQ The IQ to send
* \param block The callback block
* @param block The callback block
*/
- (void)sendIQ: (XMPPIQ*)iq
- (void)sendIQ: (XMPPIQ*)IQ
callbackBlock: (xmpp_callback_block_t)block;
#endif
/**
* \brief Generates a new, unique stanza ID.
*
* \return A new, generated, unique stanza ID.
|
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
|
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
|
-
-
|
- (void)setDataStorage: (id <XMPPStorage>)dataStorage;
- (id <XMPPStorage>)dataStorage;
- (void)setLanguage: (OFString*)language;
- (OFString*)language;
- (BOOL)supportsRosterVersioning;
- (BOOL)supportsStreamManagement;
/// \cond internal
- (void)XMPP_startStream;
- (void)XMPP_handleStream: (OFXMLElement*)element;
- (void)XMPP_handleTLS: (OFXMLElement*)element;
- (void)XMPP_handleSASL: (OFXMLElement*)element;
- (void)XMPP_handleStanza: (OFXMLElement*)element;
- (void)XMPP_sendAuth: (OFString*)authName;
- (void)XMPP_sendResourceBind;
- (void)XMPP_sendStreamError: (OFString*)condition
text: (OFString*)text;
- (void)XMPP_handleIQ: (XMPPIQ*)iq;
- (void)XMPP_handleMessage: (XMPPMessage*)message;
- (void)XMPP_handlePresence: (XMPPPresence*)presence;
- (void)XMPP_handleFeatures: (OFXMLElement*)element;
- (void)XMPP_handleResourceBindForConnection: (XMPPConnection*)connection
IQ: (XMPPIQ*)iq;
- (void)XMPP_sendSession;
- (void)XMPP_handleSessionForConnection: (XMPPConnection*)connection
IQ: (XMPPIQ*)iq;
- (OFString*)XMPP_IDNAToASCII: (OFString*)domain;
- (XMPPMulticastDelegate*)XMPP_delegates;
/// \endcond
@end
@interface OFObject (XMPPConnectionDelegate) <XMPPConnectionDelegate>
@end
|