1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_SFX2_DOCKWIN_HXX
20 #define INCLUDED_SFX2_DOCKWIN_HXX
22 #include <sal/config.h>
23 #include <sal/types.h>
24 #include <vcl/dockwin.hxx>
26 #include <com/sun/star/uno/Reference.hxx>
27 #include <com/sun/star/awt/XWindow.hpp>
28 #include <com/sun/star/frame/XFrame.hpp>
30 #include <sfx2/dllapi.h>
31 #include <sfx2/childwin.hxx>
34 class SfxDockingWindow_Impl
;
36 void SFX2_DLLPUBLIC SAL_CALL
SfxDockingWindowFactory( const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& rFrame
, const OUString
& rDockingWindowName
);
37 bool SFX2_DLLPUBLIC SAL_CALL
IsDockingWindowVisible( const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XFrame
>& rFrame
, const OUString
& rDockingWindowName
);
39 class SFX2_DLLPUBLIC SfxDockingWindow
: public DockingWindow
44 SfxBindings
* pBindings
;
47 SfxDockingWindow_Impl
* pImp
;
49 SfxDockingWindow(SfxDockingWindow
&) SAL_DELETED_FUNCTION
;
50 void operator =(SfxDockingWindow
&) SAL_DELETED_FUNCTION
;
53 SfxChildAlignment
CalcAlignment(const Point
& rPos
, Rectangle
& rRect
);
54 void CalcSplitPosition(const Point rPos
, Rectangle
& rRect
,
55 SfxChildAlignment eAlign
);
56 virtual Size
CalcDockingSize(SfxChildAlignment
);
57 virtual SfxChildAlignment
58 CheckAlignment(SfxChildAlignment
,SfxChildAlignment
);
60 virtual void Resize() SAL_OVERRIDE
;
61 virtual bool PrepareToggleFloatingMode() SAL_OVERRIDE
;
62 virtual void ToggleFloatingMode() SAL_OVERRIDE
;
63 virtual void StartDocking() SAL_OVERRIDE
;
64 virtual bool Docking( const Point
& rPos
, Rectangle
& rRect
) SAL_OVERRIDE
;
65 virtual void EndDocking( const Rectangle
& rRect
, bool bFloatMode
) SAL_OVERRIDE
;
66 virtual void Resizing( Size
& rSize
) SAL_OVERRIDE
;
67 virtual void Paint( vcl::RenderContext
& rRenderContext
, const Rectangle
& rRect
) SAL_OVERRIDE
;
68 virtual bool Close() SAL_OVERRIDE
;
69 virtual void Move() SAL_OVERRIDE
;
71 SAL_DLLPRIVATE SfxChildWindow
* GetChildWindow_Impl() { return pMgr
; }
74 SfxDockingWindow( SfxBindings
*pBindings
,
78 SfxDockingWindow( SfxBindings
*pBindings
,
82 SfxDockingWindow( SfxBindings
*pBindings
,
85 const OString
& rID
, const OUString
& rUIXMLDescription
);
86 virtual ~SfxDockingWindow();
87 virtual void dispose() SAL_OVERRIDE
;
89 void Initialize (SfxChildWinInfo
* pInfo
);
90 virtual void FillInfo(SfxChildWinInfo
&) const;
91 virtual void StateChanged( StateChangedType nStateChange
) SAL_OVERRIDE
;
93 void SetDockingRects(const Rectangle
& rOuter
, const Rectangle
& rInner
)
94 { aInnerRect
= rInner
; aOuterRect
= rOuter
; }
95 const Rectangle
& GetInnerRect() const { return aInnerRect
; }
96 const Rectangle
& GetOuterRect() const { return aOuterRect
; }
97 SfxBindings
& GetBindings() const { return *pBindings
; }
98 sal_uInt16
GetType() const { return pMgr
->GetType(); }
99 SfxChildAlignment
GetAlignment() const { return pMgr
->GetAlignment(); }
100 void SetAlignment(SfxChildAlignment eAlign
) { pMgr
->SetAlignment(eAlign
); }
101 Size
GetFloatingSize() const { return aFloatSize
; }
102 void SetFloatingSize(const Size
& rSize
) { aFloatSize
=rSize
; }
104 void SetMinOutputSizePixel( const Size
& rSize
);
105 Size
GetMinOutputSizePixel() const;
106 virtual bool Notify( NotifyEvent
& rNEvt
) SAL_OVERRIDE
;
107 DECL_LINK_TYPED(TimerHdl
, Idle
*, void);
109 SAL_DLLPRIVATE
void Initialize_Impl();
110 SAL_DLLPRIVATE sal_uInt16
GetWinBits_Impl() const;
111 SAL_DLLPRIVATE
void SetItemSize_Impl( const Size
& rSize
);
112 SAL_DLLPRIVATE
void Disappear_Impl();
113 SAL_DLLPRIVATE
void Reappear_Impl();
114 SAL_DLLPRIVATE
bool IsAutoHide_Impl() const;
115 SAL_DLLPRIVATE
void AutoShow_Impl( bool bShow
= true );
116 SAL_DLLPRIVATE
void Pin_Impl( bool bPinned
);
117 SAL_DLLPRIVATE
void ReleaseChildWindow_Impl();
120 class SfxDockingWrapper
: public SfxChildWindow
123 SfxDockingWrapper( vcl::Window
* pParent
,
125 SfxBindings
* pBindings
,
126 SfxChildWinInfo
* pInfo
);
128 SFX_DECL_CHILDWINDOW(SfxDockingWrapper
);
131 #endif // INCLUDED_SFX2_DOCKWIN_HXX
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */