1
#ifndef _KVI_SELECTORS_H_INCLUDED_
2
#define _KVI_SELECTORS_H_INCLUDED_
5
// File : kvi_selectors.h (/usr/build/NEW_kvirc/kvirc/kvilib/kvi_selectors.h)
6
// Last major modification : Sat Jan 16 1999 14:56:21 by Szymon Stefanek
8
// This file is part of the KVirc irc client distribution
9
// Copyright (C) 1999-2000 Szymon Stefanek (stefanek@tin.it)
11
// This program is FREE software. You can redistribute it and/or
12
// modify it under the terms 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. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
26
#include "kvi_string.h"
29
#include <qtabdialog.h>
30
#include <qlineedit.h>
32
#include <qcheckbox.h>
35
#include <qpushbutton.h>
41
class KviLineEdit : public QLineEdit
45
KviLineEdit(QWidget * parent,const char *name=0);
49
virtual void setText(const char *text);
50
void insert(const char *newText);
52
KviStr m_szAltKeyCode;
53
virtual void keyPressEvent(QKeyEvent *e);
54
virtual void keyReleaseEvent(QKeyEvent *e);
57
class KviIpEditor : public QHBox
61
KviIpEditor(QWidget * parent,const QString &ipAddr = QString::null,const char *name = 0);
65
QLineEdit * m_pEdit[4];
67
bool setAddress(const QString &ipAddr);
69
virtual void setEnabled(bool bEnabled);
71
virtual bool eventFilter(QObject * o,QEvent *e);
74
class KviNewStringSelector : public QWidget
78
KviNewStringSelector(QWidget *parent,const char *description,KviStr *pString,bool bEnabled = true,int fieldWidth = -1,const char *name = 0);
79
~KviNewStringSelector();
86
virtual void commitChanges();
87
virtual void setEnabled(bool bEnabled);
88
static void commitAll(QWidget *w);
90
virtual void resizeEvent(QResizeEvent *);
91
virtual QSize sizeHint();
94
class KviNewCharSelector : public QWidget
98
KviNewCharSelector(QWidget *parent,const char *description,char *pChar,bool bEnabled = true,int fieldWidth = -1,const char *name = 0);
99
~KviNewCharSelector();
106
virtual void commitChanges();
107
// virtual bool selectionChanged();
108
virtual void setEnabled(bool bEnabled);
110
virtual void resizeEvent(QResizeEvent *);
111
virtual QSize sizeHint();
115
class KviNewIntegerSelector : public QWidget
119
enum IntSelectorType { Int , UInt , UShort , Short };
120
KviNewIntegerSelector(QWidget *parent,const char *description,void * pNumber,IntSelectorType type,int lowerBound,int upperBound,
121
int defValue,bool bEnabled = true,int fieldWidth = -1,const char *name = 0,int lineStep = 0,const char *suffix = "");
122
~KviNewIntegerSelector();
124
IntSelectorType m_type;
127
// QLineEdit * m_pEdit;
128
QSpinBox * m_pSpinBox;
134
virtual void commitChanges();
135
static void commitAll(QWidget * w);
137
virtual void resizeEvent(QResizeEvent *);
138
virtual QSize sizeHint();
139
virtual void setEnabled(bool bEnabled);
141
void setNotEnabled(bool bNotEnabled){ setEnabled(!bNotEnabled); };
144
class KviNewBoolSelector : public QCheckBox
148
KviNewBoolSelector(QWidget *parent,const char *description,bool *pBool,bool bEnabled = true,const char *name = 0);
149
~KviNewBoolSelector();
153
virtual void commitChanges();
154
static void commitAll(QWidget *w);
156
void setNotEnabled(bool bNotEnabled){ setEnabled(!bNotEnabled); };
160
class KviNewFileSelector : public QWidget
164
KviNewFileSelector(QWidget * parent,KviStr *valuePtr,bool bMustBeReadable,bool bEnabled = true);
165
~KviNewFileSelector();
168
QLabel * m_pValueLabel;
169
QPushButton * m_pButton;
170
bool m_bMustBeReadable;
172
virtual void setEnabled(bool bEnabled);
174
virtual void commitChanges();
175
// virtual bool selectionChanged();
180
class KviNewIpSelector : public QHBox
184
KviNewIpSelector(QWidget * parent,const char * description,KviStr *ipPtr,bool bEnabled = true);
188
QLabel * m_pDescription;
189
KviIpEditor * m_pIpEditor;
191
virtual void setEnabled(bool bEnabled);
193
virtual void commitChanges();
196
class KviColorButton;
198
class KviNewColorSelector : public QWidget
202
KviNewColorSelector(QWidget *parent,const char * label,QColor *valuePtr,bool bEnabled = true,int defInputWidth = 100);
203
~KviNewColorSelector();
207
KviColorButton *m_pClrButton;
208
int m_iDefInputWidth;
210
virtual void resizeEvent(QResizeEvent *);
212
void setColor(const QColor &clr);
213
const QColor &getColor();
214
virtual QSize sizeHint();
215
virtual void setEnabled(bool bEnabled);
217
void commitChanges();
222
class KviNewFontSelector : public QWidget
226
KviNewFontSelector(QWidget *parent,const char *label,QFont *fnt,
227
bool bEnabled = true,int defInputWidth = 100);
228
~KviNewFontSelector();
232
KviFontButton *m_pFntButton;
233
int m_iDefInputWidth;
235
virtual void resizeEvent(QResizeEvent *);
237
virtual QSize sizeHint();
239
void commitChanges();
242
class KviImageButton;
244
class KviNewImageSelector : public QWidget
248
KviNewImageSelector(QWidget *parent,const char *label,KviStr *valuePtr,QPixmap * cachedPixmap,bool bEnabled = true);
249
~KviNewImageSelector();
252
QCheckBox *m_pCheckBox;
253
KviImageButton *m_pImgButton;
255
virtual void resizeEvent(QResizeEvent *);
257
const QPixmap *getImage();
258
virtual QSize sizeHint();
259
void commitChanges();
262
#endif //!_KVI_SELECTORS_H_INCLUDED_