Source: Partyline.h


Annotated List
Files
Globals
Hierarchy
Index
/***************************************************************************
 *
 * File:    Partyline.h
 * Created: Tue Dec 14 1999
 * (C) 1999 by David M. <captjay@superlink.net>
 *
 ***************************************************************************/
/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef PARTYLINE_H
#define PARTYLINE_H

#include <qobject.h>
#include <qlist.h>
#include "DCCUser.h"

class Channel;

/**
* @author David M.
 *@short Handle the bot's internal partyline.
 *
 * Keeps track of DCC connections and handles notifying its users.
 */

typedef QListIterator<DCCUser> UserIterator;

class Partyline : public QObject  {
Q_OBJECT
public:
	~Partyline();
	static Partyline* instance();
	void notifyAll(QString message,int mask = DCCUser::All);
	void displayCommand(QString user,QString cmd,unsigned int level,QString params,
	                    QString chan = "*",bool chanOnly = false, bool log=true);
	int createConnection(QString nuh,QString host, unsigned int port);
	UserIterator* createUserIterator();
  static const int NoError = 0;
  static const int ConnectionRefused = 1;
  static const int NoAccess = 2;
public slots:
  /*DCC User related events */
  void onUserAuth(DCCUser* user,QString username);
  void onConnectionClose(DCCUser* user, QString username);

  /* IRC related events */
  void onConnect(QString serverName,QString nickname);
  void onJoin(QString nick, const Channel* chan);
  void onPart(QString nick, const Channel* chan,QString comment);
  void onChannelCTCP(QString nick,const Channel* chan, QString ctcpType, QString ctcpText);
  void onChannelText(QString nick,const Channel* chan,QString text);
  void onChannelNotice(QString nick,const Channel* chan,QString text);
  void onNickChange(QString nick,QString newNick);
  void onError(QString errorMessage);
  void onRawChannelMode(QString from, const Channel* channel, QString mode);
  void onServerNotice(QString serverName, QString text);
  void onKick(QString kicker,const Channel* chan,QString kicked,QString comment);
  void onPrivateText(QString nuh,QString text);
  void onPrivateNotice(QString nuh,QString text);
  void onPrivateCTCP(QString nuh, QString ctcpType, QString ctcpText);
  void onQuit(QString nuh, QString comment);

private:
	Partyline();
  QList<DCCUser> _userList;
  static Partyline* _instance;
};


#endif

Generated by: nightsky@centauri on Sat Jan 15 23:06:10 2000, using kdoc 2.0a30.