@@ -27,12 +27,18 @@ @class OFTCPSocket; @class IRCConnection; @class IRCUser; @class IRCChannel; +#ifndef IRC_CONNECTION_M +@protocol IRCConnectionDelegate +#else @protocol IRCConnectionDelegate +#endif +#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; @@ -78,19 +84,34 @@ OFTCPSocket *sock; OFString *server; uint16_t port; OFString *nickname, *username, *realname; OFMutableDictionary *channels; - id delegate; + id delegate; } +#ifdef OF_HAVE_PROPERTIES @property (copy) OFString *server; @property (assign) uint16_t port; @property (copy) OFString *nickname, *username, *realname; -@property (assign) id delegate; -@property (retain, getter=socket) OFTCPSocket *sock; +@property (assign) id delegate; +@property (readonly, retain, getter=socket) OFTCPSocket *sock; +#endif +- (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 )delegate; +- (id )delegate; +- (OFTCPSocket*)socket; - (void)sendLine: (OFString*)line; - (void)sendLineWithFormat: (OFConstantString*)line, ...; - (void)connect; - (void)disconnect; - (void)disconnectWithReason: (OFString*)reason; @@ -111,5 +132,8 @@ withReason: (OFString*)reason; - (void)changeNicknameTo: (OFString*)nickname; - (void)processLine: (OFString*)line; - (void)handleConnection; @end + +@interface OFObject (IRCConnectionDelegate) +@end