F:/KPlato/koffice/libs/kofficecore/KoMainWindow.h

Aller à la documentation de ce fichier.
00001 /* This file is part of the KDE project
00002    Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
00003    Copyright (C) 2000-2004 David Faure <faure@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
00019 */
00020 
00021 #ifndef __ko_main_window_h__
00022 #define __ko_main_window_h__
00023 
00024 #include <kparts/mainwindow.h>
00025 #include <kfiledialog.h>
00026 #include <koffice_export.h>
00027 #include "KoDocument.h"
00028 #include <krecentfilesaction.h>
00029 #include <ktoggleaction.h>
00030 #include <QLabel>
00031 #include <QResizeEvent>
00032 #include <Q3PtrList>
00033 #include <QCloseEvent>
00034 
00035 class QLabel;
00036 class KoView;
00037 class KoMainWindowPrivate;
00038 class KUrl;
00039 class KRecentFilesAction;
00040 class KoFilterManager;
00041 // class DCOPObject;
00042 class QDockWidget;
00043 class KoDockFactory;
00044 
00045 namespace KParts
00046 {
00047   class PartManager;
00048 }
00049 
00059 class KOFFICECORE_EXPORT KoMainWindow : public KParts::MainWindow
00060 {
00061     Q_OBJECT
00062 public:
00063 
00069     KoMainWindow( KInstance *instance );
00070 
00074     ~KoMainWindow();
00075 
00080     virtual void setRootDocument( KoDocument *doc );
00081 
00086     void setDocToOpen( KoDocument *doc );
00087 
00092     virtual void updateCaption();
00093 
00097     virtual KoDocument* rootDocument() const;
00098 
00099     virtual KoView *rootView() const;
00100 
00101     virtual KParts::PartManager *partManager();
00102 
00107     void print(bool quick);
00108 
00113     void showToolbar( const char * tbName, bool shown );
00114 
00118     bool toolbarIsVisible(const char *tbName);
00119 
00124     QLabel * statusBarLabel();
00125 
00129     void setMaxRecentItems(uint _number);
00130 
00134     void addRecentURL( const KUrl& url );
00135 
00142     virtual bool openDocument( const KUrl & url );
00143 
00149     bool openDocument( KoDocument *newdoc, const KUrl & url );
00150 
00151 //     virtual DCOPObject * dcopObject();
00152 
00156     void reloadRecentFileList();
00157 
00161     virtual void updateCaption( const QString & caption, bool mod );
00162     void updateReloadFileAction(KoDocument *doc);
00163     void updateVersionsFileAction(KoDocument *doc);
00164 
00165     void setReadWrite( bool readwrite );
00166 
00167     QDockWidget* createDockWidget(KoDockFactory* factory);
00168 
00169 signals:
00173     void documentSaved();
00175     void saveDialogShown();
00176 
00177 public slots:
00178 
00185     void slotEmailFile();
00186 
00193     virtual void slotFileNew();
00194 
00201     virtual void slotFileOpen();
00202 
00209     virtual void slotFileOpenRecent( const KUrl & );
00210 
00214     virtual void slotFileSave();
00215 
00219     virtual void slotFileSaveAs();
00220 
00224     virtual void slotFilePrint();
00225 
00229     void slotFilePrintPreview(); // make virtual later
00230 
00234     virtual void slotDocumentInfo();
00235 
00239     virtual void slotFileClose();
00240 
00244     virtual void slotFileQuit();
00245 
00249     virtual void slotConfigureKeys();
00250 
00254     virtual void slotConfigureToolbars();
00255 
00260     virtual void slotNewToolbarConfig();
00261 
00265     virtual void slotToolbarToggled( bool toggle );
00266 
00270     virtual void slotSplitView();
00271     virtual void slotRemoveView();
00272     virtual void slotSetOrientation();
00273 
00277     virtual void slotCloseAllViews();
00278 
00282     void slotReloadFile();
00283 
00287     void slotVersionsFile();
00288 
00295     void slotImportFile();
00296 
00303     void slotExportFile();
00304 
00305 protected: // protected methods are mostly for koshell, it's the only one deriving from KoMainWindow
00306 
00308     void chooseNewDocument( int /*KoDocument::InitDocFlags*/ initDocFlags );
00313     void setRootDocumentDirect( KoDocument *doc, const Q3PtrList<KoView> & views );
00314 
00318     virtual KoDocument* createDoc() const;
00319 
00331     virtual bool saveDocument( bool saveas = false, bool silent = false );
00332 
00333     virtual void closeEvent( QCloseEvent * e );
00334     virtual void resizeEvent( QResizeEvent * e );
00335 
00339     virtual bool queryClose();
00340 
00341     virtual bool openDocumentInternal( const KUrl & url, KoDocument * newdoc = 0L );
00342 
00351     bool isExporting() const;
00352 
00361     bool isImporting() const;
00362 
00366     void saveRecentFiles();
00367 
00368     KRecentFilesAction *recentAction() const { return m_recent; }
00369 
00370 private:
00371 
00378     bool exportConfirmation( const QByteArray &outputFormat );
00379 
00380     void saveWindowSettings();
00381 
00382     KRecentFilesAction *m_recent;
00383 
00384 protected slots:
00385     virtual void slotActivePartChanged( KParts::Part *newPart );
00386 
00387 private slots:
00388     void slotProgress(int value);
00389     void slotLoadCompleted();
00390     void slotLoadCanceled (const QString &);
00391     void slotSaveCompleted();
00392     void slotSaveCanceled(const QString &);
00393 
00394 private:
00395     KoMainWindowPrivate *d;
00396 
00397 };
00398 
00399 #endif

Généré le Wed Nov 22 23:41:03 2006 pour KPlato par  doxygen 1.5.1-p1