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 ***************************************************************************/
22 // include files for Qt
23 #include <QtGui/QPrinter>
25 // include files for KDE
26 #include <kxmlguiwindow.h>
30 #include <ksharedconfig.h>
32 // forward declaration of the KMouth classes
35 class TextToSpeechSystem
;
38 class KActionCollection
;
40 * The base class for KMouth application windows. It sets up the main
41 * window and reads the config file as well as providing a menubar, toolbar
43 * KMouthApp reimplements the methods that KXmlGuiWindow provides for main window handling and supports
44 * full session management as well as using KActions.
49 * @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team.
50 * @version KDevelop version 1.2 code generation
52 class KMouthApp
: public KXmlGuiWindow
57 /** construtor of KMouthApp, calls all init functions to create the application.
59 explicit KMouthApp(QWidget
* parent
=0, const char* name
=0);
61 /** Returns true if the configuration wizard was not needed or when it
62 * was successfully completed.
65 /** opens a file specified by commandline option
67 void openDocumentFile(const KUrl
& url
=KUrl());
69 TextToSpeechSystem
*getTTSSystem() const;
71 /** called by PhraseList in order to enable or disable the actions depending
72 * on the contents of the phrase list.
74 void enableMenuEntries(bool existSelectedEntries
, bool existDeselectedEntries
);
77 /** save general Options like all bar positions and status as well as the geometry and the recent file list to the configuration
81 /** read general Options again and initialize all variables like the recent file list
84 /** initializes the phrase list */
85 void initPhraseList();
86 /** initializes the KActions of the application */
88 /** sets up the statusbar for the main window by initialzing a statuslabel.
91 /** queryClose is called by KTMainWindow on each closeEvent of a window. Against the
92 * default implementation (only returns true), this calles saveModified() on the document object to ask if the document shall
93 * be saved if Modified; on cancel the closeEvent is rejected.
94 * @see KTMainWindow#queryClose
95 * @see KTMainWindow#closeEvent
97 virtual bool queryClose();
98 /** queryExit is called by KTMainWindow when the last window of the application is going to be closed during the closeEvent().
99 * Against the default implementation that just returns true, this calls saveOptions() to save the settings of the last window's
101 * @see KTMainWindow#queryExit
102 * @see KTMainWindow#closeEvent
104 virtual bool queryExit();
107 /** open a file and load it into the history */
109 /** save a document */
110 void slotFileSaveAs();
111 /** print the actual file */
112 void slotFilePrint();
113 /** closes all open windows by calling close() on each memberList item until the list is empty, then quits the application.
114 * If queryClose() returns false because the user canceled the saveModified() dialog, the closing breaks.
117 /** edits the phrase books
119 void slotEditPhrasebook ();
120 /** toggles the menu bar
122 void slotViewMenuBar();
123 /** toggles the toolbar
125 void slotViewToolBar();
126 /** toggles the phrasebook bar
128 void slotViewPhrasebookBar();
129 /** toggles the statusbar
131 void slotViewStatusBar();
132 /** configures the TTS system
134 void slotConfigureTTS();
135 /** changes the statusbar contents for the standard label permanently, used to indicate current actions.
136 * @param text the text that is displayed in the statusbar
138 void slotStatusMsg(const QString
&text
);
140 void slotPhrasebookConfirmed (PhraseBook
&book
);
142 void slotConfigurationChanged();
144 void slotPhraseSelected (const QString
&phrase
);
148 /** the configuration object of the application */
149 KSharedConfigPtr config
;
150 /** The phrase list */
151 PhraseList
*phraseList
;
152 /** The configuration dialog */
153 OptionsDialog
*optionsDialog
;
155 // KAction pointers to enable/disable actions
166 KActionCollection
*phrases
;
167 QAction
* phrasebookEdit
;
169 KToggleAction
* viewMenuBar
;
170 KToggleAction
* viewToolBar
;
171 KToggleAction
* viewPhrasebookBar
;
172 KToggleAction
* viewStatusBar
;
173 QAction
* configureTTS
;
175 QAction
* phraseListSpeak
;
176 QAction
* phraseListRemove
;
177 QAction
* phraseListCut
;
178 QAction
* phraseListCopy
;
179 QAction
* phraselistSelectAll
;
180 QAction
* phraselistDeselectAll
;
182 // Keep QPrinter so settings persist