KoMainWindow.h
1/* This file is part of the KDE project
2 Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 Copyright (C) 2000-2004 David Faure <faure@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19*/
20
21#ifndef __ko_main_window_h__
22#define __ko_main_window_h__
23
24#include <tdeparts/mainwindow.h>
25#include <tdefiledialog.h>
26#include <koffice_export.h>
27#include "KoDocument.h"
28
29class TQLabel;
30class KoView;
31class KoMainWindowPrivate;
32class KURL;
34class KoFilterManager;
35class DCOPObject;
36
37namespace KParts
38{
39 class PartManager;
40}
41
51class KOFFICECORE_EXPORT KoMainWindow : public KParts::MainWindow
52{
53 TQ_OBJECT
54
55public:
56
62 KoMainWindow( TDEInstance *instance, const char *_name = 0 );
63
68
73 virtual void setRootDocument( KoDocument *doc );
74
79 void setDocToOpen( KoDocument *doc );
80
85 virtual void updateCaption();
86
90 virtual KoDocument* rootDocument() const;
91
92 virtual KoView *rootView() const;
93
94 virtual KParts::PartManager *partManager();
95
100 void print(bool quick);
101
106 void showToolbar( const char * tbName, bool shown );
107
111 bool toolbarIsVisible(const char *tbName);
112
117 TQLabel * statusBarLabel();
118
122 void setMaxRecentItems(uint _number);
123
127 void addRecentURL( const KURL& url );
128
135 virtual bool openDocument( const KURL & url );
136
142 bool openDocument( KoDocument *newdoc, const KURL & url );
143
144 virtual DCOPObject * dcopObject();
145
149 void reloadRecentFileList();
150
154 virtual void updateCaption( const TQString caption, bool mod );
155 void updateReloadFileAction(KoDocument *doc);
156 void updateVersionsFileAction(KoDocument *doc);
157
158signals:
165
166public slots:
167
174 void slotEmailFile();
175
182 virtual void slotFileNew();
183
190 virtual void slotFileOpen();
191
198 virtual void slotFileOpenRecent( const KURL & );
199
203 virtual void slotFileSave();
204
208 virtual void slotFileSaveAs();
209
213 virtual void slotFilePrint();
214
218 void slotFilePrintPreview(); // make virtual later
219
223 virtual void slotDocumentInfo();
224
228 virtual void slotFileClose();
229
233 virtual void slotFileQuit();
234
238 virtual void slotConfigureKeys();
239
243 virtual void slotConfigureToolbars();
244
249 virtual void slotNewToolbarConfig();
250
254 virtual void slotToolbarToggled( bool toggle );
255
259 virtual void slotSplitView();
260 virtual void slotRemoveView();
261 virtual void slotSetOrientation();
262
266 virtual void slotCloseAllViews();
267
271 void slotReloadFile();
272
276 void slotVersionsFile();
277
284 void slotImportFile();
285
292 void slotExportFile();
293
294protected: // protected methods are mostly for koshell, it's the only one deriving from KoMainWindow
295
297 void chooseNewDocument( int /*KoDocument::InitDocFlags*/ initDocFlags );
302 void setRootDocumentDirect( KoDocument *doc, const TQPtrList<KoView> & views );
303
307 virtual KoDocument* createDoc() const;
308
320 virtual bool saveDocument( bool saveas = false, bool silent = false );
321
322 virtual void closeEvent( TQCloseEvent * e );
323 virtual void resizeEvent( TQResizeEvent * e );
324
328 virtual bool queryClose();
329
330 virtual bool openDocumentInternal( const KURL & url, KoDocument * newdoc = 0L );
331
340 bool isExporting() const;
341
350 bool isImporting() const;
351
355 void saveRecentFiles();
356
357 TDERecentFilesAction *recentAction() const { return m_recent; }
358
359private:
360
367 bool exportConfirmation( const TQCString &outputFormat );
368
369 void saveWindowSettings();
370
371 TDERecentFilesAction *m_recent;
372
373protected slots:
374 virtual void slotActivePartChanged( KParts::Part *newPart );
375
376private slots:
377 void slotProgress(int value);
378 void slotLoadCompleted();
379 void slotLoadCanceled (const TQString &);
380 void slotSaveCompleted();
381 void slotSaveCanceled(const TQString &);
382
383private:
384 KoMainWindowPrivate *d;
385
386};
387
388#endif
The KOffice document class.
Definition KoDocument.h:61
The class managing all the filters.
Main window for a KOffice application.
void saveDialogShown()
This signals is emmitted before the save dialog is shown.
void documentSaved()
This signal is emitted if the document has been saved successfully.
This class is used to display a KoDocument.
Definition KoView.h:58
virtual bool queryClose()
virtual void closeEvent(TQCloseEvent *)