X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fnicklistwidget.h;h=18f966aa5b3c3071fc27701964bb2fd789d51b76;hp=6c95f9b46d995cb24048da634a76b9834a0bcd07;hb=5d9af8ed007d38faf3995ea18174249121f246fe;hpb=ec17201104f75eafaddccc174de8709b42b15ccb diff --git a/src/qtui/nicklistwidget.h b/src/qtui/nicklistwidget.h index 6c95f9b4..18f966aa 100644 --- a/src/qtui/nicklistwidget.h +++ b/src/qtui/nicklistwidget.h @@ -1,11 +1,11 @@ /*************************************************************************** - * Copyright (C) 2005-07 by the Quassel IRC Team * + * Copyright (C) 2005-09 by the Quassel Project * * devel@quassel-irc.org * * * * 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. * + * (at your option) version 3. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * @@ -18,30 +18,66 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#ifndef _NICKLISTWIDGET_H_ -#define _NICKLISTWIDGET_H_ +#ifndef NICKLISTWIDGET_H_ +#define NICKLISTWIDGET_H_ #include "ui_nicklistwidget.h" +#include "abstractitemview.h" +#include "buffermodel.h" + +#include "types.h" #include +#include class Buffer; class NickView; +class QDockWidget; -class NickListWidget : public QWidget { +class NickListWidget : public AbstractItemView { Q_OBJECT - public: - NickListWidget(QWidget *parent = 0); +public: + NickListWidget(QWidget *parent = 0); + +public slots: + void showWidget(bool visible); + +signals: + void nickSelectionChanged(const QModelIndexList &); + +protected: + virtual QSize sizeHint() const; + virtual void hideEvent(QHideEvent *); + virtual void showEvent(QShowEvent *); + +protected slots: + virtual void currentChanged(const QModelIndex ¤t, const QModelIndex &previous); + virtual void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end); + +private slots: + void removeBuffer(BufferId bufferId); + void nickSelectionChanged(); - public slots: - void setBuffer(Buffer *); - void reset(); +private: + Ui::NickListWidget ui; + QHash nickViews; + + QDockWidget *dock() const; +}; + + +// ============================== +// NickList Dock +// ============================== +class NickListDock : public QDockWidget { + Q_OBJECT - private: - Ui::NickListWidget ui; - QHash nickViews; +public: + NickListDock(const QString &title, QWidget *parent = 0); + // ~NickListDock(); + // virtual bool event(QEvent *event); }; #endif