blob: 8e10bd0d5b3e3e19f6bae60dccfa55ae91632b20 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
/***************************************************************************
kocrbase.h - base dialog for OCR
-------------------
begin : Sun Jun 11 2000
copyright : (C) 2000 by Klaas Freitag
email : freitag@suse.de
***************************************************************************/
/***************************************************************************
* *
* 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 COPYING included in the *
* packaging of this file. *
*
* As a special exception, permission is given to link this program *
* with any version of the KADMOS ocr/icr engine of reRecognition GmbH, *
* Kreuzlingen and distribute the resulting executable without *
* including the source code for KADMOS in the source distribution. *
*
* As a special exception, permission is given to link this program *
* with any edition of TQt, and distribute the resulting executable, *
* without including the source code for TQt in the source distribution. *
* *
***************************************************************************/
#ifndef KOCRBASE_H
#define KOCRBASE_H
#include <kdialogbase.h>
#include <kio/previewjob.h>
#include <tqimage.h>
#include <tqstring.h>
#include <kscanslider.h>
#include <kanimwidget.h>
#include <ksconfig.h>
#include "ksaneocr.h"
/**
*@author Klaas Freitag
*/
class KookaImage;
class TQHBox;
class TQVBox;
class TQLabel;
class TQSize;
class KSpellConfig;
class TQCheckBox;
class TQGroupBox;
class KOCRBase: public KDialogBase
{
Q_OBJECT
TQ_OBJECT
public:
KOCRBase( TQWidget *, KSpellConfig *spellConfig,
KDialogBase::DialogType face = KDialogBase::Plain );
~KOCRBase();
virtual EngineError setupGui();
/**
* @return the name of the ocr engine
*/
virtual TQString ocrEngineName() const { return TQString(); }
/**
* @return the filename (without path) of the logo of the ocr engine.
* the logo needs to be installed in $TDEDIR/share/apps/kooka/pics
*/
virtual TQString ocrEngineLogo() const { return TQString(); }
/**
* @return a description string of the ocr engine
*/
virtual TQString ocrEngineDesc() const { return TQString(); }
TQVBox* ocrPage() const { return m_ocrPage; }
TQVBox* imagePage() const { return m_imgPage; }
KSpellConfig* spellConfig() const
{ return m_spellConfig; }
bool wantSpellCheck();
public slots:
virtual void stopAnimation();
virtual void startAnimation();
virtual void introduceImage( KookaImage* );
virtual void startOCR();
virtual void stopOCR();
/**
* enable or disable dialog fields. This slot is called when the ocr process starts
* with parameter state=false and called again if the gui should accept user input
* again after ocr finished with parameter true.
*/
virtual void enableFields(bool state);
protected:
/**
* This creates a a tab OCR in the dialog and creates a small intro about the
* ocr engine used.
* It calls the virtual subs ocrEngineName, ocrEngineLogo and ocrEngineDesc which
* must return the approbiate values for the engines.
* @return a pointer to a VBox in which further elements can be layouted
*/
virtual void ocrIntro();
/**
* This creates a a tab Image Info in the dialog and creates a image description
* about the current image to ocr.
*/
virtual void imgIntro();
/**
* This sets up the spellchecking configuration
*/
virtual void spellCheckIntro();
protected slots:
virtual KAnimWidget* getAnimation(TQWidget*);
virtual void writeConfig();
virtual void slSpellConfigChanged();
/**
* hit if the user toggles the want-spellcheck checkbox
*/
virtual void slWantSpellcheck( bool wantIt );
private slots:
virtual void slPreviewResult( KIO::Job* );
virtual void slGotPreview( const KFileItem*, const TQPixmap& );
private:
KAnimWidget *m_animation;
TQVBox *m_ocrPage;
TQVBox *m_imgPage;
TQVBox *m_spellchkPage;
TQVBox *m_metaBox;
TQHBox *m_imgHBox;
TQLabel *m_previewPix;
KookaImage *m_currImg;
KSpellConfig *m_spellConfig;
bool m_wantSpellCfg; /* show the spellcheck options? */
bool m_userWantsSpellCheck; /* user has enabled/disabled spellcheck */
TQSize m_previewSize;
TQCheckBox *m_cbWantCheck;
TQGroupBox *m_gbSpellOpts;
};
#endif
|