~ubuntu-branches/ubuntu/trusty/kvirc/trusty

« back to all changes in this revision

Viewing changes to src/modules/list/ListWindow.h

  • Committer: Bazaar Package Importer
  • Author(s): Kai Wasserbäch, Kai Wasserbäch, Raúl Sánchez Siles
  • Date: 2011-02-12 10:40:21 UTC
  • mfrom: (14.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110212104021-5mh4f75jlku20mnt
The combined "Twisted Experiment" and "Nocturnal Raid" release.

[ Kai Wasserbäch ]
* Synced to upstream's SVN revision 5467.
* debian/rules:
  - Added .PHONY line.
  - Resurrect -DMANUAL_REVISION, got lost somewhere and we build SVN
    revisions again.
  - Replace "-DWITH_NO_EMBEDDED_CODE=YES" with "-DWANT_CRYPTOPP=YES".
  - Change the remaining -DWITH/-DWITHOUT to the new -DWANT syntax.
* debian/control:
  - Removed DMUA, I'm a DD now.
  - Changed my e-mail address.
  - Removed unneeded relationships (no upgrades over two releases are
    supported).
  - Fix Suggests for kvirc-dbg.
  - kvirc-data: Make the "Suggests: kvirc" a Recommends, doesn't make much
    sense to install the -data package without the program.
* debian/source/local-options: Added with "unapply-patches".
* debian/kvirc.lintian-overrides: Updated to work for 4.1.1.
* debian/patches/21_make_shared-mime-info_B-D_superfluous.patch: Updated.
* debian/kvirc-data.install: Added .notifyrc.

[ Raúl Sánchez Siles ]
* Stating the right version where kvirc-data break and replace should happen.
* Fixing link to license file.
* Added French and Portuguese man pages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _LISTWINDOW_H_
 
2
#define _LISTWINDOW_H_
 
3
//=============================================================================
 
4
//
 
5
//   File : ListWindow.h
 
6
//   Creation date : Thu Oct 7 2001 13:27:55 CEST by Szymon Stefanek
 
7
//
 
8
//   This file is part of the KVIrc irc client distribution
 
9
//   Copyright (C) 2001-2010 Szymon Stefanek (pragma at kvirc dot net)
 
10
//
 
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.
 
15
//
 
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.
 
20
//
 
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.
 
24
//
 
25
//=============================================================================
 
26
 
 
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"
 
36
 
 
37
#include <QToolButton>
 
38
#include <QLineEdit>
 
39
#include <QItemDelegate>
 
40
 
 
41
class KviThemedLabel;
 
42
class KviThemedLineEdit;
 
43
 
 
44
class ChannelTreeWidgetItemDelegate : public QItemDelegate
 
45
{
 
46
public:
 
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;
 
51
};
 
52
 
 
53
class ChannelTreeWidgetItemData
 
54
{
 
55
        friend class ChannelTreeWidgetItem;
 
56
        friend class ListWindow;
 
57
        friend class ChannelTreeWidgetItemDelegate;
 
58
public:
 
59
        ChannelTreeWidgetItemData(const QString & szChan, const QString & szUsers, const QString & szTopic);
 
60
        ~ChannelTreeWidgetItemData();
 
61
protected:
 
62
        QString m_szChan;
 
63
        QString m_szUsers;
 
64
        QString m_szTopic;
 
65
        QString m_szStrippedTopic;
 
66
};
 
67
 
 
68
class ChannelTreeWidgetItem : public QTreeWidgetItem
 
69
{
 
70
        friend class ListWindow;
 
71
public:
 
72
        ChannelTreeWidgetItem(ChannelTreeWidgetItemData * pData);
 
73
        ~ChannelTreeWidgetItem();
 
74
private:
 
75
        ChannelTreeWidgetItemData * m_pData;
 
76
public:
 
77
        bool operator<(const QTreeWidgetItem & other) const;
 
78
        inline ChannelTreeWidgetItemData * itemData() { return m_pData; }; 
 
79
};
 
80
 
 
81
class ChannelTreeWidget: public KviThemedTreeWidget
 
82
{
 
83
        friend class ChannelTreeWidgetItem;
 
84
        friend class ChannelTreeWidgetItemData;
 
85
        Q_OBJECT
 
86
public:
 
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); };
 
90
};
 
91
 
 
92
class ListWindow : public KviWindow, public KviExternalServerDataParser
 
93
{
 
94
        Q_OBJECT
 
95
public:
 
96
        ListWindow(KviMainWindow * lpFrm, KviConsoleWindow * lpConsole);
 
97
        ~ListWindow();
 
98
protected:
 
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;
 
110
public: // Methods
 
111
        virtual void control(int iMsg);
 
112
        virtual void processData(KviIrcMessage * pMsg);
 
113
        virtual void die();
 
114
        virtual QSize sizeHint() const;
 
115
protected:
 
116
        virtual QPixmap * myIconPtr();
 
117
        virtual void fillCaptionBuffers();
 
118
        virtual void applyOptions();
 
119
        virtual void resizeEvent(QResizeEvent * e);
 
120
        virtual void getBaseLogFileName(QString & szBuffer);
 
121
protected slots:
 
122
        void flush();
 
123
        void itemDoubleClicked(QTreeWidgetItem * it, int);
 
124
        void requestList();
 
125
        void stoplistdownload();
 
126
        void connectionStateChange();
 
127
        void exportList();
 
128
        void importList();
 
129
        void liveSearch(const QString & szText);
 
130
private:
 
131
        void reset();
 
132
        void endOfList();
 
133
        void startOfList();
 
134
};
 
135
 
 
136
#endif //_KVI_LISTWINDOW_H_