summaryrefslogtreecommitdiffstats
path: root/src/modules/url/libkviurl.h
blob: 05d56ce8567fd889bcf4fab9beb657ba9868f8ec (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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#ifndef _H_URLDLG
#define _H_URLDLG

//
//   This file is part of the KVIrc irc client distribution
//   Copyright (C) 1999-2000 Andrea Parrella (anandrea@iname.com)
//
//   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 opinion) any later version.
//
//   This program is distributed in the HOPE that it will be USEFUL,
//   but WITHOUT ANY WARRANTY; without even the implied warranty of
//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//   See the GNU General Public License for more details.
//
//   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. ,51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//


#include <qdialog.h>
#include <qlayout.h>
#include "kvi_tal_listview.h"
#include <qstring.h>
#include <qpushbutton.h>
#include <qfile.h>
#ifdef COMPILE_USE_QT4
	#include <q3textstream.h>
#else
	#include <qtextstream.h>
#endif
#include <qcheckbox.h>
#include "kvi_tal_listbox.h"
#include <qmenubar.h>
#include <qinputdialog.h>
#include <qtoolbutton.h>
#include <qiconset.h>

#include "kvi_locale.h"
#include "kvi_config.h"
#include "kvi_irctoolbar.h"
#include "kvi_imagelib.h"
#include "kvi_window.h"
#include "kvi_tal_menubar.h"
#include "kvi_mextoolbar.h"
#include "kvi_styled_controls.h"

#include <qpixmap.h>

typedef struct _KviUrl
{
	QString url;
	QString window;
	int count;
	QString timestamp;
} KviUrl;


class UrlDialog : public KviWindow
{
	Q_OBJECT
public:
	UrlDialog(KviPointerList<KviUrl> *g_pList);
	~UrlDialog();
private:
	KviTalMenuBar *m_pMenuBar;
	KviTalPopupMenu *m_pListPopup;	// dynamic popup menu
	KviStr m_szUrl;			// used to pass urls to sayToWin slot
protected:
	QPixmap *myIconPtr();
	void resizeEvent(QResizeEvent *);
public:
	KviTalListView *m_pUrlList;
	void addUrl(QString url, QString window, QString count, QString timestamp);
//	void saveProperties();
protected slots:
	void config();
	void help();
	void saveList();
	void loadList();
	void clear();
	void close_slot();
	void remove();
	void findtext();
	void dblclk_url(KviTalListViewItem *item);
	void popup(KviTalListViewItem *item, const QPoint &p, int col);
	void sayToWin(int);
};

class BanFrame : public QFrame
{
	Q_OBJECT
public:
	BanFrame(QWidget *parent=0, const char *name=0, bool banEnable = false);
	~BanFrame();
	void saveBans();
private:
	KviStyledCheckBox *m_pEnable;
	KviTalListBox *m_pBanList;
	QPushButton *m_pAddBtn;
	QPushButton *m_pRemoveBtn;
protected slots:
	void enableClicked();
	void addBan();
	void removeBan();
};

#define cbnum 2

class ConfigDialog : public QDialog
{
	Q_OBJECT
public:
	ConfigDialog();
	~ConfigDialog();
private:
	KviStyledCheckBox *cb[cbnum];
	BanFrame *m_pBanFrame;
	void closeEvent(QCloseEvent *);
protected slots:
	void acceptbtn();
	void discardbtn();
};

#include "kvi_kvs_action.h"

class KviUrlAction : public KviKvsAction
{
	Q_OBJECT
public:
	KviUrlAction(QObject * pParent);
	~KviUrlAction();
protected:
	QPixmap * m_pBigIcon;
	QPixmap * m_pSmallIcon;
public:
	virtual QPixmap * bigIcon();
	virtual QPixmap * smallIcon();
};

#endif