3
//=============================================================================
6
// Creation date : Thu Oct 7 2001 13:27:55 CEST by Szymon Stefanek
8
// This file is part of the KVIrc irc client distribution
9
// Copyright (C) 2001-2010 Szymon Stefanek (pragma at kvirc dot net)
11
// This program is FREE software. You can redistribute it and/or
12
// modify it under the lists of the GNU General Public License
13
// as published by the Free Software Foundation; either version 2
14
// of the License, or (at your opinion) any later version.
16
// This program is distributed in the HOPE that it will be USEFUL,
17
// but WITHOUT ANY WARRANTY; without even the implied warranty of
18
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
19
// See the GNU General Public License for more details.
21
// You should have received a copy of the GNU General Public License
22
// along with this program. If not, write to the Free Software Foundation,
23
// Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25
//=============================================================================
27
#include "KviWindow.h"
28
#include "KviCString.h"
29
#include "KviIrcSocket.h"
30
#include "KviPointerList.h"
31
#include "KviIrcServerParser.h"
32
#include "KviConsoleWindow.h"
33
#include "KviIrcContext.h"
34
#include "KviTalPopupMenu.h"
35
#include "KviThemedTreeWidget.h"
37
#include <QToolButton>
39
#include <QItemDelegate>
42
class KviThemedLineEdit;
44
class ChannelTreeWidgetItemDelegate : public QItemDelegate
47
ChannelTreeWidgetItemDelegate(QTreeWidget * pWidget = 0);
48
~ChannelTreeWidgetItemDelegate();
49
void paint(QPainter * pPainter, const QStyleOptionViewItem & option, const QModelIndex & index ) const;
50
QSize sizeHint(const QStyleOptionViewItem &option,const QModelIndex &index) const;
53
class ChannelTreeWidgetItemData
55
friend class ChannelTreeWidgetItem;
56
friend class ListWindow;
57
friend class ChannelTreeWidgetItemDelegate;
59
ChannelTreeWidgetItemData(const QString & szChan, const QString & szUsers, const QString & szTopic);
60
~ChannelTreeWidgetItemData();
65
QString m_szStrippedTopic;
68
class ChannelTreeWidgetItem : public QTreeWidgetItem
70
friend class ListWindow;
72
ChannelTreeWidgetItem(ChannelTreeWidgetItemData * pData);
73
~ChannelTreeWidgetItem();
75
ChannelTreeWidgetItemData * m_pData;
77
bool operator<(const QTreeWidgetItem & other) const;
78
inline ChannelTreeWidgetItemData * itemData() { return m_pData; };
81
class ChannelTreeWidget: public KviThemedTreeWidget
83
friend class ChannelTreeWidgetItem;
84
friend class ChannelTreeWidgetItemData;
87
ChannelTreeWidget(QWidget * par, KviWindow * pWindow, const char * name) : KviThemedTreeWidget(par, pWindow, name) {};
88
~ChannelTreeWidget() {};
89
ChannelTreeWidgetItem* itemFromIndex(const QModelIndex & index) const { return (ChannelTreeWidgetItem*) KviThemedTreeWidget::itemFromIndex(index); };
92
class ListWindow : public KviWindow, public KviExternalServerDataParser
96
ListWindow(KviMainWindow * lpFrm, KviConsoleWindow * lpConsole);
99
QSplitter * m_pVertSplitter;
100
QSplitter * m_pTopSplitter;
101
ChannelTreeWidget * m_pTreeWidget;
102
KviThemedLineEdit * m_pParamsEdit;
103
QToolButton * m_pRequestButton;
104
QToolButton * m_pStopListDownloadButton;
105
QToolButton * m_pOpenButton;
106
QToolButton * m_pSaveButton;
107
KviThemedLabel * m_pInfoLabel;
108
QTimer * m_pFlushTimer;
109
KviPointerList<ChannelTreeWidgetItemData> * m_pItemList;
111
virtual void control(int iMsg);
112
virtual void processData(KviIrcMessage * pMsg);
114
virtual QSize sizeHint() const;
116
virtual QPixmap * myIconPtr();
117
virtual void fillCaptionBuffers();
118
virtual void applyOptions();
119
virtual void resizeEvent(QResizeEvent * e);
120
virtual void getBaseLogFileName(QString & szBuffer);
123
void itemDoubleClicked(QTreeWidgetItem * it, int);
125
void stoplistdownload();
126
void connectionStateChange();
129
void liveSearch(const QString & szText);
136
#endif //_KVI_LISTWINDOW_H_