00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef _QIMPENINPUT_H_
00022 #define _QIMPENINPUT_H_
00023
00024 #include "qimpenprofile.h"
00025
00026 #include <qpe/qdawg.h>
00027
00028 #include <qframe.h>
00029 #include <qlist.h>
00030 #include <qguardedptr.h>
00031
00032 class QPushButton;
00033 class QTimer;
00034 class QIMPenWidget;
00035 class QIMPenSetup;
00036 class QIMPenWordPick;
00037 class QIMPenMatch;
00038 class HandwritingHelp;
00039
00040 class QIMPenInput : public QFrame
00041 {
00042 Q_OBJECT
00043 public:
00044 QIMPenInput( QWidget *parent = 0, const char *name = 0, WFlags wf = 0 );
00045 virtual ~QIMPenInput();
00046
00047 void resetState();
00048
00049 QSize sizeHint() const;
00050
00051 signals:
00052 void key( ushort, ushort, ushort, bool, bool );
00053
00054 private slots:
00055 void wordPicked( const QString & );
00056 void selectCharSet( int );
00057 void beginStroke();
00058 void strokeEntered( QIMPenStroke *st );
00059 void matchedCharacters( const QIMPenCharMatchList &cl );
00060 void keypress( uint scan_uni );
00061 void erase();
00062 void help();
00063 void setup();
00064 void backspace();
00065 void enter();
00066
00067 private:
00068 void loadProfiles();
00069 void selectProfile( const QString &name );
00070 void handleExtended( const QString & );
00071 void updateWordMatch( QIMPenCharMatchList &ml );
00072 void matchWords();
00073 void scanDict( const QDawg::Node* n, int ipos, const QString& str, int error );
00074
00075 enum Mode { Normal, Switch, SwitchLock };
00076
00077 private:
00078 Mode mode;
00079 QRect prefRect;
00080 QIMPenWidget *pw;
00081 QPushButton *helpBtn;
00082 QPushButton *setupBtn;
00083 QIMPenSetup *setupDlg;
00084 QIMPenMatch *matcher;
00085 QGuardedPtr<HandwritingHelp> helpDlg;
00086 QIMPenProfile *profile;
00087 QList<QIMPenProfile> profileList;
00088 QIMPenCharSet *shortcutCharSet;
00089 QIMPenCharSetList baseSets;
00090 int currCharSet;
00091 QIMPenWordPick *wordPicker;
00092 };
00093
00094 #endif // _QIMPENINPUT_H_