summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/irc/ui/channellist.h
blob: a5963b6b73ff2e76176fa28be5a0c2adeb308703 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
 /*
    channellist.h - IRC Channel Search Widget

    Copyright (c) 2004      by Jason Keirstead <[email protected]>

    Kopete    (c) 2004      by the Kopete developers <[email protected]>

    *************************************************************************
    *                                                                       *
    * 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.                                   *
    *                                                                       *
    *************************************************************************
*/

#ifndef CHANNELLIST_H
#define CHANNELLIST_H

#include <tqwidget.h>
#include <tqmap.h>
#include <tqpair.h>

#include "kircengine.h"

class TQVBoxLayout;
class TQHBoxLayout;
class TQGridLayout;
class TQLabel;
class TQLineEdit;
class TQPushButton;
class KListView;
class TQSpinBox;
class TQListViewItem;

class ChannelList
	: public TQWidget
{
	Q_OBJECT
  TQ_OBJECT

	public:
		ChannelList( TQWidget *parent, KIRC::Engine *engine );

	public slots:
		void search();
		void reset();
		void clear();

	signals:
		void channelDoubleClicked( const TQString &channel );
		void channelSelected( const TQString &channel );

	private slots:
		void slotItemDoubleClicked( TQListViewItem * i );
		void slotItemSelected( TQListViewItem * i );
		void slotChannelListed( const TQString & channel, uint users, const TQString & topic );
		void slotListEnd();
		void slotSearchCache();
		void slotStatusChanged( KIRC::Engine::tqStatus );

	private:
		void checkSearchResult( const TQString & channel, uint users, const TQString & topic );

		TQLabel* textLabel1_2;
		TQLineEdit* channelSearch;
		TQSpinBox* numUsers;
		TQPushButton* mSearchButton;
		KListView* mChannelList;
		TQVBoxLayout* ChannelListLayout;
		TQHBoxLayout* tqlayout72_2;
		KIRC::Engine *m_engine;
		bool mSearching;
		TQString mSearch;
		uint mUsers;
		TQMap< TQString, TQPair< uint, TQString > > channelCache;
		TQMap< TQString, TQPair< uint, TQString > >::const_iterator cacheIterator;
};

#endif