31 #ifndef _KMDIMAINFRM_H_ 32 #define _KMDIMAINFRM_H_ 34 #include <kparts/dockmainwindow.h> 36 #include <kpopupmenu.h> 38 #include <tqptrlist.h> 40 #include <tqapplication.h> 42 #include <tqguardedptr.h> 44 #include "kmditaskbar.h" 45 #include "kmdichildarea.h" 46 #include "kmdichildview.h" 47 #include "kmdiiterator.h" 48 #include "kmdilistiterator.h" 49 #include "kmdinulliterator.h" 50 #include "kmditoolviewaccessor.h" 64 class KMdiDockContainer;
65 class KMdiMainFrmPrivate;
245 friend class KMdiToolViewAccessor;
248 KMdi::MdiMode m_mdiMode;
251 TQPtrList<KMdiChildView> *m_pDocumentViews;
252 TQMap<TQWidget*, KMdiToolViewAccessor*> *m_pToolViews;
254 TQPopupMenu *m_pWindowPopup;
255 TQPopupMenu *m_pTaskBarPopup;
256 TQPopupMenu *m_pWindowMenu;
257 TQPopupMenu *m_pDockMenu;
258 TQPopupMenu *m_pMdiModeMenu;
259 TQPopupMenu *m_pPlacingMenu;
260 KMenuBar *m_pMainMenuBar;
262 TQPixmap *m_pUndockButtonPixmap;
263 TQPixmap *m_pMinButtonPixmap;
264 TQPixmap *m_pRestoreButtonPixmap;
265 TQPixmap *m_pCloseButtonPixmap;
267 TQToolButton *m_pUndock;
268 TQToolButton *m_pMinimize;
269 TQToolButton *m_pRestore;
270 TQToolButton *m_pClose;
271 TQPoint m_undockPositioningOffset;
272 bool m_bMaximizedChildFrmMode;
273 int m_oldMainFrmHeight;
274 int m_oldMainFrmMinHeight;
275 int m_oldMainFrmMaxHeight;
276 static KMdi::FrameDecor m_frameDecoration;
277 bool m_bSDIApplication;
278 KDockWidget* m_pDockbaseAreaOfDocumentViews;
279 TQDomDocument* m_pTempDockSession;
280 bool m_bClearingOfWindowMenuBlocked;
282 TQTimer* m_pDragEndTimer;
286 KDockWidget* m_leftContainer;
287 KDockWidget* m_rightContainer;
288 KDockWidget* m_topContainer;
289 KDockWidget* m_bottomContainer;
293 KMdiMainFrmPrivate* d;
295 bool m_managedDockPositionMode;
300 KMdiMainFrm( TQWidget* parentWidget,
const char* name =
"", KMdi::MdiMode mdiMode = KMdi::ChildframeMode, WFlags flags = WType_TopLevel | WDestructiveClose );
302 KMdiMainFrm( TQWidget* parentWidget,
const char* name =
"", KMdi::MdiMode mdiMode = KMdi::ChildframeMode, WFlags flags = (WFlags)(WType_TopLevel | WDestructiveClose) );
310 void setStandardMDIMenuEnabled(
bool showModeMenu =
true );
312 void setManagedDockPositionModeEnabled(
bool enabled );
336 virtual TQPopupMenu * taskBarPopup(
KMdiChildView *pWnd,
bool bIncludeWindowPopup =
false );
342 virtual TQPopupMenu * windowPopup(
KMdiChildView *pWnd,
bool bIncludeTaskbarPopup =
true );
347 virtual void applyOptions();
354 enum ExistsAs {DocumentView, ToolView, AnyView};
372 virtual bool event( TQEvent* e );
377 virtual void setSysButtonsAtMenuPosition();
382 virtual int taskBarHeight() {
return m_pTaskBar ? m_pTaskBar->height() : 0; }
399 if ( m_pDocumentViews == 0L )
401 return new KMdiNullIterator<KMdiChildView*>();
405 return new KMdiListIterator<KMdiChildView>( *m_pDocumentViews );
448 virtual void setMinimumSize(
int minw,
int minh );
460 virtual void setMenuForSDIModeSysButtons( KMenuBar* menuBar = 0 );
473 void fakeSDIApplication();
480 virtual bool eventFilter( TQObject *obj, TQEvent *e );
481 void findRootDockWidgets( TQPtrList<KDockWidget>* pRootDockWidgetList, TQValueList<TQRect>* pPositionList );
484 void setSwitching(
const bool switching ) { m_bSwitching = switching; }
485 bool switching(
void )
const {
return m_bSwitching; }
492 KMdiChildView* createWrapper( TQWidget *view,
const TQString& name,
const TQString& shortName );
553 virtual KMdiToolViewAccessor *addToolWindow( TQWidget* pWnd, KDockWidget::DockPosition pos = KDockWidget::DockNone,
554 TQWidget* pTargetWnd = 0L,
int percent = 50,
const TQString& tabToolTip = 0,
555 const TQString& tabCaption = 0 );
557 virtual void deleteToolWindow( TQWidget* pWnd );
558 virtual void deleteToolWindow( KMdiToolViewAccessor *accessor );
564 KMdiToolViewAccessor *createToolWindow();
577 virtual void closeWindow(
KMdiChildView *pWnd,
bool layoutTaskBar =
true );
582 virtual void slot_toggleTaskBar();
589 virtual void attachWindow(
KMdiChildView *pWnd,
bool bShow =
true,
bool bAutomaticResize =
false );
595 virtual void detachWindow(
KMdiChildView *pWnd,
bool bShow =
true );
606 virtual void closeAllViews();
611 virtual void iconifyAllViews();
616 virtual void closeActiveView();
621 virtual void switchToToplevelMode();
622 virtual void finishToplevelMode();
627 virtual void switchToChildframeMode();
628 virtual void finishChildframeMode();
633 virtual void switchToTabPageMode();
634 virtual void finishTabPageMode();
639 virtual void switchToIDEAlMode();
640 virtual void finishIDEAlMode(
bool full =
true );
646 void setIDEAlModeStyle(
int flags ) KDE_DEPRECATED;
653 void setToolviewStyle(
int flags );
657 bool isViewTaskBarOn();
662 virtual void showViewTaskBar();
667 virtual void hideViewTaskBar();
672 virtual void fillWindowMenu();
713 virtual void setFrameDecorOfAttachedViews(
int frameDecor );
718 virtual void setEnableMaximizedChildFrmMode(
bool bEnable );
723 virtual void activateNextWin();
728 virtual void activatePrevWin();
733 virtual void activateFirstWin();
738 virtual void activateLastWin();
743 virtual void activateView(
int index );
746 void setupToolViewsForIDEALMode();
747 void setupTabbedDocumentViewSpace();
752 virtual void resizeEvent( TQResizeEvent * );
757 virtual void createTaskBar();
762 virtual void createMdiManager();
770 void findToolViewsDockedToMain( TQPtrList<KDockWidget>* list, KDockWidget::DockPosition dprtmw );
771 void dockToolViewsIntoContainers( TQPtrList<KDockWidget>& widgetsToReparent, KDockWidget *container );
772 TQStringList prepareIdealToTabs( KDockWidget* container );
773 void idealToolViewsToStandardTabs( TQStringList widgetNames, KDockWidget::DockPosition pos,
int sizee );
782 class KTabWidget * tabWidget()
const;
795 virtual void taskbarButtonRightClicked(
KMdiChildView *pWnd );
800 void switchOffMaximizeModeForMenu(
KMdiChildFrm* oldChild );
810 void windowMenuItemActivated(
int id );
815 void dockMenuItemActivated(
int id );
820 void popupWindowMenu( TQPoint p );
825 void dragEndTimeOut();
830 void closeViewButtonPressed();
836 void lastChildFrmClosed();
841 void lastChildViewClosed();
846 void leftTopLevelMode();
851 void childViewIsDetachedNow( TQWidget* );
854 void collapseOverlapContainers();
857 void mdiModeHasBeenChangedTo( KMdi::MdiMode );
863 void prevToolViewInDock();
864 void nextToolViewInDock();
867 void setActiveToolDock( KMdiDockContainer* );
868 void removeFromActiveDockList( KMdiDockContainer* );
869 void slotDocCurrentChanged( TQWidget* );
870 void verifyToplevelHeight();
871 #define protected public 881 #endif //_KMDIMAINFRM_H_ TQPopupMenu * windowMenu() const
Returns a popup menu that contains the MDI controlled view list.
virtual void setBackgroundColor(const TQColor &c)
Sets a background color for the MDI view area widget.
void blockClearingOfWindowMenu(bool bBlocked)
prevents fillWindowMenu() from m_pWindowMenu->clear().
void setDefaultChildFrmSize(const TQSize &sz)
Sets a size that is used as the default size for a newly to the MDI system added KMdiChildView ...
void tileAnodine()
Tile Anodine.
virtual int taskBarHeight()
Returns the height of the taskbar.
virtual void expandHorizontal()
Maximizes only in horizontal direction.
TQSize defaultChildFrmSize()
Returns the default size for a newly added KMdiChildView.
Base class for all your special main frames.
void expandHorizontal()
Maximize all windows but only in horizontal direction.
void deleteIterator(KMdiIterator< KMdiChildView *> *pIt)
Deletes an KMdiIterator created in the KMdi library (needed for the windows dll problem).
void cascadeWindows()
Cascades all windows resizing them to the minimum size.
void expandVertical()
Maximize all windows but only in vertical direction.
int childFrameModeHeight()
Returns the Childframe mode height of this.
virtual void tileAnodine()
Tile Anodine.
KMdiIterator< KMdiChildView * > * createIterator()
If you don't want to know about the inner structure of the KMdi system, you can use this iterator to ...
void tilePragma()
Tile Pragma.
bool isInMaximizedChildFrmMode()
Returns whether the application's MDI views are in maximized state or not.
void setSwitching(const bool switching)
We're switching something.
virtual void setUndockPositioningOffset(TQPoint offset)
Sets an offset value that is used on detachWindow() .
virtual void tileVertically()
Tile Vertically.
virtual void setBackgroundPixmap(const TQPixmap &pm)
Sets a background pixmap for the MDI view area widget.
void tileVertically()
Tile all the windows in the child area vertically.
standard is: show normal, attached, visible, document view (not toolview).
virtual void cascadeMaximized()
Cascades the windows resizing them to the maximum available size.
static int frameDecorOfAttachedViews()
virtual void cascadeWindows()
Cascades the windows without resizing them.
KMdi::MdiMode mdiMode()
Returns the MDI mode.
bool isFakingSDIApplication() const
A class derived from KXMLGUIClient that handles the various KMDI modes.
virtual void expandVertical()
Maximizes only in vertical direction.
void cascadeMaximized()
Cascades all windows resizing them to the maximum available size.
Base class for all your special view windows.
virtual void tilePragma()
Tile Pragma.
TQSize m_defaultChildFrmSize
the default size of an newly created childframe