SVN_SILENT made messages (.desktop file)
[kdeaccessibility.git] / kmouth / kmouth.h
blob33c29c3ab966101f2c513845fb482a9788c1fbb7
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
23 #include <QtGui/QPrinter>
25 // include files for KDE
26 #include <kxmlguiwindow.h>
27 #include <kaction.h>
28 #include <kurl.h>
29 #include <kconfig.h>
30 #include <ksharedconfig.h>
32 // forward declaration of the KMouth classes
33 class PhraseList;
34 class OptionsDialog;
35 class TextToSpeechSystem;
36 class PhraseBook;
37 class KToggleAction;
38 class KActionCollection;
39 /**
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
42 * and statusbar.
43 * KMouthApp reimplements the methods that KXmlGuiWindow provides for main window handling and supports
44 * full session management as well as using KActions.
45 * @see KXmlGuiWindow
46 * @see KApplication
47 * @see KConfig
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
54 Q_OBJECT
56 public:
57 /** construtor of KMouthApp, calls all init functions to create the application.
59 explicit KMouthApp(QWidget* parent=0, const char* name=0);
60 ~KMouthApp();
61 /** Returns true if the configuration wizard was not needed or when it
62 * was successfully completed.
64 bool configured();
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);
76 protected:
77 /** save general Options like all bar positions and status as well as the geometry and the recent file list to the configuration
78 * file
80 void saveOptions();
81 /** read general Options again and initialize all variables like the recent file list
83 void readOptions();
84 /** initializes the phrase list */
85 void initPhraseList();
86 /** initializes the KActions of the application */
87 void initActions();
88 /** sets up the statusbar for the main window by initialzing a statuslabel.
90 void initStatusBar();
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
100 * properties.
101 * @see KTMainWindow#queryExit
102 * @see KTMainWindow#closeEvent
104 virtual bool queryExit();
106 public slots:
107 /** open a file and load it into the history */
108 void slotFileOpen();
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.
116 void slotFileQuit();
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);
146 private:
147 bool isConfigured;
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
156 QAction* fileOpen;
157 QAction* fileSaveAs;
158 QAction* filePrint;
159 QAction* fileQuit;
161 QAction* editCut;
162 QAction* editCopy;
163 QAction* editPaste;
164 QAction* editSpeak;
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
183 QPrinter *printer;
186 #endif // KMOUTH_H