koshell

koshell_shell.h
1/* This file is part of the KDE project
2 Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 Copyright (C) 1999 Simon Hausmann <hausmann@kde.org>
4 Copyright (C) 2000-2005 David Faure <faure@kde.org>
5 Copyright (C) 2005 Sven Lüppken <sven@kde.org>
6
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public
9 License as published by the Free Software Foundation; either
10 version 2 of the License, or (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; see the file COPYING. If not, write to
19 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20 * Boston, MA 02110-1301, USA.
21*/
22#ifndef __koshell_window_h__
23#define __koshell_window_h__
24
25#include <KoMainWindow.h>
26#include <KoQueryTrader.h>
27#include <ktabwidget.h>
28#include <tqptrlist.h>
29#include <tqmap.h>
30#include <tqtoolbutton.h>
31#include <tqvaluelist.h>
32
33#include "iconsidepane.h"
34
35class TQVBox;
36class TQIconView;
37class TQIconViewItem;
38class TQSplitter;
39class KoDocumentEntry;
40class KoView;
41class KoShellGUIClient;
42
44
45class KoShellWindow : public KoMainWindow
46{
47 TQ_OBJECT
48
49
50public:
51
52 KoShellWindow();
53 virtual ~KoShellWindow();
54
55 virtual void setRootDocument( KoDocument *doc );
60 virtual void updateCaption();
61
62 virtual TQString configFile() const;
63
64 TDEAction *mnuSaveAll;
65 TDEAction* partSpecificHelpAction;
66
67protected slots:
68
69 virtual void slotFileNew();
70 virtual void slotFileClose();
71 virtual void slotFileOpen();
72 void saveAll();
73
74 void showPartSpecificHelp();
75
76 void slotSidebar_Part(int);
77 void slotSidebar_Document(int);
78 void tab_contextMenu(TQWidget * ,const TQPoint &);
79
83 void slotShowSidebar();
89 void slotSidebarItemClicked( TQIconViewItem *item );
90 void slotKSLoadCompleted();
91 void slotKSLoadCanceled (const TQString &);
92 void slotNewDocumentName();
99 void slotUpdatePart( TQWidget* widget );
100
101private:
102
103 struct Page
104 {
105 KoDocument *m_pDoc;
106 KoView *m_pView;
107 int m_id;
108 };
109
110 virtual bool queryClose();
111 virtual bool openDocumentInternal( const KURL & url, KoDocument * newdoc = 0L );
112 virtual void slotConfigureKeys();
113 void closeDocument();
114 void saveSettings();
115 void switchToPage( TQValueList<Page>::Iterator it );
116
117
118 TQValueList<Page> m_lstPages;
119 TQValueList<Page>::Iterator m_activePage;
120
121 IconSidePane *m_pSidebar;
122 TQLabel *m_pComponentsLabel;
123 TQSplitter *m_pLayout;
124 KTabWidget *m_pFrame;
125 TQToolButton *m_tabCloseButton;
126
127 // Map of available parts (the int is the koolbar item id)
128 TQMap<int,KoDocumentEntry> m_mapComponents;
129
130 // Saved between openDocument and setRootDocument
131 KoDocumentEntry m_documentEntry;
132
133 KoShellGUIClient *m_client;
134 void createShellGUI( bool create = true );
135
136 int m_grpFile; //the ID number for the component group in the side bar
137 int m_grpDocuments; //the ID number for the docuemnt group in the side bar
138};
139
141
142class KoShellGUIClient : public KXMLGUIClient
143{
144public:
145 KoShellGUIClient( KoShellWindow *window );
146};
147
148#endif // __koshell_window_h__
149