1
2
3
4
5
6
7
8
9
|
1
2
3
4
5
6
7
8
9
10
|
+
|
/*
* Copyright (c) 2011, Florian Zeitz <florob@babelmonkeys.de>
* Copyright (c) 2021, Jonathan Schleifer <js@nil.im>
*
* https://heap.zone/objxmpp/
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice is present in all copies.
*
|
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
|
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
|
-
+
-
-
+
-
-
+
+
-
+
-
-
+
-
-
+
-
|
OF_ASSUME_NONNULL_BEGIN
@class XMPPConnection;
@class XMPPIQ;
#ifdef OF_HAVE_BLOCKS
typedef void (^xmpp_callback_block_t)(XMPPConnection *_Nonnull,
typedef void (^XMPPCallbackBlock)(XMPPConnection *_Nonnull, XMPPIQ *_Nonnull);
XMPPIQ *_Nonnull);
#endif
@interface XMPPCallback: OFObject
{
id _target;
SEL _selector;
#ifdef OF_HAVE_BLOCKS
xmpp_callback_block_t _block;
XMPPCallbackBlock _block;
#endif
}
#ifdef OF_HAVE_BLOCKS
+ (instancetype)callbackWithBlock: (xmpp_callback_block_t)callback;
- (instancetype)initWithBlock: (xmpp_callback_block_t)callback;
+ (instancetype)callbackWithBlock: (XMPPCallbackBlock)callback;
- (instancetype)initWithBlock: (XMPPCallbackBlock)callback;
#endif
+ (instancetype)callbackWithTarget: (id)target
+ (instancetype)callbackWithTarget: (id)target selector: (SEL)selector;
selector: (SEL)selector;
- (instancetype)initWithTarget: (id)target
- (instancetype)initWithTarget: (id)target selector: (SEL)selector;
selector: (SEL)selector;
- (void)runWithIQ: (XMPPIQ *)iq
- (void)runWithIQ: (XMPPIQ *)iq connection: (XMPPConnection *)connection;
connection: (XMPPConnection *)connection;
@end
OF_ASSUME_NONNULL_END
|