X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fnicklistwidget.h;h=c2a626e8d499ef710f7f3fadc9627fd2d895753a;hp=05f3235bdf40d0adc5c824b2156910c88da1c702;hb=7ad7c792cae055a6549916ad190d6c8479bf674e;hpb=d6b056e936ec441258d291b7a8af7b83f9f53016 diff --git a/src/qtui/nicklistwidget.h b/src/qtui/nicklistwidget.h index 05f3235b..c2a626e8 100644 --- a/src/qtui/nicklistwidget.h +++ b/src/qtui/nicklistwidget.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-07 by the Quassel IRC Team * + * Copyright (C) 2005-2015 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -15,33 +15,73 @@ * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 { - Q_OBJECT +class NickListWidget : public AbstractItemView +{ + Q_OBJECT - public: +public: NickListWidget(QWidget *parent = 0); - public slots: - void setBuffer(Buffer *); - void reset(); +public slots: + void showWidget(bool visible); + void setVisible(bool visible) override; + +signals: + void nickSelectionChanged(const QModelIndexList &); + +protected: + QSize sizeHint() const override; + void hideEvent(QHideEvent *) override; + void showEvent(QShowEvent *) override; - private: +protected slots: + void currentChanged(const QModelIndex ¤t, const QModelIndex &previous) override; + void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end) override; + +private slots: + void removeBuffer(BufferId bufferId); + void nickSelectionChanged(); + +private: Ui::NickListWidget ui; - QHash nickViews; + QHash nickViews; + QDockWidget *dock() const; }; + +// ============================== +// NickList Dock +// ============================== +class NickListDock : public QDockWidget +{ + Q_OBJECT + +public: + NickListDock(const QString &title, QWidget *parent = 0); + // ~NickListDock(); + + // virtual bool event(QEvent *event); +}; + + #endif