summaryrefslogtreecommitdiff
path: root/noncore/apps/checkbook/qrestrictedline.h
authorharlekin <harlekin>2002-07-05 13:00:41 (UTC)
committer harlekin <harlekin>2002-07-05 13:00:41 (UTC)
commit60238d4e9781ad18475a3b45bceaad1d30ea1b8b (patch) (unidiff)
treef4aac0b3daab54d8cb004879a91c51fd1f619a55 /noncore/apps/checkbook/qrestrictedline.h
parenta332e5e111b0c9ef8eb0836876a4ff386c660514 (diff)
downloadopie-60238d4e9781ad18475a3b45bceaad1d30ea1b8b.zip
opie-60238d4e9781ad18475a3b45bceaad1d30ea1b8b.tar.gz
opie-60238d4e9781ad18475a3b45bceaad1d30ea1b8b.tar.bz2
spendings tracking app by Nick Betcher (who quit qte development .-( )
Diffstat (limited to 'noncore/apps/checkbook/qrestrictedline.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/checkbook/qrestrictedline.h96
1 files changed, 96 insertions, 0 deletions
diff --git a/noncore/apps/checkbook/qrestrictedline.h b/noncore/apps/checkbook/qrestrictedline.h
new file mode 100644
index 0000000..7e41cd9
--- a/dev/null
+++ b/noncore/apps/checkbook/qrestrictedline.h
@@ -0,0 +1,96 @@
1/*
2 *
3 * Definition of QRestrictedLine
4 *
5 * Copyright (C) 1997 Michael Wiedmann, <mw@miwie.in-berlin.de>
6 *
7 * Edited 2001 by Nick Betcher <nbetcher@usinternet.com> to work
8 * with Qt-only. Changed class name from QRestrictedLine to
9 * QRestrictedLine.
10 *
11 * This library is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU Library General Public
13 * License as published by the Free Software Foundation; either
14 * version 2 of the License, or (at your option) any later version.
15 *
16 * This library 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. See the GNU
19 * Library General Public License for more details.
20 *
21 * You should have received a copy of the GNU Library General Public
22 * License along with this library; if not, write to the Free
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 *
25 */
26
27#ifndef QRESTRICTEDLINE_H
28#define QRESTRICTEDLINE_H
29
30#include <qlineedit.h>
31
32/**
33 * The QRestrictedLine widget is a variant of @ref QLineEdit which
34 * accepts only a restricted set of characters as input.
35 * All other characters will be discarded and the signal @ref #invalidChar()
36 * will be emitted for each of them.
37 *
38 * Valid characters can be passed as a QString to the constructor
39 * or set afterwards via @ref #setValidChars().
40 * The default key bindings of @ref QLineEdit are still in effect.
41 *
42 * @short A line editor for restricted character sets.
43 * @author Michael Wiedmann <mw@miwie.in-berlin.de>
44 * @version 0.0.1
45 */
46class QRestrictedLine : public QLineEdit
47{
48 Q_OBJECT
49 Q_PROPERTY( QString validChars READ validChars WRITE setValidChars )
50
51public:
52
53 /**
54 * Constructor: This contructor takes three - optional - arguments.
55 * The first two parameters are simply passed on to @ref QLineEdit.
56 * @param parent pointer to the parent widget
57 * @param name pointer to the name of this widget
58 * @param valid pointer to set of valid characters
59 */
60 QRestrictedLine( QWidget *parent=0, const char *name=0,
61 const QString& valid = QString::null);
62
63 /**
64 * Destructs the restricted line editor.
65 */
66 ~QRestrictedLine();
67
68 /**
69 * All characters in the string valid are treated as
70 * acceptable characters.
71 */
72 void setValidChars(const QString& valid);
73 /**
74 * @return the string of acceptable characters.
75 */
76 QString validChars() const;
77
78signals:
79
80 /**
81 * Emitted when an invalid character was typed.
82 */
83 voidinvalidChar(int);
84
85protected:
86 /**
87 * @reimplemented
88 */
89 voidkeyPressEvent( QKeyEvent *e );
90
91private:
92 /// QString of valid characters for this line
93 QStringqsValidChars;
94};
95
96#endif // QRESTRICTEDLINE_H