//$Id: windowview.h,v 1.3 1997/11/30 02:14:26 parallax Exp $

#ifndef WINDOWVIEW_H
#define WINDOWVIEW_H

#include "ircwindow.h"
#include "message.h"
#include "channel.h"
#include "console.h"
#include "dccwindow.h"
#include "irc.h"
#include "mdi.h"
#include "taskbar.h"
#include "GeneralOptions.h"
#include "EditFile.h"
#include "VisualOptions.h"
#include "DCCOptions.h"
#include "ThemeDlg.h"
#include <qlabel.h>
#include <qdialog.h>
#include <qmenubar.h>
#include <qaccel.h>

class WindowView : public QWidget
{
    Q_OBJECT;
public:
    WindowView ( QWidget *parent=0, const char *name=0 );
    ~WindowView ();
    enum WindowType { CONSOLE, CHANNEL, MESSAGE, DCC };
public slots:
    void OutputToWindow( int type, const char *name, const char *buff);
    void OutputToAll(int type, const char *buff);
    void AddWindow ( const char *name, WindowType type, bool isMinimized=FALSE );
    void CloseWindow (const char *name);
    void JoinChannel ( );
    void HandleEvent ( int, const char *data1, const char *data2=0);
    void Connect();
    void Disconnect();
    IrcWindow *GetWindowByName ( const char *name );
    void Close();
    void Options();
    void UpdateCaption (const char *, const char *);
    void ChangeServer ( const char *);
    void ChangeMyNick ( const char *);
    void HelpAbout ();
    void slotApplyChanges();
    void SlotApplyTheme();
    void SelectWindow(const char *);
signals:
    void ChangeNick ( const char *, const char *);
    void RemoveNick ( const char *);
    void Signoff ( const char *, const char *);
    void NewMessage(int type, const char *sender, const char *msg);
    void Rejoin(); // emitted after we have been disconnected, and then reconnected
    void CloseAll(); // emitted to all windows when we wish all windows closed
    void OutputToAllWindows(const char *, int); // sends the message to all windows
    void ApplyTheme();
protected:
    void closeEvent ( QCloseEvent * );
    void resizeEvent ( QResizeEvent *);  
    QMenuBar *menu; // the main menu
    // KToolBar *tool;
    // KStatusBar *status;
    QPopupMenu *file;
    QPopupMenu *help;
    QPopupMenu *window;
    QPopupMenu *commands;
    QAccel *accel;
    TaskBar *taskBar;
    // dialogs
    GeneralOptions *general;
    VisualOptions *appearance;
    EditFile *aliases, *startup, *popups;
    ThemeDlg *themeDlg;
    DCCOptions *dccOptions;
    QFrame *status;
    QMenuBar *tool;
    QFrame *taskbarFrame;
    MDIManager *mdi;
 private slots:
    void RemoveWindow(MDIWindow *);
    void RemoveWindow ( const char * );
    void SetNick();
    void SetServer();
    void ShowConsole();
};

#endif
