1 /***************************************************************************
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 ***************************************************************************/
27 // include files for Qt
29 // include files for KDE
30 #include <kapplication.h>
31 #include <kmainwindow.h>
36 // forward declaration of the KMouth classes
39 class TextToSpeechSystem
;
40 class PhraseBookDialog
;
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
47 * KMouthApp reimplements the methods that KMainWindow provides for main window handling and supports
48 * full session management as well as using KActions.
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
61 /** construtor of KMouthApp, calls all init functions to create the application.
63 KMouthApp(QWidget
* parent
=0, const char* name
=0);
65 /** Returns true if the configuration wizard was not needed or when it
66 * was successfully completed.
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
);
81 /** save general Options like all bar positions and status as well as the geometry and the recent file list to the configuration
85 /** read general Options again and initialize all variables like the recent file list
88 /** initializes the phrase list */
89 void initPhraseList();
90 /** initializes the KActions of the application */
92 /** sets up the statusbar for the main window by initialzing a statuslabel.
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
105 * @see KTMainWindow#queryExit
106 * @see KTMainWindow#closeEvent
108 virtual bool queryExit();
111 /** open a file and load it into the history */
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.
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
);
152 /** the configuration object of the application */
154 /** The phrase list */
155 PhraseList
*phraseList
;
156 /** The configuration dialog */
157 OptionsDialog
*optionsDialog
;
159 // KAction pointers to enable/disable actions
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
;