koshell

koshell_shell.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
00003    Copyright (C) 1999 Simon Hausmann <hausmann@kde.org>
00004    Copyright (C) 2000-2005 David Faure <faure@kde.org>
00005    Copyright (C) 2005 Sven Lüppken <sven@kde.org>
00006 
00007    This program is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU General Public
00009    License as published by the Free Software Foundation; either
00010    version 2 of the License, or (at your option) any later version.
00011 
00012    This program is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     General Public License for more details.
00016 
00017    You should have received a copy of the GNU General Public License
00018    along with this program; see the file COPYING.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020  * Boston, MA 02110-1301, USA.
00021 */
00022 #ifndef __koshell_window_h__
00023 #define __koshell_window_h__
00024 
00025 #include <KoMainWindow.h>
00026 #include <KoQueryTrader.h>
00027 #include <ktabwidget.h>
00028 #include <qptrlist.h>
00029 #include <qmap.h>
00030 #include <qtoolbutton.h>
00031 #include <qvaluelist.h>
00032 
00033 #include "iconsidepane.h"
00034 
00035 class QVBox;
00036 class QIconView;
00037 class QIconViewItem;
00038 class QSplitter;
00039 class KoDocumentEntry;
00040 class KoView;
00041 class KoShellGUIClient;
00042 
00044 
00045 class KoShellWindow : public KoMainWindow
00046 {
00047   Q_OBJECT
00048 
00049 public:
00050 
00051   KoShellWindow();
00052   virtual ~KoShellWindow();
00053 
00054   virtual void setRootDocument( KoDocument *doc );
00059   virtual void updateCaption();
00060 
00061   virtual QString configFile() const;
00062 
00063   KAction *mnuSaveAll;
00064   KAction* partSpecificHelpAction;
00065 
00066 protected slots:
00067 
00068   virtual void slotFileNew();
00069   virtual void slotFileClose();
00070   virtual void slotFileOpen();
00071   void saveAll();
00072 
00073   void showPartSpecificHelp();
00074 
00075   void slotSidebar_Part(int);
00076   void slotSidebar_Document(int);
00077   void tab_contextMenu(QWidget * ,const QPoint &);
00078 
00082   void slotShowSidebar();
00088   void slotSidebarItemClicked( QIconViewItem *item );
00089   void slotKSLoadCompleted();
00090   void slotKSLoadCanceled (const QString &);
00091   void slotNewDocumentName();
00098   void slotUpdatePart( QWidget* widget );
00099 
00100 private:
00101 
00102   struct Page
00103   {
00104     KoDocument *m_pDoc;
00105     KoView *m_pView;
00106     int m_id;
00107   };
00108 
00109   virtual bool queryClose();
00110   virtual bool openDocumentInternal( const KURL & url, KoDocument * newdoc = 0L );
00111   virtual void slotConfigureKeys();
00112   void closeDocument();
00113   void saveSettings();
00114   void switchToPage( QValueList<Page>::Iterator it );
00115 
00116 
00117   QValueList<Page> m_lstPages;
00118   QValueList<Page>::Iterator m_activePage;
00119 
00120   IconSidePane *m_pSidebar;
00121   QLabel *m_pComponentsLabel;
00122   QSplitter *m_pLayout;
00123   KTabWidget *m_pFrame;
00124   QToolButton *m_tabCloseButton;
00125 
00126   // Map of available parts (the int is the koolbar item id)
00127   QMap<int,KoDocumentEntry> m_mapComponents;
00128 
00129   // Saved between openDocument and setRootDocument
00130   KoDocumentEntry m_documentEntry;
00131 
00132   KoShellGUIClient *m_client;
00133   void createShellGUI( bool create = true );
00134 
00135   int m_grpFile; //the ID number for the component group in the side bar
00136   int m_grpDocuments; //the ID number for the docuemnt group in the side bar
00137 };
00138 
00140 
00141 class KoShellGUIClient : public KXMLGUIClient
00142 {
00143 public:
00144   KoShellGUIClient( KoShellWindow *window );
00145 };
00146 
00147 #endif // __koshell_window_h__
00148 
KDE Home | KDE Accessibility Home | Description of Access Keys