xref: /aoo41x/main/sfx2/inc/sfx2/dockwin.hxx (revision 353d8f4d)
1*353d8f4dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*353d8f4dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*353d8f4dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*353d8f4dSAndrew Rist  * distributed with this work for additional information
6*353d8f4dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*353d8f4dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*353d8f4dSAndrew Rist  * "License"); you may not use this file except in compliance
9*353d8f4dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10*353d8f4dSAndrew Rist  *
11*353d8f4dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*353d8f4dSAndrew Rist  *
13*353d8f4dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*353d8f4dSAndrew Rist  * software distributed under the License is distributed on an
15*353d8f4dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*353d8f4dSAndrew Rist  * KIND, either express or implied.  See the License for the
17*353d8f4dSAndrew Rist  * specific language governing permissions and limitations
18*353d8f4dSAndrew Rist  * under the License.
19*353d8f4dSAndrew Rist  *
20*353d8f4dSAndrew Rist  *************************************************************/
21*353d8f4dSAndrew Rist 
22*353d8f4dSAndrew Rist 
23cdf0e10cSrcweir #ifndef _SFXDOCKWIN_HXX
24cdf0e10cSrcweir #define _SFXDOCKWIN_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include "sal/config.h"
27cdf0e10cSrcweir #include "sal/types.h"
28cdf0e10cSrcweir #include <vcl/dockwin.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include <com/sun/star/uno/Reference.hxx>
31cdf0e10cSrcweir #include <com/sun/star/awt/XWindow.hpp>
32cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp>
33cdf0e10cSrcweir 
34cdf0e10cSrcweir #include "sfx2/dllapi.h"
35cdf0e10cSrcweir #include <sfx2/childwin.hxx>
36cdf0e10cSrcweir 
37cdf0e10cSrcweir class SfxSplitWindow;
38cdf0e10cSrcweir class SfxDockingWindow_Impl;
39cdf0e10cSrcweir 
40cdf0e10cSrcweir void SFX2_DLLPUBLIC SAL_CALL SfxDockingWindowFactory( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const rtl::OUString& rDockingWindowName );
41cdf0e10cSrcweir bool SFX2_DLLPUBLIC SAL_CALL IsDockingWindowVisible( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rFrame, const rtl::OUString& rDockingWindowName );
42cdf0e10cSrcweir 
43cdf0e10cSrcweir class SFX2_DLLPUBLIC SfxDockingWindow : public DockingWindow
44cdf0e10cSrcweir {
45cdf0e10cSrcweir private:
46cdf0e10cSrcweir 	Rectangle               aInnerRect;
47cdf0e10cSrcweir 	Rectangle               aOuterRect;
48cdf0e10cSrcweir 	SfxBindings*            pBindings;
49cdf0e10cSrcweir 	Size                    aFloatSize;
50cdf0e10cSrcweir 	SfxChildWindow*         pMgr;
51cdf0e10cSrcweir 	SfxDockingWindow_Impl*  pImp;
52cdf0e10cSrcweir 
53cdf0e10cSrcweir     SAL_DLLPRIVATE SfxDockingWindow(SfxDockingWindow &); // not defined
54cdf0e10cSrcweir     SAL_DLLPRIVATE void operator =(SfxDockingWindow &); // not defined
55cdf0e10cSrcweir 
56cdf0e10cSrcweir protected:
57cdf0e10cSrcweir 	SfxChildAlignment   CalcAlignment(const Point& rPos, Rectangle& rRect );
58cdf0e10cSrcweir 	void                CalcSplitPosition(const Point rPos, Rectangle& rRect,
59cdf0e10cSrcweir 							SfxChildAlignment eAlign);
60cdf0e10cSrcweir 	virtual Size        CalcDockingSize(SfxChildAlignment);
61cdf0e10cSrcweir 	virtual SfxChildAlignment
62cdf0e10cSrcweir 						CheckAlignment(SfxChildAlignment,SfxChildAlignment);
63cdf0e10cSrcweir 
64cdf0e10cSrcweir 	virtual void        Resize();
65cdf0e10cSrcweir 	virtual sal_Bool        PrepareToggleFloatingMode();
66cdf0e10cSrcweir 	virtual void        ToggleFloatingMode();
67cdf0e10cSrcweir 	virtual void        StartDocking();
68cdf0e10cSrcweir 	virtual sal_Bool        Docking( const Point& rPos, Rectangle& rRect );
69cdf0e10cSrcweir 	virtual void        EndDocking( const Rectangle& rRect, sal_Bool bFloatMode );
70cdf0e10cSrcweir 	virtual void        Resizing( Size& rSize );
71cdf0e10cSrcweir 	virtual void        Paint( const Rectangle& rRect );
72cdf0e10cSrcweir 	virtual sal_Bool        Close();
73cdf0e10cSrcweir     virtual void        Move();
74cdf0e10cSrcweir 
75cdf0e10cSrcweir //#if 0 // _SOLAR__PRIVATE
GetChildWindow_Impl()76cdf0e10cSrcweir 	SAL_DLLPRIVATE SfxChildWindow* GetChildWindow_Impl()	{ return pMgr; }
77cdf0e10cSrcweir //#endif
78cdf0e10cSrcweir 
79cdf0e10cSrcweir public:
80cdf0e10cSrcweir 						SfxDockingWindow( SfxBindings *pBindings,
81cdf0e10cSrcweir 										  SfxChildWindow *pCW,
82cdf0e10cSrcweir 										  Window* pParent,
83cdf0e10cSrcweir 										  WinBits nWinBits=0);
84cdf0e10cSrcweir 						SfxDockingWindow( SfxBindings *pBindings,
85cdf0e10cSrcweir 										  SfxChildWindow *pCW,
86cdf0e10cSrcweir 										  Window* pParent,
87cdf0e10cSrcweir 										  const ResId& rResId);
88cdf0e10cSrcweir 						~SfxDockingWindow();
89cdf0e10cSrcweir 
90cdf0e10cSrcweir 	void                Initialize (SfxChildWinInfo* pInfo);
91cdf0e10cSrcweir 	virtual void        FillInfo(SfxChildWinInfo&) const;
92cdf0e10cSrcweir 	virtual void		StateChanged( StateChangedType nStateChange );
93cdf0e10cSrcweir 
SetDockingRects(const Rectangle & rOuter,const Rectangle & rInner)94cdf0e10cSrcweir 	void                SetDockingRects(const Rectangle& rOuter, const Rectangle& rInner)
95cdf0e10cSrcweir 							{ aInnerRect = rInner; aOuterRect = rOuter; }
GetInnerRect() const96cdf0e10cSrcweir 	const Rectangle&    GetInnerRect() const					{ return aInnerRect; }
GetOuterRect() const97cdf0e10cSrcweir 	const Rectangle&    GetOuterRect() const					{ return aOuterRect; }
GetBindings() const98cdf0e10cSrcweir 	SfxBindings&        GetBindings() const						{ return *pBindings; }
GetType() const99cdf0e10cSrcweir 	sal_uInt16              GetType() const							{ return pMgr->GetType(); }
GetAlignment() const100cdf0e10cSrcweir 	SfxChildAlignment   GetAlignment() const					{ return pMgr->GetAlignment(); }
SetAlignment(SfxChildAlignment eAlign)101cdf0e10cSrcweir 	void                SetAlignment(SfxChildAlignment eAlign)	{ pMgr->SetAlignment(eAlign); }
GetFloatingSize() const102cdf0e10cSrcweir 	Size                GetFloatingSize() const					{ return aFloatSize; }
SetFloatingSize(const Size & rSize)103cdf0e10cSrcweir 	void                SetFloatingSize(const Size& rSize)		{ aFloatSize=rSize; }
104cdf0e10cSrcweir 
105cdf0e10cSrcweir 	void                SetMinOutputSizePixel( const Size& rSize );
106cdf0e10cSrcweir 	Size                GetMinOutputSizePixel() const;
107cdf0e10cSrcweir 	virtual long		Notify( NotifyEvent& rNEvt );
108cdf0e10cSrcweir 	virtual void        FadeIn( sal_Bool );
109cdf0e10cSrcweir     void                AutoShow( sal_Bool bShow = sal_True );
110cdf0e10cSrcweir 	DECL_LINK( TimerHdl, Timer* );
111cdf0e10cSrcweir 
112cdf0e10cSrcweir //#if 0 // _SOLAR__PRIVATE
113cdf0e10cSrcweir 	SAL_DLLPRIVATE void Initialize_Impl();
114cdf0e10cSrcweir 	SAL_DLLPRIVATE sal_uInt16 GetWinBits_Impl() const;
115cdf0e10cSrcweir 	SAL_DLLPRIVATE void SetItemSize_Impl( const Size& rSize );
116cdf0e10cSrcweir 	SAL_DLLPRIVATE void Disappear_Impl();
117cdf0e10cSrcweir 	SAL_DLLPRIVATE void Reappear_Impl();
118cdf0e10cSrcweir 	SAL_DLLPRIVATE sal_Bool IsAutoHide_Impl() const;
119cdf0e10cSrcweir 	SAL_DLLPRIVATE sal_Bool IsPinned_Impl() const;
120cdf0e10cSrcweir 	SAL_DLLPRIVATE void AutoShow_Impl( sal_Bool bShow = sal_True );
121cdf0e10cSrcweir 	SAL_DLLPRIVATE void Pin_Impl( sal_Bool bPinned );
122cdf0e10cSrcweir 	SAL_DLLPRIVATE SfxSplitWindow* GetSplitWindow_Impl() const;
123cdf0e10cSrcweir     SAL_DLLPRIVATE void ReleaseChildWindow_Impl();
124cdf0e10cSrcweir //#endif
125cdf0e10cSrcweir };
126cdf0e10cSrcweir 
127cdf0e10cSrcweir class SfxDockingWrapper : public SfxChildWindow
128cdf0e10cSrcweir {
129cdf0e10cSrcweir 	public:
130cdf0e10cSrcweir 		SfxDockingWrapper( Window* pParent ,
131cdf0e10cSrcweir 						   sal_uInt16 nId ,
132cdf0e10cSrcweir 						   SfxBindings* pBindings ,
133cdf0e10cSrcweir 						   SfxChildWinInfo* pInfo );
134cdf0e10cSrcweir 
135cdf0e10cSrcweir 		SFX_DECL_CHILDWINDOW(SfxDockingWrapper);
136cdf0e10cSrcweir };
137cdf0e10cSrcweir 
138cdf0e10cSrcweir #endif // #ifndef _SFXDOCKWIN_HXX
139