SVN_SILENT made messages (.desktop file)
[kdeaccessibility.git] / kmouth / phraselist.h
bloba8312201d91f331fc256e241f2d2117b4ed921a9
1 /***************************************************************************
2 phraselist.h - description
3 -------------------
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 /***************************************************************************
10 * *
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. *
15 * *
16 ***************************************************************************/
18 #ifndef PHRASELIST_H
19 #define PHRASELIST_H
21 // include files for KDE
22 #include <k3listbox.h>
23 #include <klineedit.h>
24 #include <kconfig.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>
33 class WordCompletion;
35 /**
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 {
45 Q_OBJECT
46 public:
47 PhraseList(QWidget *parent=0, const char *name=0);
48 ~PhraseList();
50 /** contains the implementation for printing functionality */
51 void print(QPrinter *pPrinter);
53 QStringList getListSelection();
55 bool existListSelection();
56 bool existEditSelection();
58 public slots:
59 /** Called whenever the user wants the contents of the edit line to be spoken. */
60 void speak ();
62 void cut();
63 void copy();
64 void paste();
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 ();
76 void save ();
77 void open ();
78 void open (KUrl url);
80 void selectAllEntries ();
81 void deselectAllEntries ();
83 void configureCompletion();
84 void saveWordCompletion();
85 void saveCompletionOptions(KConfig *config);
86 void readCompletionOptions(KConfig *config);
88 protected slots:
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);
96 private:
97 K3ListBox *listBox;
98 KComboBox *dictionaryCombo;
99 KLineEdit *lineEdit;
100 QPushButton *speakButton;
101 QString line;
102 WordCompletion *completion;
104 bool isInSlot;
106 void speakPhrase (const QString &phrase);
107 void setEditLineText(const QString &s);
108 void insertIntoPhraseList (const QString &phrase, bool clearEditLine);
110 void enableMenuEntries ();
113 #endif