X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=gui%2Fmainwin.h;h=df7154c0e89f0bc98e800b61322eb73cf3ca63be;hp=faaae576e7450793d8b1ae6b9bbd17bb785626d4;hb=bb0bf17b61958e92529338596574f7a2a4f61d2a;hpb=04e21ce26ebabdde9586ca9d2a3168431e448df5 diff --git a/gui/mainwin.h b/gui/mainwin.h index faaae576..df7154c0 100644 --- a/gui/mainwin.h +++ b/gui/mainwin.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005 by The Quassel Team * + * Copyright (C) 2005-07 by The Quassel Team * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -21,38 +21,113 @@ #ifndef _MAINWIN_H_ #define _MAINWIN_H_ -#include +#include +#include "gui/ui_mainwin.h" -class QMenu; -class QWorkspace; +#include "global.h" +#include "message.h" +#include "chatwidget.h" class ServerListDlg; class CoreConnectDlg; +class BufferView; +class Buffer; +class BufferWidget; +class SettingsDlg; +extern LayoutThread *layoutThread; + +//!\brief The main window and central object of Quassel GUI. +/** In addition to displaying the main window including standard stuff like a menubar, + * dockwidgets and of course the chat window, this class also stores all data it + * receives from the core, and it maintains a list of all known nicks. + */ class MainWin : public QMainWindow { Q_OBJECT public: MainWin(); + ~MainWin(); + + void init(); + void registerBufferView(BufferView *); protected: + void closeEvent(QCloseEvent *event); + + signals: + void sendInput(BufferId, QString message); + void bufferSelected(Buffer *); + void bufferUpdated(Buffer *); + void bufferActivity(uint, Buffer *); + void bufferDestroyed(Buffer *); + void backlogReceived(Buffer *, QList); + void requestBacklog(BufferId, QVariant, QVariant); + + void importOldBacklog(); private slots: + void userInput(BufferId, QString); + void networkConnected(QString); + void networkDisconnected(QString); + void recvNetworkState(QString, QVariant); + void recvMessage(Message message); + void recvStatusMsg(QString network, QString message); + void setTopic(QString net, QString buf, QString); + void addNick(QString net, QString nick, VarMap props); + void removeNick(QString net, QString nick); + void renameNick(QString net, QString oldnick, QString newnick); + void updateNick(QString net, QString nick, VarMap props); + void setOwnNick(QString net, QString nick); + void recvBacklogData(BufferId, QList, bool); + void updateBufferId(BufferId); + void showServerList(); + void showSettingsDlg(); + + void showBuffer(BufferId); + void showBuffer(Buffer *); + + void importBacklog(); + void layoutMsg(); private: + Ui::MainWin ui; + void setupMenus(); - void syncToCore(); + void setupViews(); + void setupSettingsDlg(); + void syncToCore(); // implemented in main_mono.cpp or main_gui.cpp + //Buffer * getBuffer(QString net, QString buf); + Buffer *getBuffer(BufferId); + BufferId getStatusBufferId(QString net); + BufferId getBufferId(QString net, QString buf); + //void buffersUpdated(); - QWorkspace *workspace; - QToolBar *toolBar; - QMenu *fileMenu, *editMenu, *ircMenu, *serverMenu, *windowMenu, *helpMenu, *settingsMenu; - QAction *quitAct, *serverListAct; - QAction *aboutAct, *aboutQtAct; - QAction *identitiesAct, *configAct; + QSystemTrayIcon *systray; + //QWorkspace *workspace; + //QWidget *widget; + //BufferWidget *bufferWidget; ServerListDlg *serverListDlg; CoreConnectDlg *coreConnectDlg; + SettingsDlg *settingsDlg; + + //QString currentNetwork, currentBuffer; + //QHash > buffers; + uint currentBuffer; + QHash buffers; + QHash bufferIds; + QHash > nicks; + QHash connected; + QHash ownNick; + //QHash > coreBackLog; + QList coreBuffers; + + QList netViews; + + QTimer *layoutTimer; + QList layoutQueue; }; #endif