diff options
author | RĂ¼diger Timm <rt@openoffice.org> | 2008-12-16 16:42:03 +0000 |
---|---|---|
committer | RĂ¼diger Timm <rt@openoffice.org> | 2008-12-16 16:42:03 +0000 |
commit | b1da5a57d93e8e9b43b9bba9fabc3b7e61289edc (patch) | |
tree | f98bde8d8f2b22d6f1685adb9fca28cb08aa1ccc /sfx2 | |
parent | 4ee46e177a830739cdc57613784b99f29ec00bea (diff) |
CWS-TOOLING: integrate CWS alf01
2008-12-10 09:35:35 +0100 as r265152 : #158798# hide internal service
2008-12-09 15:29:11 +0100 cd r265098 : #158857# Check index correctly, must be zero
2008-12-09 12:06:21 +0100 mhu r265075 : #158857# Fixed compiler warning(s).
2008-12-09 11:09:34 +0100 cd r265064 : #158857# Added access to the window state configuration to support setting title of internal docking windows via <Module>WindowState.xcu files
2008-12-09 10:43:53 +0100 as r265063 : #158798# make resizes working better
2008-12-08 17:08:05 +0100 mhu r265010 : #158857# Fixed compiler warning(s).
2008-12-08 15:19:04 +0100 as r264999 : #158857# make WindowContentFactories.xcs part of installation set
2008-12-08 13:23:37 +0100 as r264993 : #158857# actualize size on child window
2008-12-08 10:14:05 +0100 cd r264977 : #158857# More helper functions and support to show/hide internal docking windows
2008-12-08 10:13:08 +0100 cd r264976 : #158857# SfxTitleDockingWindow now uses a factory for content window. Additional documentation for special IDs
2008-12-05 07:58:07 +0100 as r264885 : remove obsolete code (not referenced inside makefile any longer)
2008-12-04 18:57:08 +0100 mhu r264871 : #158857# Fixed compiler warning.
2008-12-04 16:13:12 +0100 mhu r264851 : #158857# Fixed compiler warning.
2008-12-04 15:46:45 +0100 as r264849 : solve merge conflicts right
2008-12-04 09:20:26 +0100 cd r264818 : 2008-12-04 09:19:32 +0100 cd r264817 : 2008-12-04 09:19:07 +0100 cd r264816 : Resolved conflicts
2008-12-04 09:13:27 +0100 cd r264815 : New window content factory manager with configuration support added.
2008-12-03 15:15:50 +0100 as r264791 : #158798# make sure tab window will show its content the first time its made visible
2008-12-03 10:59:30 +0100 as r264752 : #158798# new helper service for a dockable tab control window
2008-12-02 15:39:48 +0100 as r264707 : #158798# fix crash in MouseButtonDown for TabControl
2008-12-02 10:28:20 +0100 cd r264665 : #158857# Resolved conflicts on merge
2008-12-02 09:58:36 +0100 cd r264662 : #158857# Added predefined slots for the internal docking windows. Currently only ten predefined docking windows are possible
2008-12-01 09:44:49 +0100 cd r264586 : #158857# Fix problem with close the floated docking window with closer
2008-11-28 13:42:34 +0100 cd r264550 : #158857# First additional code to create a docking window. Very preliminary and not near to final code
2008-11-28 11:53:51 +0100 cd r264538 : #158857# First additional code to create a docking window. Very preliminary and not near to final code
2008-11-28 11:32:38 +0100 cd r264534 : #158857# First version of docking window factory and additional helper classes
2008-11-21 09:46:36 +0100 jsc r264110 : #158798# remove warnings
2008-11-20 17:59:07 +0100 pb r264090 : fix: #158798# tabcontainerwindow.obj and tabdialog.obj added
2008-11-20 17:55:57 +0100 pb r264089 : fix: #i158798# implementation of service TabContainerWindow
2008-11-20 17:52:52 +0100 pb r264088 : fix: #158798# implementation of the TabDialog and its Pages for the TabContainerWindow service
2008-11-20 17:51:26 +0100 pb r264087 : fix: #i158798# TabContainerWindow added
2008-11-20 17:50:11 +0100 pb r264086 : fix: #158798# tabcontainerwindow.obj and tabdialog.obj added
2008-11-20 17:47:16 +0100 pb r264085 : fix: #158798# new resource: TabDialog DLG_TABCONTAINER
2008-11-20 17:46:06 +0100 pb r264084 : fix: #i158798# added ids for TABCONTAINER...
2008-11-20 17:43:19 +0100 pb r264082 : fix: #158798# IMPLEMENTATION/SERVICENAME_TABCONTAINERWINDOW added
2008-11-20 17:43:00 +0100 pb r264081 : fix: #i158798# implementation of service TabContainerWindow
2008-11-20 17:40:42 +0100 pb r264080 : fix: #158798# TabContainerWindow.idl added
2008-11-20 17:36:57 +0100 pb r264079 : fix: #158798# new service TabContainerWindow
2008-11-20 17:33:05 +0100 pb r264077 : fix: #158798# show tooltip if only a image is shown
2008-11-18 15:10:08 +0100 jsc r263770 : CWS-TOOLING: rebase CWS alf01 to trunk@263288 (milestone: DEV300:m35)
2008-11-18 09:55:21 +0100 jsc r263749 : merge from trunk
2008-11-18 09:54:30 +0100 jsc r263748 : merge from trunk
2008-11-13 17:01:17 +0100 pl r263655 : fix some warnings
2008-10-21 15:38:37 +0200 pl r262572 : #i95201# add: EnablePage
2008-10-20 18:57:53 +0200 pl r262335 : #i95201# add: images for tab items
2008-10-20 17:26:50 +0200 pl r262330 : #i95201# remove old tools list
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/inc/sfx2/cntids.hrc | 4 | ||||
-rw-r--r-- | sfx2/inc/sfx2/dockwin.hxx | 274 | ||||
-rw-r--r-- | sfx2/inc/sfx2/sfxsids.hrc | 39 | ||||
-rw-r--r-- | sfx2/sdi/frmslots.sdi | 159 | ||||
-rw-r--r-- | sfx2/sdi/sfx.sdi | 270 | ||||
-rw-r--r-- | sfx2/source/appl/app.cxx | 3 | ||||
-rw-r--r-- | sfx2/source/appl/appmisc.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/appl/appreg.cxx | 1 | ||||
-rw-r--r-- | sfx2/source/dialog/dockwin.cxx | 383 | ||||
-rw-r--r-- | sfx2/source/dialog/makefile.mk | 4 | ||||
-rw-r--r-- | sfx2/source/dialog/navigat.cxx | 12 |
11 files changed, 1021 insertions, 138 deletions
diff --git a/sfx2/inc/sfx2/cntids.hrc b/sfx2/inc/sfx2/cntids.hrc index c0390c39e728..a67c306e61a2 100644 --- a/sfx2/inc/sfx2/cntids.hrc +++ b/sfx2/inc/sfx2/cntids.hrc @@ -51,8 +51,10 @@ #define SID_DELETE (SID_SFX_START + 713) #define SID_INTERNET_ONLINE (SID_SFX_START + 1370) +// Don't let SID_CHAOS_END grow. Internal docking windows use the range between +// SID_CHAOS_END and SID_LIB_START!! Look into sfxsids.hrc for more information! #define SID_CHAOS_START 9000 -#define SID_CHAOS_END 9999 +#define SID_CHAOS_END 9799 #define SID_BCC (SID_CHAOS_START + 2) #define SID_CC (SID_CHAOS_START + 3) diff --git a/sfx2/inc/sfx2/dockwin.hxx b/sfx2/inc/sfx2/dockwin.hxx index 20dc64dfdc70..79727b628a92 100644 --- a/sfx2/inc/sfx2/dockwin.hxx +++ b/sfx2/inc/sfx2/dockwin.hxx @@ -1,129 +1,145 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: dockwin.hxx,v $ - * $Revision: 1.4 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ -#ifndef _SFXDOCKWIN_HXX -#define _SFXDOCKWIN_HXX - -#include "sal/config.h" -#include "sfx2/dllapi.h" -#include "sal/types.h" -#ifndef _DOCKWIN_HXX //autogen -#include <vcl/dockwin.hxx> -#endif -#include <sfx2/childwin.hxx> - -class SfxSplitWindow; -class SfxDockingWindow_Impl; - -class SFX2_DLLPUBLIC SfxDockingWindow : public DockingWindow -{ -private: - Rectangle aInnerRect; - Rectangle aOuterRect; - SfxBindings* pBindings; - Size aFloatSize; - SfxChildWindow* pMgr; - SfxDockingWindow_Impl* pImp; - - SAL_DLLPRIVATE SfxDockingWindow(SfxDockingWindow &); // not defined - SAL_DLLPRIVATE void operator =(SfxDockingWindow &); // not defined - -protected: - SfxChildAlignment CalcAlignment(const Point& rPos, Rectangle& rRect ); - void CalcSplitPosition(const Point rPos, Rectangle& rRect, - SfxChildAlignment eAlign); - virtual Size CalcDockingSize(SfxChildAlignment); - virtual SfxChildAlignment - CheckAlignment(SfxChildAlignment,SfxChildAlignment); - - virtual void Resize(); - virtual BOOL PrepareToggleFloatingMode(); - virtual void ToggleFloatingMode(); - virtual void StartDocking(); - virtual BOOL Docking( const Point& rPos, Rectangle& rRect ); - virtual void EndDocking( const Rectangle& rRect, BOOL bFloatMode ); - virtual void Resizing( Size& rSize ); - virtual void Paint( const Rectangle& rRect ); - virtual BOOL Close(); - virtual void Move(); - -//#if 0 // _SOLAR__PRIVATE - SAL_DLLPRIVATE SfxChildWindow* GetChildWindow_Impl() { return pMgr; } -//#endif - -public: - SfxDockingWindow( SfxBindings *pBindings, - SfxChildWindow *pCW, - Window* pParent, - WinBits nWinBits=0); - SfxDockingWindow( SfxBindings *pBindings, - SfxChildWindow *pCW, - Window* pParent, - const ResId& rResId); - ~SfxDockingWindow(); - - void Initialize (SfxChildWinInfo* pInfo); - virtual void FillInfo(SfxChildWinInfo&) const; - virtual void StateChanged( StateChangedType nStateChange ); - - void SetDockingRects(const Rectangle& rOuter, const Rectangle& rInner) - { aInnerRect = rInner; aOuterRect = rOuter; } - const Rectangle& GetInnerRect() const { return aInnerRect; } - const Rectangle& GetOuterRect() const { return aOuterRect; } - SfxBindings& GetBindings() const { return *pBindings; } - USHORT GetType() const { return pMgr->GetType(); } - SfxChildAlignment GetAlignment() const { return pMgr->GetAlignment(); } - void SetAlignment(SfxChildAlignment eAlign) { pMgr->SetAlignment(eAlign); } - Size GetFloatingSize() const { return aFloatSize; } - void SetFloatingSize(const Size& rSize) { aFloatSize=rSize; } - - void SetMinOutputSizePixel( const Size& rSize ); - Size GetMinOutputSizePixel() const; - virtual long Notify( NotifyEvent& rNEvt ); - virtual void FadeIn( BOOL ); - void AutoShow( BOOL bShow = TRUE ); - DECL_LINK( TimerHdl, Timer* ); - -//#if 0 // _SOLAR__PRIVATE - SAL_DLLPRIVATE void Initialize_Impl(); - SAL_DLLPRIVATE USHORT GetWinBits_Impl() const; - SAL_DLLPRIVATE void SetItemSize_Impl( const Size& rSize ); - SAL_DLLPRIVATE void Disappear_Impl(); - SAL_DLLPRIVATE void Reappear_Impl(); - SAL_DLLPRIVATE BOOL IsAutoHide_Impl() const; - SAL_DLLPRIVATE BOOL IsPinned_Impl() const; - SAL_DLLPRIVATE void AutoShow_Impl( BOOL bShow = TRUE ); - SAL_DLLPRIVATE void Pin_Impl( BOOL bPinned ); - SAL_DLLPRIVATE SfxSplitWindow* GetSplitWindow_Impl() const; - SAL_DLLPRIVATE void ReleaseChildWindow_Impl(); -//#endif -}; - -#endif // #ifndef _SFXDOCKWIN_HXX - +/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: dockwin.hxx,v $
+ * $Revision: 1.4 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/
+#ifndef _SFXDOCKWIN_HXX
+#define _SFXDOCKWIN_HXX
+
+#include "sal/config.h"
+#include "sal/types.h"
+#include <vcl/dockwin.hxx>
+
+#include <com/sun/star/uno/Reference.hxx>
+#include <com/sun/star/awt/XWindow.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
+
+#include "sfx2/dllapi.h"
+#include <sfx2/childwin.hxx>
+
+class SfxSplitWindow;
+class SfxDockingWindow_Impl;
+
+void SFX2_DLLPUBLIC SAL_CALL SfxDockingWindowFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const rtl::OUString& rDockingWindowName );
+bool SFX2_DLLPUBLIC SAL_CALL IsDockingWindowVisible( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const rtl::OUString& rDockingWindowName );
+
+class SFX2_DLLPUBLIC SfxDockingWindow : public DockingWindow
+{
+private:
+ Rectangle aInnerRect;
+ Rectangle aOuterRect;
+ SfxBindings* pBindings;
+ Size aFloatSize;
+ SfxChildWindow* pMgr;
+ SfxDockingWindow_Impl* pImp;
+
+ SAL_DLLPRIVATE SfxDockingWindow(SfxDockingWindow &); // not defined
+ SAL_DLLPRIVATE void operator =(SfxDockingWindow &); // not defined
+
+protected:
+ SfxChildAlignment CalcAlignment(const Point& rPos, Rectangle& rRect );
+ void CalcSplitPosition(const Point rPos, Rectangle& rRect,
+ SfxChildAlignment eAlign);
+ virtual Size CalcDockingSize(SfxChildAlignment);
+ virtual SfxChildAlignment
+ CheckAlignment(SfxChildAlignment,SfxChildAlignment);
+
+ virtual void Resize();
+ virtual BOOL PrepareToggleFloatingMode();
+ virtual void ToggleFloatingMode();
+ virtual void StartDocking();
+ virtual BOOL Docking( const Point& rPos, Rectangle& rRect );
+ virtual void EndDocking( const Rectangle& rRect, BOOL bFloatMode );
+ virtual void Resizing( Size& rSize );
+ virtual void Paint( const Rectangle& rRect );
+ virtual BOOL Close();
+ virtual void Move();
+
+//#if 0 // _SOLAR__PRIVATE
+ SAL_DLLPRIVATE SfxChildWindow* GetChildWindow_Impl() { return pMgr; }
+//#endif
+
+public:
+ SfxDockingWindow( SfxBindings *pBindings,
+ SfxChildWindow *pCW,
+ Window* pParent,
+ WinBits nWinBits=0);
+ SfxDockingWindow( SfxBindings *pBindings,
+ SfxChildWindow *pCW,
+ Window* pParent,
+ const ResId& rResId);
+ ~SfxDockingWindow();
+
+ void Initialize (SfxChildWinInfo* pInfo);
+ virtual void FillInfo(SfxChildWinInfo&) const;
+ virtual void StateChanged( StateChangedType nStateChange );
+
+ void SetDockingRects(const Rectangle& rOuter, const Rectangle& rInner)
+ { aInnerRect = rInner; aOuterRect = rOuter; }
+ const Rectangle& GetInnerRect() const { return aInnerRect; }
+ const Rectangle& GetOuterRect() const { return aOuterRect; }
+ SfxBindings& GetBindings() const { return *pBindings; }
+ USHORT GetType() const { return pMgr->GetType(); }
+ SfxChildAlignment GetAlignment() const { return pMgr->GetAlignment(); }
+ void SetAlignment(SfxChildAlignment eAlign) { pMgr->SetAlignment(eAlign); }
+ Size GetFloatingSize() const { return aFloatSize; }
+ void SetFloatingSize(const Size& rSize) { aFloatSize=rSize; }
+
+ void SetMinOutputSizePixel( const Size& rSize );
+ Size GetMinOutputSizePixel() const;
+ virtual long Notify( NotifyEvent& rNEvt );
+ virtual void FadeIn( BOOL );
+ void AutoShow( BOOL bShow = TRUE );
+ DECL_LINK( TimerHdl, Timer* );
+
+//#if 0 // _SOLAR__PRIVATE
+ SAL_DLLPRIVATE void Initialize_Impl();
+ SAL_DLLPRIVATE USHORT GetWinBits_Impl() const;
+ SAL_DLLPRIVATE void SetItemSize_Impl( const Size& rSize );
+ SAL_DLLPRIVATE void Disappear_Impl();
+ SAL_DLLPRIVATE void Reappear_Impl();
+ SAL_DLLPRIVATE BOOL IsAutoHide_Impl() const;
+ SAL_DLLPRIVATE BOOL IsPinned_Impl() const;
+ SAL_DLLPRIVATE void AutoShow_Impl( BOOL bShow = TRUE );
+ SAL_DLLPRIVATE void Pin_Impl( BOOL bPinned );
+ SAL_DLLPRIVATE SfxSplitWindow* GetSplitWindow_Impl() const;
+ SAL_DLLPRIVATE void ReleaseChildWindow_Impl();
+//#endif
+};
+
+class SfxDockingWrapper : public SfxChildWindow
+{
+ public:
+ SfxDockingWrapper( Window* pParent ,
+ USHORT nId ,
+ SfxBindings* pBindings ,
+ SfxChildWinInfo* pInfo );
+
+ SFX_DECL_CHILDWINDOW(SfxDockingWrapper);
+};
+
+#endif // #ifndef _SFXDOCKWIN_HXX
diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index af4e47dd904d..713f39f5ab5a 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -43,6 +43,45 @@ #include <sfx2/cntids.hrc> #endif +// Please be careful: +// Changing just one part here doesn't add new +// docking windows automatically! +// +#define SID_DOCKWIN_START 9800 +#define SID_DOCKWIN_0 9800 +#define SID_DOCKWIN_1 9801 +#define SID_DOCKWIN_2 9802 +#define SID_DOCKWIN_3 9803 +#define SID_DOCKWIN_4 9804 +#define SID_DOCKWIN_5 9805 +#define SID_DOCKWIN_6 9806 +#define SID_DOCKWIN_7 9807 +#define SID_DOCKWIN_8 9808 +#define SID_DOCKWIN_9 9809 +/* +#define SID_DOCKWIN_10 9810 +#define SID_DOCKWIN_11 9811 +#define SID_DOCKWIN_12 9812 +#define SID_DOCKWIN_13 9813 +#define SID_DOCKWIN_14 9814 +#define SID_DOCKWIN_15 9815 +#define SID_DOCKWIN_16 9816 +#define SID_DOCKWIN_17 9817 +#define SID_DOCKWIN_18 9818 +#define SID_DOCKWIN_19 9819 +#define SID_DOCKWIN_20 9820 +#define SID_DOCKWIN_21 9821 +#define SID_DOCKWIN_22 9822 +#define SID_DOCKWIN_23 9823 +#define SID_DOCKWIN_24 9824 +#define SID_DOCKWIN_25 9825 +#define SID_DOCKWIN_26 9826 +#define SID_DOCKWIN_27 9827 +#define SID_DOCKWIN_28 9828 +#define SID_DOCKWIN_29 9829 +*/ +#define SID_DOCKWIN_END 9999 + #define SID_LIB_START 10000 #define SID_LIB_END 19999 diff --git a/sfx2/sdi/frmslots.sdi b/sfx2/sdi/frmslots.sdi index 02d72e608da7..35f410db44af 100644 --- a/sfx2/sdi/frmslots.sdi +++ b/sfx2/sdi/frmslots.sdi @@ -115,6 +115,165 @@ interface Window StateMethod = ChildWindowState ; ] + // Pre-defined docking window slots (usable by internal docking windows) + SID_DOCKWIN_0 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_1 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_2 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_3 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_4 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_5 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_6 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_7 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_8 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_9 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] +/* Be careful! + You also have to make changes in: + - sfx2/sdi/sfx.sdi + - sfx2/source/dialog/dockwin.cxx + - sfx2/sdi/frmslots.sdi + - sfx2/inc/sfx2/sfxsids.hrc + + SID_DOCKWIN_10 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_11 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_12 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_13 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_14 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_15 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_16 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_17 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_18 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_19 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_20 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_21 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_22 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_23 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_24 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_25 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_26 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_27 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_28 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] + SID_DOCKWIN_29 + [ + ExecMethod = ChildWindowExecute ; + StateMethod = ChildWindowState ; + ] +*/ // Window.GetFrameWindow( "Name" ) SID_FILLFRAME [ diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi index 22d7d1a8497e..d397f2906a22 100644 --- a/sfx2/sdi/sfx.sdi +++ b/sfx2/sdi/sfx.sdi @@ -8480,3 +8480,273 @@ SfxVoidItem ActivateStyleApply SID_ACTIVATE_STYLE_APPLY ToolBoxConfig = TRUE, GroupId = GID_TEMPLATE; ] + +//-------------------------------------------------------------------------- +SfxBoolItem DockingWindow0 SID_DOCKWIN_0 + +[ + /* flags: */ + AutoUpdate = TRUE, + Cachable = Cachable, + FastCall = TRUE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + Readonly = FALSE, + + /* config: */ + AccelConfig = FALSE, + MenuConfig = FALSE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_APPLICATION; +] + +//-------------------------------------------------------------------------- +SfxBoolItem DockingWindow1 SID_DOCKWIN_1 + +[ + /* flags: */ + AutoUpdate = TRUE, + Cachable = Cachable, + FastCall = TRUE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + Readonly = FALSE, + + /* config: */ + AccelConfig = FALSE, + MenuConfig = FALSE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_APPLICATION; +] + +//-------------------------------------------------------------------------- +SfxBoolItem DockingWindow2 SID_DOCKWIN_2 + +[ + /* flags: */ + AutoUpdate = TRUE, + Cachable = Cachable, + FastCall = TRUE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + Readonly = FALSE, + + /* config: */ + AccelConfig = FALSE, + MenuConfig = FALSE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_APPLICATION; +] + +//-------------------------------------------------------------------------- +SfxBoolItem DockingWindow3 SID_DOCKWIN_3 + +[ + /* flags: */ + AutoUpdate = TRUE, + Cachable = Cachable, + FastCall = TRUE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + Readonly = FALSE, + + /* config: */ + AccelConfig = FALSE, + MenuConfig = FALSE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_APPLICATION; +] + +//-------------------------------------------------------------------------- +SfxBoolItem DockingWindow4 SID_DOCKWIN_4 + +[ + /* flags: */ + AutoUpdate = TRUE, + Cachable = Cachable, + FastCall = TRUE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + Readonly = FALSE, + + /* config: */ + AccelConfig = FALSE, + MenuConfig = FALSE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_APPLICATION; +] + +//-------------------------------------------------------------------------- +SfxBoolItem DockingWindow5 SID_DOCKWIN_5 + +[ + /* flags: */ + AutoUpdate = TRUE, + Cachable = Cachable, + FastCall = TRUE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + Readonly = FALSE, + + /* config: */ + AccelConfig = FALSE, + MenuConfig = FALSE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_APPLICATION; +] + +//-------------------------------------------------------------------------- +SfxBoolItem DockingWindow6 SID_DOCKWIN_6 + +[ + /* flags: */ + AutoUpdate = TRUE, + Cachable = Cachable, + FastCall = TRUE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + Readonly = FALSE, + + /* config: */ + AccelConfig = FALSE, + MenuConfig = FALSE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_APPLICATION; +] + +//-------------------------------------------------------------------------- +SfxBoolItem DockingWindow7 SID_DOCKWIN_7 + +[ + /* flags: */ + AutoUpdate = TRUE, + Cachable = Cachable, + FastCall = TRUE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + Readonly = FALSE, + + /* config: */ + AccelConfig = FALSE, + MenuConfig = FALSE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_APPLICATION; +] + +//-------------------------------------------------------------------------- +SfxBoolItem DockingWindow8 SID_DOCKWIN_8 + +[ + /* flags: */ + AutoUpdate = TRUE, + Cachable = Cachable, + FastCall = TRUE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + Readonly = FALSE, + + /* config: */ + AccelConfig = FALSE, + MenuConfig = FALSE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_APPLICATION; +] + +//-------------------------------------------------------------------------- +SfxBoolItem DockingWindow9 SID_DOCKWIN_9 + +[ + /* flags: */ + AutoUpdate = TRUE, + Cachable = Cachable, + FastCall = TRUE, + HasCoreId = FALSE, + HasDialog = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Synchron; + + Readonly = FALSE, + + /* config: */ + AccelConfig = FALSE, + MenuConfig = FALSE, + StatusBarConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = GID_APPLICATION; +] diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index 965cf5543d11..b7f0ab91feee 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -125,6 +125,7 @@ #include <sfx2/sfxdlg.hxx> #include "stbitem.hxx" #include "eventsupplier.hxx" +#include <sfx2/dockwin.hxx> #ifdef DBG_UTIL #include <sfx2/tbxctrl.hxx> @@ -323,6 +324,8 @@ SfxApplication* SfxApplication::GetOrCreate() ::framework::SetRefreshToolbars( RefreshToolbars ); ::framework::SetToolBoxControllerCreator( SfxToolBoxControllerFactory ); ::framework::SetStatusBarControllerCreator( SfxStatusBarControllerFactory ); + ::framework::SetDockingWindowCreator( SfxDockingWindowFactory ); + ::framework::SetIsDockingWindowVisible( IsDockingWindowVisible ); SfxHelp* pSfxHelp = new SfxHelp; Application::SetHelp( pSfxHelp ); diff --git a/sfx2/source/appl/appmisc.cxx b/sfx2/source/appl/appmisc.cxx index 66691db6359e..08a61b1f0ce6 100644 --- a/sfx2/source/appl/appmisc.cxx +++ b/sfx2/source/appl/appmisc.cxx @@ -150,6 +150,16 @@ IMPL_LINK( SfxSpecialConfigError_Impl, TimerHdl, Timer*, pTimer ) SFX_IMPL_INTERFACE(SfxApplication,SfxShell,SfxResId(RID_DESKTOP)) { SFX_STATUSBAR_REGISTRATION(SfxResId(SFX_ITEMTYPE_STATBAR)); + SFX_CHILDWINDOW_REGISTRATION(SID_DOCKWIN_0); + SFX_CHILDWINDOW_REGISTRATION(SID_DOCKWIN_1); + SFX_CHILDWINDOW_REGISTRATION(SID_DOCKWIN_2); + SFX_CHILDWINDOW_REGISTRATION(SID_DOCKWIN_3); + SFX_CHILDWINDOW_REGISTRATION(SID_DOCKWIN_4); + SFX_CHILDWINDOW_REGISTRATION(SID_DOCKWIN_5); + SFX_CHILDWINDOW_REGISTRATION(SID_DOCKWIN_6); + SFX_CHILDWINDOW_REGISTRATION(SID_DOCKWIN_7); + SFX_CHILDWINDOW_REGISTRATION(SID_DOCKWIN_8); + SFX_CHILDWINDOW_REGISTRATION(SID_DOCKWIN_9); } //-------------------------------------------------------------------- diff --git a/sfx2/source/appl/appreg.cxx b/sfx2/source/appl/appreg.cxx index a3652512ef26..9e688f885e3c 100644 --- a/sfx2/source/appl/appreg.cxx +++ b/sfx2/source/appl/appreg.cxx @@ -71,6 +71,7 @@ void SfxApplication::Registrations_Impl() SfxNavigatorWrapper::RegisterChildWindow( FALSE, NULL, SFX_CHILDWIN_NEVERHIDE ); SfxPartChildWnd_Impl::RegisterChildWindow(); SfxTemplateDialogWrapper::RegisterChildWindow(TRUE); + SfxDockingWrapper::RegisterChildWindow(); // Controller SfxToolBoxControl::RegisterControl(SID_REPEAT); diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx index ce62ccc99232..afcf2aeef353 100644 --- a/sfx2/source/dialog/dockwin.cxx +++ b/sfx2/source/dialog/dockwin.cxx @@ -30,11 +30,15 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sfx2.hxx" + #include <svtools/eitem.hxx> #include <vcl/decoview.hxx> #include <vcl/svapp.hxx> #include <vcl/timer.hxx> +#include <rtl/instance.hxx> +#include <toolkit/helper/vclunohelper.hxx> +#include <comphelper/processfactory.hxx> #include <sfx2/dockwin.hxx> #include <sfx2/bindings.hxx> @@ -44,14 +48,393 @@ #include "splitwin.hxx" #include <sfx2/viewsh.hxx> #include "sfxhelp.hxx" +#include <sfx2/objsh.hxx> + +#include <com/sun/star/frame/XController.hpp> +#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <com/sun/star/lang/XSingleComponentFactory.hpp> +#include <com/sun/star/awt/XWindow.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> +#include <com/sun/star/frame/XModuleManager.hpp> +#include <com/sun/star/container/XNameAccess.hpp> #define MAX_TOGGLEAREA_WIDTH 20 #define MAX_TOGGLEAREA_HEIGHT 20 +using namespace ::com::sun::star; + // implemented in 'sfx2/source/appl/childwin.cxx' extern sal_Bool GetPosSizeFromString( const String& rStr, Point& rPos, Size& rSize ); extern sal_Bool GetSplitSizeFromString( const String& rStr, Size& rSize ); +// If you want to change the number you also have to: +// - Add new slot ids to sfxsids.hrc +// - Add new slots to frmslots.sdi +// - Add new slot definitions to sfx.sdi +static const int NUM_OF_DOCKINGWINDOWS = 10; + +class SfxTitleDockingWindow; +class SfxTitleDockingWindow : public SfxDockingWindow +{ + Window* m_pWrappedWindow; + USHORT m_nID; + +public: + SfxTitleDockingWindow( + SfxBindings* pBindings , + SfxChildWindow* pChildWin , + Window* pParent , + WinBits nBits, + USHORT nID); + virtual ~SfxTitleDockingWindow(); + + Window* GetWrappedWindow() const { return m_pWrappedWindow; } + void SetWrappedWindow(Window* const pWindow); + + virtual void StateChanged( StateChangedType nType ); + virtual long Notify( NotifyEvent& rNEvt ); + virtual void Resize(); + virtual void Resizing( Size& rSize ); + virtual BOOL Close(); +}; + +namespace +{ + struct WindowState + { + ::rtl::OUString sTitle; + }; +} + +static uno::WeakReference< container::XNameAccess > m_xWindowStateConfiguration; +static uno::WeakReference< frame::XModuleManager > m_xModuleManager; + +static bool lcl_getWindowState( const uno::Reference< container::XNameAccess >& xWindowStateMgr, const ::rtl::OUString& rResourceURL, WindowState& rWindowState ) +{ + bool bResult = false; + + try + { + uno::Any a; + uno::Sequence< beans::PropertyValue > aWindowState; + a = xWindowStateMgr->getByName( rResourceURL ); + if ( a >>= aWindowState ) + { + for ( sal_Int32 n = 0; n < aWindowState.getLength(); n++ ) + { + if ( aWindowState[n].Name.equalsAscii( "UIName" )) + { + aWindowState[n].Value >>= rWindowState.sTitle; + } + } + } + + bResult = true; + } + catch ( container::NoSuchElementException& ) + { + bResult = false; + } + + return bResult; +} + +SfxDockingWrapper::SfxDockingWrapper( Window* pParentWnd , + USHORT nId , + SfxBindings* pBindings , + SfxChildWinInfo* pInfo ) + : SfxChildWindow( pParentWnd , nId ) +{ + uno::Reference< lang::XMultiServiceFactory > xServiceManager = ::comphelper::getProcessServiceFactory(); + const rtl::OUString aDockWindowResourceURL( RTL_CONSTASCII_USTRINGPARAM( "private:resource/dockingwindow/" )); + + SfxTitleDockingWindow* pTitleDockWindow = new SfxTitleDockingWindow( pBindings, this, pParentWnd, + WB_STDDOCKWIN | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK | WB_ROLLABLE, nId); + pWindow = pTitleDockWindow; + eChildAlignment = SFX_ALIGN_NOALIGNMENT; + + // Use factory manager to retrieve XWindow factory. That can be used to instanciate + // the real window factory. + uno::Reference< lang::XSingleComponentFactory > xFactoryMgr( + xServiceManager->createInstance( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.ui.WindowContentFactoryManager"))), + uno::UNO_QUERY ); + + if (xFactoryMgr.is()) + { + SfxDispatcher* pDispatcher = pBindings->GetDispatcher(); + uno::Reference< frame::XFrame > xFrame( pDispatcher->GetFrame()->GetFrame()->GetFrameInterface(), uno::UNO_QUERY ); + uno::Sequence< uno::Any > aArgs(2); + beans::PropertyValue aPropValue; + aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Frame" )); + aPropValue.Value = uno::makeAny( xFrame ); + aArgs[0] <<= aPropValue; + aPropValue.Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceURL" )); + + // create a resource URL from the nId provided by the sfx2 + ::rtl::OUString aResourceURL( aDockWindowResourceURL ); + aResourceURL += ::rtl::OUString::valueOf(sal_Int32(nId)); + aPropValue.Value = uno::makeAny( aResourceURL ); + aArgs[1] <<= aPropValue; + + uno::Reference< awt::XWindow > xWindow; + try + { + uno::Reference< beans::XPropertySet > xProps( xServiceManager, uno::UNO_QUERY ); + uno::Reference< uno::XComponentContext > xContext; + + if ( xProps.is() ) + xProps->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))) >>= xContext; + if ( xContext.is() ) + { + xWindow = uno::Reference< awt::XWindow>( + xFactoryMgr->createInstanceWithArgumentsAndContext( aArgs, xContext ), + uno::UNO_QUERY ); + } + + uno::Reference< frame::XModuleManager > xModuleManager( m_xModuleManager ); + if ( !xModuleManager.is() ) + { + xModuleManager = uno::Reference< frame::XModuleManager >( + xServiceManager->createInstance( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ModuleManager" ))), + uno::UNO_QUERY ); + m_xModuleManager = xModuleManager; + } + + uno::Reference< container::XNameAccess > xWindowStateConfiguration( m_xWindowStateConfiguration ); + if ( !xWindowStateConfiguration.is() ) + { + xWindowStateConfiguration = uno::Reference< container::XNameAccess >( + xServiceManager->createInstance( + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.WindowStateConfiguration" ))), + uno::UNO_QUERY ); + m_xWindowStateConfiguration = xWindowStateConfiguration; + } + + ::rtl::OUString sModuleIdentifier = xModuleManager->identify( xFrame ); + + uno::Reference< container::XNameAccess > xModuleWindowState( + xWindowStateConfiguration->getByName( sModuleIdentifier ), + uno::UNO_QUERY ); + if ( xModuleWindowState.is() ) + { + WindowState aDockWinState; + if ( lcl_getWindowState( xModuleWindowState, aResourceURL, aDockWinState )) + pTitleDockWindow->SetText( aDockWinState.sTitle ); + } + } + catch ( beans::UnknownPropertyException& ) + { + } + catch ( uno::RuntimeException& ) + { + } + catch ( uno::Exception& ) + { + } + + Window* pContentWindow = VCLUnoHelper::GetWindow(xWindow); + pTitleDockWindow->SetWrappedWindow(pContentWindow); + } + + pWindow->SetOutputSizePixel( Size( 270, 240 ) ); + + ( ( SfxDockingWindow* ) pWindow )->Initialize( pInfo ); + SetHideNotDelete( TRUE ); +} + +SfxChildWindow* SfxDockingWrapper::CreateImpl( +Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo* pInfo ) +{ + SfxChildWindow *pWin = new SfxDockingWrapper(pParent, nId, pBindings, pInfo); return pWin; +} + +sal_uInt16 SfxDockingWrapper::GetChildWindowId () +{ + DBG_ASSERT( false, "This method shouldn't be called!" ); + return 0; +} + +void SfxDockingWrapper::RegisterChildWindow (sal_Bool bVis, SfxModule *pMod, sal_uInt16 nFlags) +{ + // pre-register a couple of docking windows + for (int i=0; i < NUM_OF_DOCKINGWINDOWS; i++ ) + { + USHORT nID = USHORT(SID_DOCKWIN_START+i); + SfxChildWinFactory *pFact = new SfxChildWinFactory( SfxDockingWrapper::CreateImpl, nID, 0xffff ); + pFact->aInfo.nFlags |= nFlags; + pFact->aInfo.bVisible = bVis; + SfxChildWindow::RegisterChildWindow(pMod, pFact); + } +} + +SfxChildWinInfo SfxDockingWrapper::GetInfo() const +{ + SfxChildWinInfo aInfo = SfxChildWindow::GetInfo(); + ((SfxDockingWindow*)GetWindow())->FillInfo( aInfo ); + return aInfo; +}; + +SfxTitleDockingWindow::SfxTitleDockingWindow( SfxBindings* pBind , + SfxChildWindow* pChildWin , + Window* pParent , + WinBits nBits, + USHORT nID ) : + SfxDockingWindow( pBind , + pChildWin , + pParent , + nBits ), + m_pWrappedWindow(0), + m_nID(nID) +{ +} + +SfxTitleDockingWindow::~SfxTitleDockingWindow() +{ + delete m_pWrappedWindow; +} + +void SfxTitleDockingWindow::SetWrappedWindow( Window* const pWindow ) +{ + m_pWrappedWindow = pWindow; + if (m_pWrappedWindow) + { + m_pWrappedWindow->SetParent(this); + m_pWrappedWindow->SetSizePixel( GetOutputSizePixel() ); + m_pWrappedWindow->Show(); + } +} + +long SfxTitleDockingWindow::Notify( NotifyEvent& rNEvt ) +{ + return SfxDockingWindow::Notify( rNEvt ); +} + +void SfxTitleDockingWindow::StateChanged( StateChangedType nType ) +{ + if ( nType == STATE_CHANGE_INITSHOW ) + { + Window* pWindow = GetWrappedWindow(); + if ( pWindow ) + { + pWindow->SetSizePixel( GetOutputSizePixel() ); + pWindow->Show(); + } + } + + SfxDockingWindow::StateChanged(nType); +} + +void SfxTitleDockingWindow::Resize() +{ + SfxDockingWindow::Resize(); + if (m_pWrappedWindow) + m_pWrappedWindow->SetSizePixel( GetOutputSizePixel() ); +} + +void SfxTitleDockingWindow::Resizing( Size &rSize ) +{ + SfxDockingWindow::Resizing( rSize ); + if (m_pWrappedWindow) + m_pWrappedWindow->SetSizePixel( GetOutputSizePixel() ); +} + +BOOL SfxTitleDockingWindow::Close() +{ + return SfxDockingWindow::Close(); +} + +namespace +{ + struct ChildrenRegisteredMap : public rtl::Static< bool, ChildrenRegisteredMap > {}; +} + +static bool lcl_checkDockingWindowID( USHORT nID ) +{ + if (nID < SID_DOCKWIN_START || nID >= USHORT(SID_DOCKWIN_START+NUM_OF_DOCKINGWINDOWS)) + return false; + else + return true; +} + +static SfxWorkWindow* lcl_getWorkWindowFromXFrame( const uno::Reference< frame::XFrame >& rFrame ) +{ + // We need to find the corresponding SfxFrame of our XFrame + SfxFrame* pFrame = SfxFrame::GetFirst(); + SfxFrame* pXFrame = 0; + while ( pFrame ) + { + uno::Reference< frame::XFrame > xViewShellFrame( pFrame->GetFrameInterface() ); + if ( xViewShellFrame == rFrame ) + { + pXFrame = pFrame; + break; + } + else + pFrame = SfxFrame::GetNext( *pFrame ); + } + + // If we have a SfxFrame we can retrieve the work window (Sfx layout manager for docking windows) + if ( pXFrame ) + return pXFrame->GetWorkWindow_Impl(); + else + return NULL; +} + +/* + Factory function used by the framework layout manager to "create" a docking window with a special name. + The string rDockingWindowName MUST BE a valid ID! The ID is pre-defined by a certain slot range located + in sfxsids.hrc (currently SID_DOCKWIN_START = 9800). +*/ +void SAL_CALL SfxDockingWindowFactory( const uno::Reference< frame::XFrame >& rFrame, const rtl::OUString& rDockingWindowName ) +{ + ::vos::OGuard aGuard( Application::GetSolarMutex() ); + USHORT nID = USHORT(rDockingWindowName.toInt32()); + + // Check the range of the provided ID otherwise nothing will happen + if ( lcl_checkDockingWindowID( nID )) + { + SfxWorkWindow* pWorkWindow = lcl_getWorkWindowFromXFrame( rFrame ); + if ( pWorkWindow ) + { + SfxChildWindow* pChildWindow = pWorkWindow->GetChildWindow_Impl(nID); + if ( !pChildWindow ) + { + // Register window at the workwindow child window list + pWorkWindow->SetChildWindow_Impl( nID, true, false ); + } + } + } +} + +/* + Function used by the framework layout manager to determine the visibility state of a docking window with + a special name. The string rDockingWindowName MUST BE a valid ID! The ID is pre-defined by a certain slot + range located in sfxsids.hrc (currently SID_DOCKWIN_START = 9800). +*/ +bool SAL_CALL IsDockingWindowVisible( const uno::Reference< frame::XFrame >& rFrame, const rtl::OUString& rDockingWindowName ) +{ + ::vos::OGuard aGuard( Application::GetSolarMutex() ); + + USHORT nID = USHORT(rDockingWindowName.toInt32()); + + // Check the range of the provided ID otherwise nothing will happen + if ( lcl_checkDockingWindowID( nID )) + { + SfxWorkWindow* pWorkWindow = lcl_getWorkWindowFromXFrame( rFrame ); + if ( pWorkWindow ) + { + SfxChildWindow* pChildWindow = pWorkWindow->GetChildWindow_Impl(nID); + if ( pChildWindow ) + return true; + } + } + + return false; +} + class SfxDockingWindow_Impl { friend class SfxDockingWindow; diff --git a/sfx2/source/dialog/makefile.mk b/sfx2/source/dialog/makefile.mk index 69cc0bb4c5ea..58c74680cdd2 100644 --- a/sfx2/source/dialog/makefile.mk +++ b/sfx2/source/dialog/makefile.mk @@ -50,7 +50,8 @@ EXCEPTIONSFILES=\ $(SLO)$/partwnd.obj \ $(SLO)$/recfloat.obj \ $(SLO)$/templdlg.obj \ - $(SLO)$/dinfdlg.obj + $(SLO)$/dinfdlg.obj \ + $(SLO)$/dockwin.obj SLOFILES =\ $(EXCEPTIONSFILES) \ @@ -58,7 +59,6 @@ SLOFILES =\ $(SLO)$/alienwarn.obj \ $(SLO)$/basedlgs.obj \ $(SLO)$/dinfedt.obj \ - $(SLO)$/dockwin.obj \ $(SLO)$/intro.obj \ $(SLO)$/macropg.obj \ $(SLO)$/mgetempl.obj \ diff --git a/sfx2/source/dialog/navigat.cxx b/sfx2/source/dialog/navigat.cxx index f7a44d6fb6f6..9f7cecd97745 100644 --- a/sfx2/source/dialog/navigat.cxx +++ b/sfx2/source/dialog/navigat.cxx @@ -62,13 +62,13 @@ SfxNavigatorWrapper::SfxNavigatorWrapper( Window* pParentWnd , } SfxNavigator::SfxNavigator( SfxBindings* pBind , - SfxChildWindow* pChildWin , - Window* pParent , - WinBits nBits ) + SfxChildWindow* pChildWin , + Window* pParent , + WinBits nBits ) : SfxDockingWindow( pBind , - pChildWin , - pParent , - nBits ) + pChildWin , + pParent , + nBits ) , pWrapper( pChildWin ) { SetText( String( SfxResId( SID_NAVIGATOR ) ) ); |