lib Library API Documentation

koMainWindow.h

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., 59 Temple Place - Suite 330,
00018    Boston, MA 02111-1307, 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 class QLabel;
00028 class KoDocument;
00029 class KoView;
00030 class KoMainWindowPrivate;
00031 class KURL;
00032 class KRecentFilesAction;
00033 class KoFilterManager;
00034 class DCOPObject;
00035 
00036 namespace KParts
00037 {
00038   class PartManager;
00039 }
00040 
00050 class KOFFICECORE_EXPORT KoMainWindow : public KParts::MainWindow
00051 {
00052     Q_OBJECT
00053 public:
00054 
00060     KoMainWindow( KInstance *instance, const char *_name = 0 );
00061 
00065     ~KoMainWindow();
00066 
00071     virtual void setRootDocument( KoDocument *doc );
00072 
00077     virtual void updateCaption();
00078 
00082     virtual KoDocument* rootDocument() const;
00083 
00084     virtual KoView *rootView() const;
00085 
00086     virtual KParts::PartManager *partManager();
00087 
00092     void print(bool quick);
00093 
00098     void showToolbar( const char * tbName, bool shown );
00099 
00103     bool toolbarIsVisible(const char *tbName);
00104 
00109     QLabel * statusBarLabel();
00110 
00114     void setMaxRecentItems(uint _number);
00115 
00119     void addRecentURL( const KURL& url );
00120 
00127     virtual bool openDocument( const KURL & url );
00128 
00134     bool openDocument( KoDocument *newdoc, const KURL & url );
00135 
00136     virtual DCOPObject * dcopObject();
00137 
00141     void reloadRecentFileList();
00142 
00146     virtual void updateCaption( const QString caption, bool mod );
00147     void updateReloadFileAction(KoDocument *doc);
00148     void updateVersionsFileAction(KoDocument *doc);
00149 
00150 signals:
00154     void documentSaved();
00156     void saveDialogShown();
00157 
00158 public slots:
00159 
00166     void slotEmailFile();
00167 
00174     virtual void slotFileNew();
00175 
00182     virtual void slotFileOpen();
00183 
00190     virtual void slotFileOpenRecent( const KURL & );
00191 
00195     virtual void slotFileSave();
00196 
00200     virtual void slotFileSaveAs();
00201 
00205     virtual void slotFilePrint();
00206 
00210     void slotFilePrintPreview(); // make virtual later
00211 
00215     virtual void slotDocumentInfo();
00216 
00220     virtual void slotFileClose();
00221 
00225     virtual void slotFileQuit();
00226 
00230     virtual void slotConfigureKeys();
00231 
00235     virtual void slotConfigureToolbars();
00236 
00241     virtual void slotNewToolbarConfig();
00242 
00246     virtual void slotToolbarToggled( bool toggle );
00247 
00251     virtual void slotSplitView();
00252     virtual void slotRemoveView();
00253     virtual void slotSetOrientation();
00254 
00258     virtual void slotCloseAllViews();
00259 
00263     void slotReloadFile();
00264 
00268     void slotVersionsFile();
00269 
00276     void slotImportFile();
00277 
00284     void slotExportFile();
00285 
00286 protected: // protected methods are mostly for koshell, it's the only one deriving from KoMainWindow
00287 
00289     void chooseNewDocument( int /*KoDocument::InitDocFlags*/ initDocFlags );
00294     void setRootDocumentDirect( KoDocument *doc, const QPtrList<KoView> & views );
00295 
00299     virtual KoDocument* createDoc() const;
00300 
00312     virtual bool saveDocument( bool saveas = false, bool silent = false );
00313 
00314     virtual void closeEvent( QCloseEvent * e );
00315     virtual void resizeEvent( QResizeEvent * e );
00316 
00320     virtual bool queryClose();
00321 
00322     virtual bool openDocumentInternal( const KURL & url, KoDocument * newdoc = 0L );
00323 
00332     bool isExporting() const;
00333 
00342     bool isImporting() const;
00343 
00347     void saveRecentFiles();
00348 
00349     KRecentFilesAction *recentAction() const { return m_recent; }
00350 
00351 private:
00352 
00359     bool exportConfirmation( const QCString &outputFormat );
00360 
00361     void saveWindowSettings();
00362 
00363     KRecentFilesAction *m_recent;
00364 
00365 protected slots:
00366     virtual void slotActivePartChanged( KParts::Part *newPart );
00367 
00368 private slots:
00369     void slotProgress(int value);
00370     void slotLoadCompleted();
00371     void slotLoadCanceled (const QString &);
00372     void slotSaveCompleted();
00373     void slotSaveCanceled(const QString &);
00374 
00375 private:
00376     KoMainWindowPrivate *d;
00377 
00378 };
00379 
00380 #endif
KDE Logo
This file is part of the documentation for lib Library Version 1.4.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Feb 13 09:40:02 2006 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003