22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
-
-
|
#import <ObjFW/ObjFW.h>
@class IRCConnection;
@class IRCUser;
@protocol IRCConnectionDelegate <OFObject>
#ifdef OF_HAVE_OPTIONAL_PROTOCOLS
@optional
#endif
- (void)connection: (IRCConnection*)connection
didReceiveLine: (OFString*)line;
- (void)connection: (IRCConnection*)connection
didSendLine: (OFString*)line;
- (void)connectionWasEstablished: (IRCConnection*)connection;
- (void)connection: (IRCConnection*)connection
didSeeUser: (IRCUser*)user
|
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
|
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
|
OFString *_server;
uint16_t _port;
OFString *_nickname, *_username, *_realname;
OFMutableDictionary *_channels;
id <IRCConnectionDelegate> _delegate;
}
#ifdef OF_HAVE_PROPERTIES
@property (copy) OFString *server;
@property (assign) uint16_t port;
@property (copy) OFString *nickname, *username, *realname;
@property (assign) id <IRCConnectionDelegate> delegate;
@property (readonly, retain) OFTCPSocket *socket;
#endif
+ (instancetype)connection;
- (void)setServer: (OFString*)server;
- (OFString*)server;
- (void)setPort: (uint16_t)port;
- (uint16_t)port;
- (void)setNickname: (OFString*)nickname;
- (OFString*)nickname;
- (void)setUsername: (OFString*)username;
- (OFString*)username;
- (void)setRealname: (OFString*)realname;
- (OFString*)realname;
- (void)setDelegate: (id <IRCConnectionDelegate>)delegate;
- (id <IRCConnectionDelegate>)delegate;
- (OFTCPSocket*)socket;
- (void)sendLine: (OFString*)line;
- (void)sendLineWithFormat: (OFConstantString*)line, ...;
- (void)connect;
- (void)disconnect;
- (void)disconnectWithReason: (OFString*)reason;
- (void)joinChannel: (OFString*)channelName;
- (void)leaveChannel: (OFString*)channel;
|
120
121
122
123
124
125
126
127
128
129
|
103
104
105
106
107
108
109
|
-
-
-
|
channel: (OFString*)channel
reason: (OFString*)reason;
- (void)changeNicknameTo: (OFString*)nickname;
- (void)processLine: (OFString*)line;
- (void)handleConnection;
- (OFSet*)usersInChannel: (OFString*)channel;
@end
@interface OFObject (IRCConnectionDelegate) <IRCConnectionDelegate>
@end
|