1 /***************************************************************************
2 phraselist.h - description
4 begin : Mon Aug 26 15:41:23 CEST 2002
5 copyright : (C) 2002 by Gunnar Schmi Dt
6 email : kmouth@schmi-dt.de
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
21 // include files for KDE
22 #include <k3listbox.h>
23 #include <klineedit.h>
25 #include <kcombobox.h>
27 // include files for Qt
28 #include <QtGui/QWidget>
29 #include <QtGui/QPushButton>
30 #include <QtGui/QKeyEvent>
31 #include <QtGui/QPrinter>
36 * This class represents a phrase list. It contains methods for manipulating
37 * the phraselist and also methods for viewing the list.
38 * The phrase list consists of an edit field for entering phrases and a list
39 * box for the spoken phrases.
41 * @author Gunnar Schmi Dt
44 class PhraseList
: public QWidget
{
47 explicit PhraseList(QWidget
*parent
=0, const char *name
=0);
50 /** contains the implementation for printing functionality */
51 void print(QPrinter
*pPrinter
);
53 QStringList
getListSelection();
55 bool existListSelection();
56 bool existEditSelection();
59 /** Called whenever the user wants the contents of the edit line to be spoken. */
66 /** Insert s into the edit field. */
67 void insert (const QString
&s
);
69 /** Called whenever the user wants the selected list entries to be spoken. */
70 void speakListSelection ();
72 void removeListSelection ();
73 void cutListSelection ();
74 void copyListSelection ();
80 void selectAllEntries ();
81 void deselectAllEntries ();
83 void configureCompletion();
84 void saveWordCompletion();
85 void saveCompletionOptions(KConfig
*config
);
86 void readCompletionOptions(KConfig
*config
);
89 void lineEntered (const QString
&phrase
);
90 void contextMenuRequested (Q3ListBoxItem
*, const QPoint
&pos
);
91 void textChanged (const QString
&s
);
92 void selectionChanged ();
93 void keyPressEvent (QKeyEvent
*e
);
94 void configureCompletionCombo(const QStringList
&list
);
98 KComboBox
*dictionaryCombo
;
100 QPushButton
*speakButton
;
102 WordCompletion
*completion
;
106 void speakPhrase (const QString
&phrase
);
107 void setEditLineText(const QString
&s
);
108 void insertIntoPhraseList (const QString
&phrase
, bool clearEditLine
);
110 void enableMenuEntries ();