21 #ifndef __KATE_MDI_H__
22 #define __KATE_MDI_H__
24 #include <tdeparts/mainwindow.h>
26 #include <tdemultitabbar.h>
27 #include <kxmlguiclient.h>
28 #include <tdeaction.h>
31 #include <tqintdict.h>
33 #include <tqsplitter.h>
35 #include <tqptrlist.h>
47 Splitter(Orientation o, TQWidget* parent=0,
const char* name=0);
58 int idAfter ( TQWidget * w )
const;
61 class ToggleToolViewAction :
public TDEToggleAction
67 ToggleToolViewAction (
const TQString& text,
const TDEShortcut& cut,
68 class ToolView *tv, TQObject* parent = 0,
const char* name = 0 );
70 virtual ~ToggleToolViewAction();
73 void slotToggled(
bool);
74 void visibleChanged(
bool);
80 class GUIClient :
public TQObject,
public KXMLGUIClient
86 GUIClient (
class MainWindow *mw );
89 void registerToolView (ToolView *tv);
90 void unregisterToolView (ToolView *tv);
91 void updateSidebarsVisibleAction();
94 void clientAdded( KXMLGUIClient *client );
99 TDEToggleAction *m_showSidebarsAction;
100 TQPtrList<TDEAction> m_toolViewActions;
101 TQMap<ToolView*, TDEAction*> m_toolToAction;
102 TDEActionMenu *m_toolMenu;
105 class ToolView :
public TQVBox
110 friend class Sidebar;
111 friend class MainWindow;
112 friend class GUIClient;
113 friend class ToggleToolViewAction;
125 ToolView (
class MainWindow *mainwin,
class Sidebar *sidebar, TQWidget *parent);
132 virtual ~ToolView ();
139 void visibleChanged (
bool visible);
145 MainWindow *mainWindow () {
return m_mainWin; }
147 Sidebar *sidebar () {
return m_sidebar; }
149 void setVisible (
bool vis);
152 bool visible ()
const;
155 void childEvent ( TQChildEvent *ev );
158 MainWindow *m_mainWin;
180 class Sidebar :
public KMultiTabBar
186 Sidebar (KMultiTabBar::KMultiTabBarPosition pos,
class MainWindow *mainwin, TQWidget *parent);
189 void setSplitter (Splitter *sp);
192 ToolView *addWidget (
const TQPixmap &icon,
const TQString &text, ToolView *widget);
193 bool removeWidget (ToolView *widget);
195 bool showWidget (ToolView *widget);
196 bool hideWidget (ToolView *widget);
198 void setLastSize (
int s) { m_lastSize = s; }
199 int lastSize ()
const {
return m_lastSize; }
200 void updateLastSize ();
202 bool splitterVisible ()
const {
return m_ownSplit->isVisible(); }
204 void restoreSession ();
210 void restoreSession (TDEConfig *config);
216 void saveSession (TDEConfig *config);
224 void tabClicked(
int);
227 bool eventFilter(TQObject *obj, TQEvent *ev);
230 void buttonPopupActivate (
int id);
233 MainWindow *m_mainWin;
235 KMultiTabBar::KMultiTabBarPosition m_pos;
236 Splitter *m_splitter;
237 KMultiTabBar *m_tabBar;
238 Splitter *m_ownSplit;
240 TQIntDict<ToolView> m_idToWidget;
241 TQMap<ToolView*, int> m_widgetToId;
246 TQValueList<ToolView*> m_toolviews;
253 class MainWindow :
public KParts::MainWindow
258 friend class ToolView;
267 MainWindow (TQWidget* parentWidget = 0,
const char* name = 0);
272 virtual ~MainWindow ();
284 TQWidget *centralWidget ()
const;
294 ToolView *createToolView (
const TQString &identifier, KMultiTabBar::KMultiTabBarPosition pos,
const TQPixmap &icon,
const TQString &text);
301 ToolView *toolView (
const TQString &identifier)
const;
307 void setToolViewStyle (KMultiTabBar::KMultiTabBarStyle style);
314 KMultiTabBar::KMultiTabBarStyle toolViewStyle ()
const;
320 bool sidebarsVisible()
const;
329 void setSidebarsVisible(
bool visible );
336 void toolViewDeleted (ToolView *widget);
348 bool moveToolView (ToolView *widget, KMultiTabBar::KMultiTabBarPosition pos);
355 bool showToolView (ToolView *widget);
362 bool hideToolView (ToolView *widget);
373 void startRestore (TDEConfig *config,
const TQString &group);
378 void finishRestore ();
385 void saveSession (TDEConfig *config,
const TQString &group);
394 TQDict<ToolView> m_idToWidget;
399 TQValueList<ToolView*> m_toolviews;
405 TQWidget *m_centralWidget;
410 Splitter *m_hSplitter;
415 Splitter *m_vSplitter;
420 Sidebar *m_sidebars[4];
425 bool m_sidebarsVisible;
431 TDEConfig *m_restoreConfig;
436 TQString m_restoreGroup;
441 GUIClient *m_guiClient;
This class is needed because TQSplitter cant return an index for a widget.
bool isLastChild(TQWidget *w) const
Since there is supposed to be only 2 childs of a katesplitter, any child other than the last is the f...