XMPPJabberRPCModule.h
1.24 KB
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
//
// XMPPJabberRPCModule.h
// XEP-0009
//
// Originally created by Eric Chamberlain on 5/16/10.
//
#import <Foundation/Foundation.h>
#import "XMPPModule.h"
#define _XMPP_JABBER_RPC_MODULE_H
extern NSString *const XMPPJabberRPCErrorDomain;
@class XMPPJID;
@class XMPPStream;
@class XMPPIQ;
@protocol XMPPJabberRPCModuleDelegate;
@interface XMPPJabberRPCModule : XMPPModule
{
NSMutableDictionary *rpcIDs;
NSTimeInterval defaultTimeout;
}
@property (nonatomic, assign) NSTimeInterval defaultTimeout;
- (NSString *)sendRpcIQ:(XMPPIQ *)iq;
- (NSString *)sendRpcIQ:(XMPPIQ *)iq withTimeout:(NSTimeInterval)timeout;
// caller knows best when a request has timed out
// it should remove the rpcID, on timeout.
- (void)timeoutRemoveRpcID:(NSString *)rpcID;
@end
@protocol XMPPJabberRPCModuleDelegate
@optional
// sent when transport error is received
-(void)jabberRPC:(XMPPJabberRPCModule *)sender elementID:(NSString *)elementID didReceiveError:(NSError *)error;
// sent when a methodResponse comes back
-(void)jabberRPC:(XMPPJabberRPCModule *)sender elementID:(NSString *)elementID didReceiveMethodResponse:(id)response;
// sent when a Jabber-RPC server request is received
-(void)jabberRPC:(XMPPJabberRPCModule *)sender didReceiveSetIQ:(XMPPIQ *)iq;
@end