summaryrefslogtreecommitdiff
path: root/inputmethods/pickboard/pickboardcfg.h
authorzecke <zecke>2004-10-15 02:30:08 (UTC)
committer zecke <zecke>2004-10-15 02:30:08 (UTC)
commit5c3759f02725c17ba0efc386193a83da55a9a5da (patch) (side-by-side diff)
treeb03e604b282de315096b74b6f404851c2bba3ad6 /inputmethods/pickboard/pickboardcfg.h
parentfefeafe35f8dac30f4baab9e3bff8e2ffbd1afd0 (diff)
downloadopie-5c3759f02725c17ba0efc386193a83da55a9a5da.zip
opie-5c3759f02725c17ba0efc386193a83da55a9a5da.tar.gz
opie-5c3759f02725c17ba0efc386193a83da55a9a5da.tar.bz2
Apply patch from Qtopia1.7 to allow 'Umlaute' in the pickboard
and make 'strings' translatable. This also fixes #501
Diffstat (limited to 'inputmethods/pickboard/pickboardcfg.h') (more/less context) (ignore whitespace changes)
-rw-r--r--inputmethods/pickboard/pickboardcfg.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/inputmethods/pickboard/pickboardcfg.h b/inputmethods/pickboard/pickboardcfg.h
index b1913df..92c6420 100644
--- a/inputmethods/pickboard/pickboardcfg.h
+++ b/inputmethods/pickboard/pickboardcfg.h
@@ -1,16 +1,16 @@
/**********************************************************************
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
**
-** This file is part of Qtopia Environment.
+** This file is part of the Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
@@ -67,25 +67,26 @@ public:
QString word() const;
bool exec();
private slots:
void checkAllDone();
private:
QPushButton *yes;
LetterChoice **lc;
int nlc;
};
-class PickboardConfig : QObject {
+class PickboardConfig : public QObject {
+ Q_OBJECT
public:
PickboardConfig(PickboardPicks* p) : parent(p), nrows(2), pressx(-1) { }
virtual ~PickboardConfig();
virtual void pickPoint(const QPoint& p, bool press);
virtual void draw(QPainter*)=0;
virtual void fillMenu(QPopupMenu&);
virtual void doMenu(int);
protected:
void updateRows(int from, int to);
virtual void updateItem(int r, int i);
virtual void pickInRow(int r, int xpos, bool press)=0;
@@ -95,114 +96,118 @@ protected:
void generateKey( int k );
virtual void pick(bool press, int row, int item)=0;
protected:
PickboardPicks* parent;
int nrows;
private:
int pressrow, pressx;
};
class StringConfig : public PickboardConfig {
+ Q_OBJECT
public:
StringConfig(PickboardPicks* p) : PickboardConfig(p) { }
void draw(QPainter* p);
protected:
virtual QString text(int r, int i)=0;
virtual bool spreadRow(int i)=0;
- virtual QColor rowColor(int) { return ::Qt::black; }
+ virtual QColor rowColor(int) { return Qt::black; }
virtual void pickInRow(int r, int xpos, bool press);
virtual void updateItem(int r, int i);
virtual bool highlight(int,int) const;
};
class CharStringConfig : public StringConfig {
+ Q_OBJECT
QString input;
QStringList chars;
public:
CharStringConfig(PickboardPicks* p) : StringConfig(p) { }
void addChar(const QString& s);
virtual void doMenu(int);
protected:
QString text(int r, int i);
bool spreadRow(int i);
void pick(bool press, int row, int item);
};
class DictFilterConfig : public StringConfig {
+ Q_OBJECT
QStringList matches;
+ QStringList sets_a;
QStringList sets;
QStringList othermodes;
int lit0;
int lit1;
int shift;
QString capitalize(const QString& s);
QStringList capitalize(const QStringList& s);
public:
QStringList input;
DictFilterConfig(PickboardPicks* p) : StringConfig(p)
{
shift = 0;
lit0 = -1;
lit1 = -1;
}
- void addSet(const QString& s);
+ void addSet(const QString& apperance, const QString& set);
void addMode(const QString& s);
void fillMenu(QPopupMenu& menu);
void doMenu(int i);
void add(const QString& set);
protected:
QString text(int r, int i);
bool spreadRow(int i);
void pick(bool press, int row, int item);
bool scanMatch(const QString& set, const QChar& l) const;
void scan(const QDawg::Node* n, int ipos, const QString& str, int length, bool extend);
void scanLengths(const QDawg::Node* n, int ipos, int& bitarray);
bool highlight(int r,int c) const;
};
class CharConfig : public StringConfig {
+ Q_OBJECT
QStringList chars1;
QStringList chars2;
public:
CharConfig(PickboardPicks* p) : StringConfig(p) { }
void addChar(int r, const QString& s);
protected:
QString text(int r, int i);
bool spreadRow(int);
void pick(bool press, int row, int item);
};
class KeycodeConfig : public PickboardConfig {
QValueList<int> keys1;
QValueList<int> keys2;
QValueList<QPixmap> keypm1;
QValueList<QPixmap> keypm2;
- static const int xw = 8;
- static const int xmarg = 8;
+ enum { xw = 8, xmarg = 8 };
public:
KeycodeConfig(PickboardPicks* p) : PickboardConfig(p) { }
void addKey(int r, const QPixmap& pm, int code);
void addGap(int r, int w);
void draw(QPainter* p);
protected:
void pickInRow(int r, int xpos, bool press);
QValueList<QPixmap> row(int i);