X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=gui%2Fmainwin.h;h=df7154c0e89f0bc98e800b61322eb73cf3ca63be;hp=a6d1e1ec40e614347be1b2892716230822f3b008;hb=bb0bf17b61958e92529338596574f7a2a4f61d2a;hpb=117a8a4d7ced61a3e374f20c74bea1834386a1d7 diff --git a/gui/mainwin.h b/gui/mainwin.h index a6d1e1ec..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 * @@ -24,31 +24,110 @@ #include #include "gui/ui_mainwin.h" +#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; + 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