X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fnicklistwidget.h;h=15b5a58594a06c8db57175930ea37d84fb0920e4;hp=3db7e08360375210db01a8946f94901dea3a8c5a;hb=f04db2cb802b1296ca739c823495930c71d3b4ab;hpb=89c07686d193fe31e1b3ea45735b3f5a0d1e6cfb diff --git a/src/qtui/nicklistwidget.h b/src/qtui/nicklistwidget.h index 3db7e083..15b5a585 100644 --- a/src/qtui/nicklistwidget.h +++ b/src/qtui/nicklistwidget.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-08 by the Quassel Project * + * Copyright (C) 2005-2013 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -15,63 +15,72 @@ * 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 -#include - -#include "buffermodel.h" +#include class Buffer; class NickView; +class QDockWidget; -class NickListWidget : public QWidget { - Q_OBJECT +class NickListWidget : public AbstractItemView +{ + Q_OBJECT public: - NickListWidget(QWidget *parent = 0); - - inline BufferModel *model() { return _bufferModel; } - void setModel(BufferModel *bufferModel); - - inline QItemSelectionModel *selectionModel() const { return _selectionModel; } - void setSelectionModel(QItemSelectionModel *selectionModel); + NickListWidget(QWidget *parent = 0); public slots: - void reset(); + void showWidget(bool visible); + +signals: + void nickSelectionChanged(const QModelIndexList &); protected: - virtual QSize sizeHint() const; + virtual QSize sizeHint() const; + virtual void hideEvent(QHideEvent *); + virtual void showEvent(QShowEvent *); protected slots: -// virtual void closeEditor(QWidget *editor, QAbstractItemDelegate::EndEditHint hint); -// virtual void commitData(QWidget *editor); - virtual void currentChanged(const QModelIndex ¤t, const QModelIndex &previous); -// virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight); -// virtual void editorDestroyed(QObject *editor); - virtual void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end); -// virtual void rowsInserted(const QModelIndex &parent, int start, int end); -// virtual void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected); + 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 setCurrentBuffer(BufferId bufferId); - + void removeBuffer(BufferId bufferId); + void nickSelectionChanged(); + private: - Ui::NickListWidget ui; - QHash nickViews; + Ui::NickListWidget ui; + QHash nickViews; + + QDockWidget *dock() const; +}; + - QPointer _bufferModel; - QPointer _selectionModel; +// ============================== +// NickList Dock +// ============================== +class NickListDock : public QDockWidget +{ + Q_OBJECT + +public: + NickListDock(const QString &title, QWidget *parent = 0); + // ~NickListDock(); + + // virtual bool event(QEvent *event); }; + #endif