//$Id: irc.h,v 1.7 1997/11/30 02:14:25 parallax Exp $

// This file holds all the definitions for common stuff
//Aaron Granick

#ifndef _IRC_H_
#define _IRC_H_

#include <qstring.h>

#include "../config.h"
#include "defs.h"
#include <qcolor.h>
#include <qlistbox.h>
#include "theme.h"

class Settings {
public:
    // flags
    static bool debug; // show debugging info?
    static bool echo; // echo raw data to stdout?
    static bool connectAtStart; // should we connect right away?
    static bool reconnectOnDisconnect; // reconnect when we have been disconnected?
    static bool showOptions; // show options  on startup
    static bool logChannels;
    static bool logMessages;
    static bool logStatus;
    static bool createDetached; // do we create windows detached by default?
    static bool timestamp;
    
    static QString myNick;
    static QString primaryNick;
    static QString secondaryNick;
    static QString quitMessage;
    static QString serverName;
    static QString serverPort;
    static QString serverPassword;
    static QString userName;
    static QString realName;
    static QString popupsFile;
    static QString aliasesFile;
    static QString startupFile;
    static QString serverListFile;
    static QString fileDir; // the location of the users config files, etc.
    static QString sysFileDir; // the location of system wide files
    static QString nickCompletionExtra; // extra characters added before and after nick completion to make it cool
    static QString defaultKickReason;
    static QString versionReply;
    static QString notifyList; // a comma separated list of nicks
    // DCC settings
    static bool dccAutoGet;
    static QString dccDirectory;
    // graphical stuff
    static QString themeFile;
    static Theme theme;
};

// list of events we know how to handle

class Event {
public:
    enum { NEW_MESSAGE, NICK_CHANGE, SOCKET_WRITE, \
           JOIN_CHANNEL,  ADD_NICK, REMOVE_NICK, CHANGE_NICK, \
           CHANGE_MY_NICK, CHANGE_SERVER,  \
           CLOSE_ALL_WINDOWS,  CLOSE_WINDOW, CONNECT, DISCONNECT, \
           CONNECTED, REGISTERED,  DISCONNECTED, QUIT,  TOPIC, OUTPUT, \
           NICK_IN_USE, QUERY,  SIGNOFF, NICK_MODE, WRITE_CONFIG, \
           UPDATE_WINDOW_NAME, PARSE_INPUT, ISON, ADD_NOTIFY, \
           REMOVE_NOTIFY, CREATE_DCC_WINDOW, CLOSE_DCC_CHAT, OUTPUT_DCC_CHAT };
};

// list of ouptput types
class Output {
public:
    enum { INTERNAL_MESSAGE, NOTICE, INFO, ACTION, OWN, PRIVMESSAGE, \
           EXCLAMATION, ERROR, SERVER_MESSAGE, NORMAL };
};

//helper class
class Util
{
public:
    static int FindListBoxItem(QListBox *, const char *);
    static void RemoveListBoxItem(QListBox *, const char *);
};

class IrcApp;
extern IrcApp *app;
#endif
