~ubuntu-branches/ubuntu/hoary/kvirc/hoary

« back to all changes in this revision

Viewing changes to src/kvilib/kvi_selectors.h

  • Committer: Bazaar Package Importer
  • Author(s): Robin Verduijn
  • Date: 2004-12-14 15:32:19 UTC
  • mfrom: (0.2.1 upstream) (1.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20041214153219-fdink3gyp2s20b6g
Tags: 2:2.1.3.1-2
* Change Recommends on xmms to a Suggests.
* Rebuild against KDE 3.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef _KVI_SELECTORS_H_INCLUDED_
2
 
#define _KVI_SELECTORS_H_INCLUDED_
3
 
 
4
 
//
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
7
 
//
8
 
//   This file is part of the KVirc irc client distribution
9
 
//   Copyright (C) 1999-2000 Szymon Stefanek (stefanek@tin.it)
10
 
//
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.
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. ,59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24
 
//
25
 
 
26
 
#include "kvi_string.h"
27
 
 
28
 
#include <qwidget.h>
29
 
#include <qtabdialog.h>
30
 
#include <qlineedit.h>
31
 
#include <qspinbox.h>
32
 
#include <qcheckbox.h>
33
 
#include <qcolor.h>
34
 
#include <qfont.h>
35
 
#include <qpushbutton.h>
36
 
 
37
 
#include <qhbox.h>
38
 
#include <qlayout.h>
39
 
#include <qlabel.h>
40
 
 
41
 
class KviLineEdit : public QLineEdit
42
 
{
43
 
        Q_OBJECT
44
 
public:
45
 
        KviLineEdit(QWidget * parent,const char *name=0);
46
 
        ~KviLineEdit();
47
 
        QString text() const;
48
 
public slots:
49
 
        virtual void setText(const char *text);
50
 
        void insert(const char *newText);
51
 
protected:
52
 
        KviStr m_szAltKeyCode;
53
 
        virtual void keyPressEvent(QKeyEvent *e);
54
 
        virtual void keyReleaseEvent(QKeyEvent *e);
55
 
};
56
 
 
57
 
class KviIpEditor : public QHBox
58
 
{
59
 
        Q_OBJECT
60
 
public:
61
 
        KviIpEditor(QWidget * parent,const QString &ipAddr = QString::null,const char *name = 0);
62
 
        ~KviIpEditor();
63
 
private:
64
 
        QLabel      * m_pLabel[3];
65
 
        QLineEdit   * m_pEdit[4];
66
 
public:
67
 
        bool setAddress(const QString &ipAddr);
68
 
        QString address();
69
 
        virtual void setEnabled(bool bEnabled);
70
 
protected:
71
 
        virtual bool eventFilter(QObject * o,QEvent *e);
72
 
};
73
 
 
74
 
class KviNewStringSelector : public QWidget
75
 
{
76
 
        Q_OBJECT
77
 
public:
78
 
        KviNewStringSelector(QWidget *parent,const char *description,KviStr *pString,bool bEnabled = true,int fieldWidth = -1,const char *name = 0);
79
 
        ~KviNewStringSelector();
80
 
private:
81
 
        KviStr    * m_pString;
82
 
        QLabel    * m_pLabel;
83
 
        QLineEdit * m_pEdit;
84
 
        int         m_iFieldWidth;
85
 
public:
86
 
        virtual void commitChanges();
87
 
        virtual void setEnabled(bool bEnabled);
88
 
        static void commitAll(QWidget *w);
89
 
protected:
90
 
        virtual void resizeEvent(QResizeEvent *);
91
 
        virtual QSize sizeHint();
92
 
};
93
 
 
94
 
class KviNewCharSelector : public QWidget
95
 
{
96
 
        Q_OBJECT
97
 
public:
98
 
        KviNewCharSelector(QWidget *parent,const char *description,char *pChar,bool bEnabled = true,int fieldWidth = -1,const char *name = 0);
99
 
        ~KviNewCharSelector();
100
 
private:
101
 
        char      * m_pChar;
102
 
        QLabel    * m_pLabel;
103
 
        QLineEdit * m_pEdit;
104
 
        int         m_iFieldWidth;
105
 
public:
106
 
        virtual void commitChanges();
107
 
//      virtual bool selectionChanged();
108
 
        virtual void setEnabled(bool bEnabled);
109
 
protected:
110
 
        virtual void resizeEvent(QResizeEvent *);
111
 
        virtual QSize sizeHint();
112
 
};
113
 
 
114
 
 
115
 
class KviNewIntegerSelector : public QWidget
116
 
{
117
 
        Q_OBJECT
118
 
public:
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();
123
 
private:
124
 
        IntSelectorType m_type;
125
 
        void      * m_pNumber;
126
 
        QLabel    * m_pLabel;
127
 
//      QLineEdit * m_pEdit;
128
 
        QSpinBox  * m_pSpinBox;
129
 
        int         m_iFieldWidth;
130
 
        int         m_iLowBound;
131
 
        int         m_iHighBound;
132
 
        KviStr      m_szDefault;
133
 
public:
134
 
        virtual void commitChanges();
135
 
        static void commitAll(QWidget * w);
136
 
protected:
137
 
        virtual void resizeEvent(QResizeEvent *);
138
 
        virtual QSize sizeHint();
139
 
        virtual void setEnabled(bool bEnabled);
140
 
public slots:
141
 
        void setNotEnabled(bool bNotEnabled){ setEnabled(!bNotEnabled); };
142
 
};
143
 
 
144
 
class KviNewBoolSelector : public QCheckBox
145
 
{
146
 
        Q_OBJECT
147
 
public:
148
 
        KviNewBoolSelector(QWidget *parent,const char *description,bool *pBool,bool bEnabled = true,const char *name = 0);
149
 
        ~KviNewBoolSelector();
150
 
private:
151
 
        bool      * m_pBool;
152
 
public:
153
 
        virtual void commitChanges();
154
 
        static void commitAll(QWidget *w);
155
 
public slots:
156
 
        void setNotEnabled(bool bNotEnabled){ setEnabled(!bNotEnabled); };
157
 
};
158
 
 
159
 
 
160
 
class KviNewFileSelector : public QWidget
161
 
{
162
 
        Q_OBJECT
163
 
public:
164
 
        KviNewFileSelector(QWidget * parent,KviStr *valuePtr,bool bMustBeReadable,bool bEnabled = true);
165
 
        ~KviNewFileSelector();
166
 
private:
167
 
        KviStr * m_valuePtr;
168
 
        QLabel * m_pValueLabel;
169
 
        QPushButton * m_pButton;
170
 
        bool     m_bMustBeReadable;
171
 
public slots:
172
 
        virtual void setEnabled(bool bEnabled);
173
 
public:
174
 
        virtual void commitChanges();
175
 
//      virtual bool selectionChanged();
176
 
protected slots:
177
 
        void changeFile();
178
 
};
179
 
 
180
 
class KviNewIpSelector : public QHBox
181
 
{
182
 
        Q_OBJECT
183
 
public:
184
 
        KviNewIpSelector(QWidget * parent,const char * description,KviStr *ipPtr,bool bEnabled = true);
185
 
        ~KviNewIpSelector();
186
 
private:
187
 
        KviStr * m_ipPtr;
188
 
        QLabel * m_pDescription;
189
 
        KviIpEditor * m_pIpEditor;
190
 
public slots:
191
 
        virtual void setEnabled(bool bEnabled);
192
 
public:
193
 
        virtual void commitChanges();
194
 
};
195
 
 
196
 
class KviColorButton;
197
 
 
198
 
class KviNewColorSelector : public QWidget
199
 
{
200
 
        Q_OBJECT
201
 
public:
202
 
        KviNewColorSelector(QWidget *parent,const char * label,QColor *valuePtr,bool bEnabled = true,int defInputWidth = 100);
203
 
        ~KviNewColorSelector();
204
 
private:
205
 
        QColor *m_valuePtr;
206
 
        QLabel  *m_pLabel;
207
 
        KviColorButton *m_pClrButton;
208
 
        int     m_iDefInputWidth;
209
 
protected:
210
 
        virtual void resizeEvent(QResizeEvent *);
211
 
public:
212
 
        void setColor(const QColor &clr);
213
 
        const QColor &getColor();
214
 
        virtual QSize sizeHint();
215
 
        virtual void setEnabled(bool bEnabled);
216
 
public:
217
 
        void commitChanges();
218
 
};
219
 
 
220
 
class KviFontButton;
221
 
 
222
 
class KviNewFontSelector : public QWidget
223
 
{
224
 
        Q_OBJECT
225
 
public:
226
 
        KviNewFontSelector(QWidget *parent,const char *label,QFont *fnt,
227
 
                bool bEnabled = true,int defInputWidth = 100);
228
 
        ~KviNewFontSelector();
229
 
private:
230
 
        QFont *m_valuePtr;
231
 
        QLabel  *m_pLabel;
232
 
        KviFontButton *m_pFntButton;
233
 
        int     m_iDefInputWidth;
234
 
protected:
235
 
        virtual void resizeEvent(QResizeEvent *);
236
 
public:
237
 
        virtual QSize sizeHint();
238
 
        QFont getFont();
239
 
        void commitChanges();
240
 
};
241
 
 
242
 
class KviImageButton;
243
 
 
244
 
class KviNewImageSelector : public QWidget
245
 
{
246
 
        Q_OBJECT
247
 
public:
248
 
        KviNewImageSelector(QWidget *parent,const char *label,KviStr *valuePtr,QPixmap * cachedPixmap,bool bEnabled = true);
249
 
        ~KviNewImageSelector();
250
 
private:
251
 
        KviStr *m_valuePtr;
252
 
        QCheckBox *m_pCheckBox;
253
 
        KviImageButton *m_pImgButton;
254
 
protected:
255
 
        virtual void resizeEvent(QResizeEvent *);
256
 
public:
257
 
        const QPixmap *getImage();
258
 
        virtual QSize sizeHint();
259
 
        void commitChanges();
260
 
};
261
 
 
262
 
#endif //!_KVI_SELECTORS_H_INCLUDED_