A few new icons...
[kdeaccessibility.git] / kmouth / kmouth.h
blob6ff6badb0f84ff41c040341a35a6118238f1d2bf
1 /***************************************************************************
2 kmouth.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 ***************************************************************************/
19 #ifndef KMOUTH_H
20 #define KMOUTH_H
23 #ifdef HAVE_CONFIG_H
24 #include <config.h>
25 #endif
27 // include files for Qt
29 // include files for KDE
30 #include <kapplication.h>
31 #include <kmainwindow.h>
32 #include <kaccel.h>
33 #include <kaction.h>
34 #include <kurl.h>
36 // forward declaration of the KMouth classes
37 class PhraseList;
38 class OptionsDialog;
39 class TextToSpeechSystem;
40 class PhraseBookDialog;
41 class PhraseBook;
43 /**
44 * The base class for KMouth application windows. It sets up the main
45 * window and reads the config file as well as providing a menubar, toolbar
46 * and statusbar.
47 * KMouthApp reimplements the methods that KMainWindow provides for main window handling and supports
48 * full session management as well as using KActions.
49 * @see KMainWindow
50 * @see KApplication
51 * @see KConfig
53 * @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team.
54 * @version KDevelop version 1.2 code generation
56 class KMouthApp : public KMainWindow
58 Q_OBJECT
60 public:
61 /** construtor of KMouthApp, calls all init functions to create the application.
63 KMouthApp(QWidget* parent=0, const char* name=0);
64 ~KMouthApp();
65 /** Returns true if the configuration wizard was not needed or when it
66 * was successfully completed.
68 bool configured();
69 /** opens a file specified by commandline option
71 void openDocumentFile(const KURL& url=KURL());
73 TextToSpeechSystem *getTTSSystem() const;
75 /** called by PhraseList in order to enable or disable the actions depending
76 * on the contents of the phrase list.
78 void enableMenuEntries(bool existSelectedEntries, bool existDeselectedEntries);
80 protected:
81 /** save general Options like all bar positions and status as well as the geometry and the recent file list to the configuration
82 * file
84 void saveOptions();
85 /** read general Options again and initialize all variables like the recent file list
87 void readOptions();
88 /** initializes the phrase list */
89 void initPhraseList();
90 /** initializes the KActions of the application */
91 void initActions();
92 /** sets up the statusbar for the main window by initialzing a statuslabel.
94 void initStatusBar();
95 /** queryClose is called by KTMainWindow on each closeEvent of a window. Against the
96 * default implementation (only returns true), this calles saveModified() on the document object to ask if the document shall
97 * be saved if Modified; on cancel the closeEvent is rejected.
98 * @see KTMainWindow#queryClose
99 * @see KTMainWindow#closeEvent
101 virtual bool queryClose();
102 /** queryExit is called by KTMainWindow when the last window of the application is going to be closed during the closeEvent().
103 * Against the default implementation that just returns true, this calls saveOptions() to save the settings of the last window's
104 * properties.
105 * @see KTMainWindow#queryExit
106 * @see KTMainWindow#closeEvent
108 virtual bool queryExit();
110 public slots:
111 /** open a file and load it into the history */
112 void slotFileOpen();
113 /** save a document */
114 void slotFileSaveAs();
115 /** print the actual file */
116 void slotFilePrint();
117 /** closes all open windows by calling close() on each memberList item until the list is empty, then quits the application.
118 * If queryClose() returns false because the user canceled the saveModified() dialog, the closing breaks.
120 void slotFileQuit();
121 /** edits the phrase books
123 void slotEditPhrasebook ();
124 /** toggles the menu bar
126 void slotViewMenuBar();
127 /** toggles the toolbar
129 void slotViewToolBar();
130 /** toggles the phrasebook bar
132 void slotViewPhrasebookBar();
133 /** toggles the statusbar
135 void slotViewStatusBar();
136 /** configures the TTS system
138 void slotConfigureTTS();
139 /** changes the statusbar contents for the standard label permanently, used to indicate current actions.
140 * @param text the text that is displayed in the statusbar
142 void slotStatusMsg(const QString &text);
144 void slotPhrasebookConfirmed (PhraseBook &book);
146 void slotConfigurationChanged();
148 void slotPhraseSelected (const QString &phrase);
150 private:
151 bool isConfigured;
152 /** the configuration object of the application */
153 KConfig *config;
154 /** The phrase list */
155 PhraseList *phraseList;
156 /** The configuration dialog */
157 OptionsDialog *optionsDialog;
159 // KAction pointers to enable/disable actions
160 KAction* fileOpen;
161 KAction* fileSaveAs;
162 KAction* filePrint;
163 KAction* fileQuit;
165 KAction* editCut;
166 KAction* editCopy;
167 KAction* editPaste;
168 KAction* editSpeak;
170 KActionCollection *phrases;
171 KAction* phrasebookEdit;
173 KToggleAction* viewMenuBar;
174 KToggleAction* viewToolBar;
175 KToggleAction* viewPhrasebookBar;
176 KToggleAction* viewStatusBar;
177 KAction* configureTTS;
179 KAction* phraseListSpeak;
180 KAction* phraseListRemove;
181 KAction* phraseListCut;
182 KAction* phraseListCopy;
183 KAction* phraselistSelectAll;
184 KAction* phraselistDeselectAll;
187 #endif // KMOUTH_H