summaryrefslogtreecommitdiff
path: root/noncore/apps/dictionary
authorkergoth <kergoth>2002-01-25 22:14:26 (UTC)
committer kergoth <kergoth>2002-01-25 22:14:26 (UTC)
commit15318cad33835e4e2dc620d033e43cd930676cdd (patch) (unidiff)
treec2fa0399a2c47fda8e2cd0092c73a809d17f68eb /noncore/apps/dictionary
downloadopie-15318cad33835e4e2dc620d033e43cd930676cdd.zip
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz
opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2
Initial revision
Diffstat (limited to 'noncore/apps/dictionary') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/dictionary/dictionary.pro14
-rw-r--r--noncore/apps/dictionary/dicttool.cpp59
-rw-r--r--noncore/apps/dictionary/dicttool.h46
-rw-r--r--noncore/apps/dictionary/dicttoolbase.ui412
-rw-r--r--noncore/apps/dictionary/main.cpp31
5 files changed, 562 insertions, 0 deletions
diff --git a/noncore/apps/dictionary/dictionary.pro b/noncore/apps/dictionary/dictionary.pro
new file mode 100644
index 0000000..e829e68
--- a/dev/null
+++ b/noncore/apps/dictionary/dictionary.pro
@@ -0,0 +1,14 @@
1 TEMPLATE= app
2 CONFIG += qt warn_on release
3 DESTDIR = ../bin
4
5 HEADERS= dicttool.h
6 SOURCES= dicttool.cpp main.cpp
7
8 INTERFACES= dicttoolbase.ui
9
10INCLUDEPATH += $(QPEDIR)/include
11 DEPENDPATH+= $(QPEDIR)/include
12LIBS += -lqpe
13
14 TARGET = dictionary
diff --git a/noncore/apps/dictionary/dicttool.cpp b/noncore/apps/dictionary/dicttool.cpp
new file mode 100644
index 0000000..a0f2f9d
--- a/dev/null
+++ b/noncore/apps/dictionary/dicttool.cpp
@@ -0,0 +1,59 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20#include "dicttool.h"
21#include "global.h"
22#include <qstringlist.h>
23#include <qlineedit.h>
24
25DictTool::DictTool( QWidget* parent, const char* name, bool modal, WFlags fl )
26 : DictToolBase( parent, name, modal, fl )
27{
28}
29
30DictTool::~DictTool()
31{
32}
33
34void DictTool::setDictionary(int d)
35{
36 dict = (DictType)d;
37}
38
39void DictTool::setPattern(const QString& s)
40{
41 qWarning( "DictTool::setPattern(const QString&) not yet implemented!" );
42}
43
44void DictTool::setPickboardSet(const QString& s)
45{
46 QStringList sets = QStringList::split(" ",s);
47 qWarning( "DictTool::setPickboardSet(const QString&) not yet implemented!" );
48}
49
50void DictTool::addWord()
51{
52 Global::addWords(word->text());
53}
54
55void DictTool::removeWord()
56{
57 qWarning( "DictTool::removeWord() not yet implemented!" );
58}
59
diff --git a/noncore/apps/dictionary/dicttool.h b/noncore/apps/dictionary/dicttool.h
new file mode 100644
index 0000000..702b772
--- a/dev/null
+++ b/noncore/apps/dictionary/dicttool.h
@@ -0,0 +1,46 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20#ifndef DICTTOOL_H
21#define DICTTOOL_H
22#include "dicttoolbase.h"
23
24class DictTool : public DictToolBase
25{
26 Q_OBJECT
27
28public:
29 DictTool( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
30 ~DictTool();
31
32public slots:
33 void setDictionary(int);
34 void setPattern(const QString&);
35 void setPickboardSet(const QString&);
36
37private slots:
38 void addWord();
39 void removeWord();
40
41private:
42 enum DictType { All, Local, System };
43 DictType dict;
44};
45
46#endif // DICTTOOL_H
diff --git a/noncore/apps/dictionary/dicttoolbase.ui b/noncore/apps/dictionary/dicttoolbase.ui
new file mode 100644
index 0000000..25ef00e
--- a/dev/null
+++ b/noncore/apps/dictionary/dicttoolbase.ui
@@ -0,0 +1,412 @@
1<!DOCTYPE UI><UI>
2<class>DictToolBase</class><comment>*********************************************************************
3** Copyright (C) 2000 Trolltech AS. All rights reserved.
4**
5** This file is part of Qtopia Environment.
6**
7** This file may be distributed and/or modified under the terms of the
8** GNU General Public License version 2 as published by the Free Software
9** Foundation and appearing in the file LICENSE.GPL included in the
10** packaging of this file.
11**
12** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
13** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14**
15** See http://www.trolltech.com/gpl/ for GPL licensing information.
16**
17** Contact info@trolltech.com if any conditions of this licensing are
18** not clear to you.
19**
20*********************************************************************</comment>
21<widget>
22 <class>QDialog</class>
23 <property stdset="1">
24 <name>name</name>
25 <cstring>dicttoolbase</cstring>
26 </property>
27 <property stdset="1">
28 <name>geometry</name>
29 <rect>
30 <x>0</x>
31 <y>0</y>
32 <width>258</width>
33 <height>375</height>
34 </rect>
35 </property>
36 <property stdset="1">
37 <name>caption</name>
38 <string>MyDialog1</string>
39 </property>
40 <property stdset="1">
41 <name>sizeGripEnabled</name>
42 <bool>true</bool>
43 </property>
44 <property>
45 <name>layoutMargin</name>
46 </property>
47 <property>
48 <name>layoutSpacing</name>
49 </property>
50 <vbox>
51 <property stdset="1">
52 <name>margin</name>
53 <number>5</number>
54 </property>
55 <property stdset="1">
56 <name>spacing</name>
57 <number>2</number>
58 </property>
59 <widget>
60 <class>QComboBox</class>
61 <item>
62 <property>
63 <name>text</name>
64 <string>All dictionaries</string>
65 </property>
66 </item>
67 <item>
68 <property>
69 <name>text</name>
70 <string>Personal dictionary</string>
71 </property>
72 </item>
73 <item>
74 <property>
75 <name>text</name>
76 <string>System dictionary (English)</string>
77 </property>
78 </item>
79 <property stdset="1">
80 <name>name</name>
81 <cstring>dictionary_choice</cstring>
82 </property>
83 <property>
84 <name>whatsThis</name>
85 <string>Selects the dictionary to manipulate.</string>
86 </property>
87 </widget>
88 <widget>
89 <class>QTabWidget</class>
90 <property stdset="1">
91 <name>name</name>
92 <cstring>tabWidget</cstring>
93 </property>
94 <property>
95 <name>layoutMargin</name>
96 </property>
97 <widget>
98 <class>QWidget</class>
99 <property stdset="1">
100 <name>name</name>
101 <cstring>Widget4</cstring>
102 </property>
103 <attribute>
104 <name>title</name>
105 <string>Search</string>
106 </attribute>
107 <vbox>
108 <property stdset="1">
109 <name>margin</name>
110 <number>5</number>
111 </property>
112 <property stdset="1">
113 <name>spacing</name>
114 <number>6</number>
115 </property>
116 <widget>
117 <class>QGroupBox</class>
118 <property stdset="1">
119 <name>name</name>
120 <cstring>GroupBox3</cstring>
121 </property>
122 <property stdset="1">
123 <name>title</name>
124 <string>Pattern</string>
125 </property>
126 <vbox>
127 <property stdset="1">
128 <name>margin</name>
129 <number>11</number>
130 </property>
131 <property stdset="1">
132 <name>spacing</name>
133 <number>6</number>
134 </property>
135 <widget>
136 <class>QLineEdit</class>
137 <property stdset="1">
138 <name>name</name>
139 <cstring>pattern</cstring>
140 </property>
141 <property>
142 <name>whatsThis</name>
143 <string>Enter your search pattern here. You may use &lt;big&gt;&lt;tt&gt;?&lt;/tt&gt;&lt;/big&gt; to represent any one letter, &lt;big&gt;&lt;tt&gt;*&lt;/tt&gt;&lt;/big&gt; to represent zero or more arbitrary letters, or &lt;big&gt;&lt;tt&gt;[&lt;i&gt;abc&lt;/i&gt;]&lt;/tt&gt;&lt;/big&gt; to represent any one of the letters &lt;big&gt;&lt;tt&gt;&lt;i&gt;abc&lt;/i&gt;&lt;/tt&gt;&lt;/big&gt;.</string>
144 </property>
145 </widget>
146 </vbox>
147 </widget>
148 <widget>
149 <class>QGroupBox</class>
150 <property stdset="1">
151 <name>name</name>
152 <cstring>GroupBox4</cstring>
153 </property>
154 <property stdset="1">
155 <name>title</name>
156 <string>Matches</string>
157 </property>
158 <vbox>
159 <property stdset="1">
160 <name>margin</name>
161 <number>11</number>
162 </property>
163 <property stdset="1">
164 <name>spacing</name>
165 <number>6</number>
166 </property>
167 <widget>
168 <class>QListBox</class>
169 <property stdset="1">
170 <name>name</name>
171 <cstring>output</cstring>
172 </property>
173 </widget>
174 </vbox>
175 </widget>
176 </vbox>
177 </widget>
178 <widget>
179 <class>QWidget</class>
180 <property stdset="1">
181 <name>name</name>
182 <cstring>Widget5</cstring>
183 </property>
184 <attribute>
185 <name>title</name>
186 <string>Pickboard</string>
187 </attribute>
188 <vbox>
189 <property stdset="1">
190 <name>margin</name>
191 <number>5</number>
192 </property>
193 <property stdset="1">
194 <name>spacing</name>
195 <number>6</number>
196 </property>
197 <widget>
198 <class>QGroupBox</class>
199 <property stdset="1">
200 <name>name</name>
201 <cstring>GroupBox1</cstring>
202 </property>
203 <property stdset="1">
204 <name>title</name>
205 <string>Letter sets</string>
206 </property>
207 <vbox>
208 <property stdset="1">
209 <name>margin</name>
210 <number>11</number>
211 </property>
212 <property stdset="1">
213 <name>spacing</name>
214 <number>6</number>
215 </property>
216 <widget>
217 <class>QLineEdit</class>
218 <property stdset="1">
219 <name>name</name>
220 <cstring>sets</cstring>
221 </property>
222 <property>
223 <name>whatsThis</name>
224 <string>Enter sets of letters here, seperated by spaces in the same way as the sets of letters appear at the bottom of the Pickboard. The list below will show the largest sets of words that could be typed ambiguously. This information helps you tune the letter sets for your dictionary.</string>
225 </property>
226 </widget>
227 </vbox>
228 </widget>
229 <widget>
230 <class>QGroupBox</class>
231 <property stdset="1">
232 <name>name</name>
233 <cstring>GroupBox2</cstring>
234 </property>
235 <property stdset="1">
236 <name>title</name>
237 <string>Longest ambiguities</string>
238 </property>
239 <vbox>
240 <property stdset="1">
241 <name>margin</name>
242 <number>11</number>
243 </property>
244 <property stdset="1">
245 <name>spacing</name>
246 <number>6</number>
247 </property>
248 <widget>
249 <class>QListBox</class>
250 <property stdset="1">
251 <name>name</name>
252 <cstring>ambiguities</cstring>
253 </property>
254 </widget>
255 </vbox>
256 </widget>
257 </vbox>
258 </widget>
259 <widget>
260 <class>QWidget</class>
261 <property stdset="1">
262 <name>name</name>
263 <cstring>tab</cstring>
264 </property>
265 <attribute>
266 <name>title</name>
267 <string>Edit words</string>
268 </attribute>
269 <vbox>
270 <property stdset="1">
271 <name>margin</name>
272 <number>11</number>
273 </property>
274 <property stdset="1">
275 <name>spacing</name>
276 <number>6</number>
277 </property>
278 <widget>
279 <class>QLineEdit</class>
280 <property stdset="1">
281 <name>name</name>
282 <cstring>word</cstring>
283 </property>
284 </widget>
285 <widget>
286 <class>QLayoutWidget</class>
287 <property stdset="1">
288 <name>name</name>
289 <cstring>Layout3</cstring>
290 </property>
291 <hbox>
292 <property stdset="1">
293 <name>margin</name>
294 <number>0</number>
295 </property>
296 <property stdset="1">
297 <name>spacing</name>
298 <number>6</number>
299 </property>
300 <widget>
301 <class>QPushButton</class>
302 <property stdset="1">
303 <name>name</name>
304 <cstring>add</cstring>
305 </property>
306 <property stdset="1">
307 <name>text</name>
308 <string>Add</string>
309 </property>
310 </widget>
311 <widget>
312 <class>QPushButton</class>
313 <property stdset="1">
314 <name>name</name>
315 <cstring>remove</cstring>
316 </property>
317 <property stdset="1">
318 <name>text</name>
319 <string>Remove</string>
320 </property>
321 </widget>
322 </hbox>
323 </widget>
324 <widget>
325 <class>QLabel</class>
326 <property stdset="1">
327 <name>name</name>
328 <cstring>readonly_message</cstring>
329 </property>
330 <property stdset="1">
331 <name>text</name>
332 <string>This dictionary is read-only.</string>
333 </property>
334 <property stdset="1">
335 <name>alignment</name>
336 <set>AlignCenter</set>
337 </property>
338 <property>
339 <name>hAlign</name>
340 </property>
341 </widget>
342 <spacer>
343 <property>
344 <name>name</name>
345 <cstring>Spacer1</cstring>
346 </property>
347 <property stdset="1">
348 <name>orientation</name>
349 <enum>Vertical</enum>
350 </property>
351 <property stdset="1">
352 <name>sizeType</name>
353 <enum>Expanding</enum>
354 </property>
355 <property>
356 <name>sizeHint</name>
357 <size>
358 <width>20</width>
359 <height>20</height>
360 </size>
361 </property>
362 <property>
363 <name>sizeHint</name>
364 <size>
365 <width>20</width>
366 <height>20</height>
367 </size>
368 </property>
369 </spacer>
370 </vbox>
371 </widget>
372 </widget>
373 </vbox>
374</widget>
375<connections>
376 <connection>
377 <sender>pattern</sender>
378 <signal>textChanged(const QString&amp;)</signal>
379 <receiver>dicttoolbase</receiver>
380 <slot>setPattern(const QString&amp;)</slot>
381 </connection>
382 <connection>
383 <sender>dictionary_choice</sender>
384 <signal>activated(int)</signal>
385 <receiver>dicttoolbase</receiver>
386 <slot>setDictionary(int)</slot>
387 </connection>
388 <connection>
389 <sender>sets</sender>
390 <signal>textChanged(const QString&amp;)</signal>
391 <receiver>dicttoolbase</receiver>
392 <slot>setPickboardSet(const QString&amp;)</slot>
393 </connection>
394 <connection>
395 <sender>add</sender>
396 <signal>clicked()</signal>
397 <receiver>dicttoolbase</receiver>
398 <slot>addWord()</slot>
399 </connection>
400 <connection>
401 <sender>remove</sender>
402 <signal>clicked()</signal>
403 <receiver>dicttoolbase</receiver>
404 <slot>removeWord()</slot>
405 </connection>
406 <slot access="protected">addWord()</slot>
407 <slot access="protected">removeWord()</slot>
408 <slot access="public">setDictionary(int)</slot>
409 <slot access="public">setPattern(const QString&amp;)</slot>
410 <slot access="public">setPickboardSet(const QString&amp;)</slot>
411</connections>
412</UI>
diff --git a/noncore/apps/dictionary/main.cpp b/noncore/apps/dictionary/main.cpp
new file mode 100644
index 0000000..7e9d8c1
--- a/dev/null
+++ b/noncore/apps/dictionary/main.cpp
@@ -0,0 +1,31 @@
1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3**
4** This file is part of Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20#include <qpeapplication.h>
21#include "dicttool.h"
22
23main(int argc, char** argv)
24{
25 QPEApplication a(argc,argv);
26
27 DictTool m;
28 a.showMainWidget(&m);
29
30 return a.exec();
31}