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