summaryrefslogtreecommitdiffstats
path: root/src/modules/toolbareditor/toolbareditor.h
blob: 2c44178c93175aaef79cd2d8c01364e58baf1589 (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
#ifndef _TOOLBAREDITOR_H_
#define _TOOLBAREDITOR_H_
//=============================================================================
//
//   File : toolbareditor.h
//   Created on Wed 01 Dec 2004 14:42:20 by Szymon Stefanek
//
//   This file is part of the KVIrc IRC client distribution
//   Copyright (C) 2004 Szymon Stefanek <pragma at kvirc dot net>
//
//   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 "kvi_settings.h"
#include <qwidget.h>
#include <qlabel.h>
#include <qdialog.h>
#include <qcolor.h>

class QPushButton;
class KviActionDrawer;

class KviCustomizeToolBarsDialog : public QDialog
{
	Q_OBJECT
protected:
	KviCustomizeToolBarsDialog(QWidget * p);
public:
	~KviCustomizeToolBarsDialog();
protected:
	KviActionDrawer * m_pDrawer;
	static KviCustomizeToolBarsDialog * m_pInstance;
	QPushButton * m_pDeleteToolBarButton;
	QPushButton * m_pRenameToolBarButton;
	QPushButton * m_pExportToolBarButton;
public:
	static KviCustomizeToolBarsDialog * instance(){ return m_pInstance; };
	static void display();
	static void cleanup();
protected:
	virtual void showEvent(QShowEvent * e);
	virtual void closeEvent(QCloseEvent *e);
protected slots:
	void closeClicked();
	void newToolBar();
	void deleteToolBar();
	void renameToolBar();
	void exportToolBar();
	void currentToolBarChanged();
};

class QLineEdit;
class QPushButton;

class KviCustomToolBarPropertiesDialog : public QDialog
{
	Q_OBJECT
public:
	KviCustomToolBarPropertiesDialog(QWidget * p,const QString &szText,const QString &szId = QString::null,const QString &szLabel = QString::null,const QString &szIconId = QString::null);
	~KviCustomToolBarPropertiesDialog();
protected:
	QString m_szId;
	QString m_szOriginalId;
	QString m_szLabel;
	QString m_szIconId;
	QWidget * m_pAdvanced;
	QLineEdit * m_pIdEdit;
	QLineEdit * m_pLabelEdit;
	QLineEdit * m_pIconEdit;
	QPushButton * m_pIconButton;
	QPushButton * m_pAdvancedButton;
public:
	const QString &id(){ return m_szId; };
	const QString &label(){ return m_szLabel; };
	const QString &iconId(){ return m_szIconId; };
protected slots:
	void okClicked();
	void advancedClicked();
	void iconButtonClicked();
	void labelTextChanged(const QString &s);
protected:
	void iconSelected(const QString &szIconId);
};

class QTimer;

class KviTrashcanLabel : public QLabel
{
	Q_OBJECT
public:
	KviTrashcanLabel(QWidget * p);
	virtual ~KviTrashcanLabel();
protected:
	unsigned int m_uFlashCount;
	QTimer * m_pFlashTimer;
	QColor   m_clrOriginal;
protected:
	virtual void dragEnterEvent(QDragEnterEvent * e);
	virtual void dropEvent(QDropEvent * e);
public slots:
	void flash();
protected slots:
	void heartbeat();
};

#endif //!_TOOLBAREDITOR_H_