forked from tinycode/xmppframework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
XMPPClient.h
160 lines (106 loc) · 3.71 KB
/
XMPPClient.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#import <Foundation/Foundation.h>
#import "DDXML.h"
@class XMPPStream;
@class XMPPJID;
@class XMPPUser;
@class XMPPResource;
@class XMPPIQ;
@class XMPPMessage;
@class XMPPPresence;
@class MulticastDelegate;
@class SCNotificationManager;
@interface XMPPClient : NSObject
{
MulticastDelegate *multicastDelegate;
NSString *domain;
UInt16 port;
XMPPJID *myJID;
NSString *password;
int priority;
Byte flags;
XMPPStream *xmppStream;
NSError *streamError;
NSMutableDictionary *roster;
XMPPUser *myUser;
NSMutableArray *earlyPresenceElements;
SCNotificationManager *scNotificationManager;
}
- (id)init;
- (void)addDelegate:(id)delegate;
- (void)removeDelegate:(id)delegate;
- (NSString *)domain;
- (void)setDomain:(NSString *)domain;
- (UInt16)port;
- (void)setPort:(UInt16)port;
- (BOOL)usesOldStyleSSL;
- (void)setUsesOldStyleSSL:(BOOL)flag;
- (XMPPJID *)myJID;
- (void)setMyJID:(XMPPJID *)jid;
- (NSString *)password;
- (void)setPassword:(NSString *)password;
- (int)priority;
- (void)setPriority:(int)priority;
- (BOOL)allowsSelfSignedCertificates;
- (void)setAllowsSelfSignedCertificates:(BOOL)flag;
- (BOOL)isDisconnected;
- (BOOL)isConnected;
- (BOOL)isSecure;
- (NSError *)streamError;
- (BOOL)autoLogin;
- (void)setAutoLogin:(BOOL)flag;
- (BOOL)autoRoster;
- (void)setAutoRoster:(BOOL)flag;
- (BOOL)autoPresence;
- (void)setAutoPresence:(BOOL)flag;
- (BOOL)autoReconnect;
- (void)setAutoReconnect:(BOOL)flag;
- (void)connect;
- (void)disconnect;
- (BOOL)supportsInBandRegistration;
- (void)registerUser;
- (BOOL)supportsPlainAuthentication;
- (BOOL)supportsDigestMD5Authentication;
- (BOOL)allowsPlaintextAuth;
- (void)setAllowsPlaintextAuth:(BOOL)flag;
- (void)authenticateUser;
- (BOOL)isAuthenticated;
- (void)goOnline;
- (void)goOffline;
- (void)fetchRoster;
- (void)addBuddy:(XMPPJID *)jid withNickname:(NSString *)optionalName;
- (void)removeBuddy:(XMPPJID *)jid;
- (void)setNickname:(NSString *)nickname forBuddy:(XMPPJID *)jid;
- (void)acceptBuddyRequest:(XMPPJID *)jid;
- (void)rejectBuddyRequest:(XMPPJID *)jid;
- (NSArray *)sortedUsersByName;
- (NSArray *)sortedUsersByAvailabilityName;
- (NSArray *)sortedAvailableUsersByName;
- (NSArray *)sortedUnavailableUsersByName;
- (NSArray *)unsortedUsers;
- (NSArray *)unsortedAvailableUsers;
- (NSArray *)unsortedUnavailableUsers;
- (NSArray *)sortedResources:(BOOL)includeResourcesForMyUserExcludingMyself;
- (XMPPUser *)userForJID:(XMPPJID *)jid;
- (XMPPResource *)resourceForJID:(XMPPJID *)jid;
- (XMPPUser *)myUser;
- (void)sendElement:(NSXMLElement *)element;
- (void)sendElement:(NSXMLElement *)element andNotifyMe:(long)tag;
- (void)sendMessage:(NSString *)message toJID:(XMPPJID *)jid;
@end
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma mark -
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@interface NSObject (XMPPClientDelegate)
- (void)xmppClientConnecting:(XMPPClient *)sender;
- (void)xmppClientDidConnect:(XMPPClient *)sender;
- (void)xmppClientDidNotConnect:(XMPPClient *)sender;
- (void)xmppClientDidDisconnect:(XMPPClient *)sender;
- (void)xmppClientDidRegister:(XMPPClient *)sender;
- (void)xmppClient:(XMPPClient *)sender didNotRegister:(NSXMLElement *)error;
- (void)xmppClientDidAuthenticate:(XMPPClient *)sender;
- (void)xmppClient:(XMPPClient *)sender didNotAuthenticate:(NSXMLElement *)error;
- (void)xmppClientDidUpdateRoster:(XMPPClient *)sender;
- (void)xmppClient:(XMPPClient *)sender didReceiveBuddyRequest:(XMPPJID *)jid;
- (void)xmppClient:(XMPPClient *)sender didReceiveIQ:(XMPPIQ *)iq;
- (void)xmppClient:(XMPPClient *)sender didReceiveMessage:(XMPPMessage *)message;
@end