ObjXMPP  Diff

Differences From Artifact [35f3f776c8]:

To Artifact [f5ae1a7771]:


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

#import <ObjFW/OFObject.h>

OF_ASSUME_NONNULL_BEGIN

@class OFMutableData;

/**
 * \brief A class to provide multiple delegates in a single class
 */
@interface XMPPMulticastDelegate: OFObject
{
	OFMutableData *_delegates;
}

/**
 * \brief Adds a delegate which should receive the broadcasts.
 *
 * \param delegate The delegate to add
 */
- (void)addDelegate: (id)delegate;

/**
 * \brief Removes a delegate so it does not receive the broadcasts anymore.
 *
 * \param delegate The delegate to remove
 */
- (void)removeDelegate: (id)delegate;

/**
 * \brief Broadcasts a selector with an object to all registered delegates.
 *
 * \param selector The selector to broadcast
 * \param object The object to broadcast
 */
- (bool)broadcastSelector: (SEL)selector
	       withObject: (nullable id)object;

/**
 * \brief Broadcasts a selector with two objects to all registered 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: (nullable id)object1
	       withObject: (nullable id)object2;
@end

OF_ASSUME_NONNULL_END







|
|






|
|

|



|
|

|



|
|

|
|




|
|

|
|
|







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

#import <ObjFW/OFObject.h>

OF_ASSUME_NONNULL_BEGIN

@class OFMutableData;

/*!
 * @brief A class to provide multiple delegates in a single class
 */
@interface XMPPMulticastDelegate: OFObject
{
	OFMutableData *_delegates;
}

/*!
 * @brief Adds a delegate which should receive the broadcasts.
 *
 * @param delegate The delegate to add
 */
- (void)addDelegate: (id)delegate;

/*!
 * @brief Removes a delegate so it does not receive the broadcasts anymore.
 *
 * @param delegate The delegate to remove
 */
- (void)removeDelegate: (id)delegate;

/*!
 * @brief Broadcasts a selector with an object to all registered delegates.
 *
 * @param selector The selector to broadcast
 * @param object The object to broadcast
 */
- (bool)broadcastSelector: (SEL)selector
	       withObject: (nullable id)object;

/*!
 * @brief Broadcasts a selector with two objects to all registered 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: (nullable id)object1
	       withObject: (nullable id)object2;
@end

OF_ASSUME_NONNULL_END