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 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 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 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153
|
/*
* Copyright (C) 2009 Nathan Ollerenshaw chrome@stupendous.net
*
* This library is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*/
/**
* @file IRCClientChannel.h
* @author Nathan Ollerenshaw
* @version 1.0
* @date 01.2009
* @brief Represents a connected IRC Channel.
*/
#import <Cocoa/Cocoa.h>
#import <IRCClient/IRCClientChannelDelegate.h>
/** \class IRCClientChannel
* @brief Represents a connected IRC Channel.
*
* IRCClientChannel objects are created by the IRCClientSession object
* for a given session when the client joins an IRC channel. At that time
* you are expected to register event handlers for each of the delegate
* methods described in the IRCClientChannelDelegate interface.
*/
@class IRCClientSession;
@interface IRCClientChannel : NSObject {
id delegate;
NSString *name;
NSStringEncoding encoding;
IRCClientSession *session;
NSString *topic;
NSString *modes;
NSMutableArray *names;
}
/** Delegate to send events to */
@property (assign) id delegate;
/** Name of the channel */
@property (copy) NSString *name;
/** Encoding used by this channel */
@property (assign) NSStringEncoding encoding;
/** Associated IRCClientSession object */
@property (assign) IRCClientSession *session;
/** Topic of the channel */
@property (copy) NSString *topic;
/** Mode of the channel */
@property (copy) NSString *modes;
/** An array of nicknames stored as NSStrings that list the connected users
for the channel */
@property (assign, readonly) NSMutableArray *names;
/** initWithName:
*
* Returns an initialised IRCClientChannel with a given channel name. You
* are not expected to initialise your own IRCClientChannel objects; if you
* wish to join a channel you should send a [IRCClientSession join:key:] message
* to your IRCClientSession object.
*
* @param aName Name of the channel.
*/
- (id)initWithName:(NSString *)aName;
/** Parts the channel.
*/
- (int)part;
/** Invites another IRC client to the channel.
*
* @param nick the nickname of the client to invite.
*/
- (int)invite:(NSString *)nick;
/** Sets the topic of the channel.
*
* Note that not all users on a channel have permission to change the topic; if you fail
* to set the topic, then you will not see an onTopic event on the IRCClientChannelDelegate.
*
* @param aTopic the topic the client wishes to set for the channel.
*/
- (void)setTopic:(NSString *)aTopic;
/** Sets the mode of the channel.
*
* Note that not all users on a channel have permission to change the mode; if you fail
* to set the mode, then you will not see an onMode event on the IRCClientChannelDelegate.
*
* @param mode the mode to set the channel to
* @param params paramaters for the mode, if it requires parameters.
*/
- (int)setMode:(NSString *)mode params:(NSString *)params;
/** Sends a public PRIVMSG to the channel. If you try to send more than can fit on an IRC
* buffer, it will be truncated.
*
* @param message the message to send to the channel.
*/
- (int)message:(NSString *)message;
/** Sends a public CTCP ACTION to the channel.
*
* @param action action to send to the channel.
*/
- (int)action:(NSString *)action;
/** Sends a public NOTICE to the channel.
*
* @param notice message to send to the channel.
*/
- (int)notice:(NSString *)notice;
/** Kicks someone from a channel.
*
* @param nick the IRC client to kick from the channel.
* @param reason the message to give to the channel and the IRC client for the kick.
*/
- (int)kick:(NSString *)nick reason:(NSString *)reason;
/** Sends a CTCP request to the channel.
*
* It is perfectly legal to send a CTCP request to an IRC channel, however many clients
* decline to respond to them, and often they are percieved as annoying.
*
* @param request the string of the request, in CTCP format.
*/
- (int)ctcpRequest:(NSString *)request;
@end
|