LibreOffice Module sfx2 (master) 1
dockwin.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#ifndef INCLUDED_SFX2_DOCKWIN_HXX
20#define INCLUDED_SFX2_DOCKWIN_HXX
21
22#include <memory>
23#include <sal/config.h>
24#include <sal/types.h>
25#include <vcl/dockwin.hxx>
26
27#include <com/sun/star/uno/Reference.hxx>
28
29#include <sfx2/dllapi.h>
30#include <sfx2/childwin.hxx>
31
32namespace com::sun::star::frame { class XFrame; }
33
35enum class SplitWindowItemFlags;
36
37void SfxDockingWindowFactory( const css::uno::Reference< css::frame::XFrame >& rFrame, std::u16string_view rDockingWindowName );
38bool IsDockingWindowVisible( const css::uno::Reference< css::frame::XFrame >& rFrame, std::u16string_view rDockingWindowName );
39
41{
42protected:
43 std::unique_ptr<weld::Builder> m_xBuilder;
44 std::unique_ptr<weld::Box> m_xContainer;
45
46private:
52 std::unique_ptr< SfxDockingWindow_Impl > pImpl;
53
56
57protected:
58 SfxChildAlignment CalcAlignment(const Point& rPos, tools::Rectangle& rRect );
59 virtual Size CalcDockingSize(SfxChildAlignment);
60 virtual SfxChildAlignment
62
63 virtual void Resize() override;
64 virtual bool PrepareToggleFloatingMode() override;
65 virtual void ToggleFloatingMode() override;
66 virtual void StartDocking() override;
67 virtual bool Docking( const Point& rPos, tools::Rectangle& rRect ) override;
68 virtual void EndDocking( const tools::Rectangle& rRect, bool bFloatMode ) override;
69 virtual void Resizing( Size& rSize ) override;
70 virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect ) override;
71 virtual bool Close() override;
72 virtual void Move() override;
73
74 SAL_DLLPRIVATE SfxChildWindow* GetChildWindow_Impl() { return pMgr; }
75
76public:
77 SfxDockingWindow( SfxBindings *pBindings,
78 SfxChildWindow *pCW,
79 vcl::Window* pParent,
80 WinBits nWinBits);
81 SfxDockingWindow( SfxBindings *pBindings,
82 SfxChildWindow *pCW,
83 vcl::Window* pParent,
84 const OUString& rID, const OUString& rUIXMLDescription );
85 virtual ~SfxDockingWindow() override;
86 virtual void dispose() override;
87
88 void Initialize (SfxChildWinInfo* pInfo);
89 virtual void FillInfo(SfxChildWinInfo&) const;
90 virtual void StateChanged( StateChangedType nStateChange ) override;
91
92 void SetDockingRects(const tools::Rectangle& rOuter, const tools::Rectangle& rInner)
93 { aInnerRect = rInner; aOuterRect = rOuter; }
94 const tools::Rectangle& GetInnerRect() const { return aInnerRect; }
95 const tools::Rectangle& GetOuterRect() const { return aOuterRect; }
96 SfxBindings& GetBindings() const { return *pBindings; }
97 sal_uInt16 GetType() const { return pMgr->GetType(); }
98 SfxChildAlignment GetAlignment() const { return pMgr->GetAlignment(); }
99 void SetAlignment(SfxChildAlignment eAlign) { pMgr->SetAlignment(eAlign); }
100 const Size& GetFloatingSize() const { return aFloatSize; }
101 void SetFloatingSize(const Size& rSize) { aFloatSize=rSize; }
102
103 void SetMinOutputSizePixel( const Size& rSize );
104 const Size& GetMinOutputSizePixel() const;
105 virtual bool EventNotify( NotifyEvent& rNEvt ) override;
106 DECL_DLLPRIVATE_LINK(TimerHdl, Timer *, void);
107
108 SAL_DLLPRIVATE void Initialize_Impl();
109 SAL_DLLPRIVATE void SetItemSize_Impl( const Size& rSize );
110 SAL_DLLPRIVATE void Disappear_Impl();
111 SAL_DLLPRIVATE void Reappear_Impl();
112 SAL_DLLPRIVATE bool IsAutoHide_Impl() const;
113 SAL_DLLPRIVATE void AutoShow_Impl();
114 SAL_DLLPRIVATE void ReleaseChildWindow_Impl();
115};
116
118{
119 public:
121 sal_uInt16 nId ,
122 SfxBindings* pBindings ,
123 SfxChildWinInfo* pInfo );
124
126};
127
128#endif // INCLUDED_SFX2_DOCKWIN_HXX
129
130/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxChildAlignment
Definition: chalign.hxx:27
virtual bool PrepareToggleFloatingMode()
void SetMinOutputSizePixel(const Size &rSize)
virtual void Resizing(Size &rSize)
virtual void StateChanged(StateChangedType nType) override
virtual void StartDocking()
virtual bool EventNotify(NotifyEvent &rNEvt) override
const Size & GetMinOutputSizePixel() const
virtual void EndDocking(const tools::Rectangle &rRect, bool bFloatMode)
virtual bool Docking(const Point &rPos, tools::Rectangle &rRect)
DockingWindow & operator=(const DockingWindow &)=delete
virtual bool Close()
virtual void ToggleFloatingMode()
virtual void dispose() override
sal_uInt16 GetType() const
Definition: childwin.hxx:131
void SetAlignment(SfxChildAlignment eAlign)
Definition: childwin.cxx:299
SfxChildAlignment GetAlignment() const
Definition: childwin.hxx:125
VclPtr< vcl::Window > pParent
Definition: childwin.hxx:101
std::unique_ptr< weld::Box > m_xContainer
Definition: dockwin.hxx:44
SfxDockingWindow(SfxDockingWindow const &)=delete
tools::Rectangle aInnerRect
Definition: dockwin.hxx:47
tools::Rectangle aOuterRect
Definition: dockwin.hxx:48
SfxBindings & GetBindings() const
Definition: dockwin.hxx:96
std::unique_ptr< weld::Builder > m_xBuilder
Definition: dockwin.hxx:43
SfxBindings * pBindings
Definition: dockwin.hxx:49
const tools::Rectangle & GetOuterRect() const
Definition: dockwin.hxx:95
SfxChildAlignment GetAlignment() const
Definition: dockwin.hxx:98
void SetAlignment(SfxChildAlignment eAlign)
Definition: dockwin.hxx:99
void SetFloatingSize(const Size &rSize)
Definition: dockwin.hxx:101
void SetDockingRects(const tools::Rectangle &rOuter, const tools::Rectangle &rInner)
Definition: dockwin.hxx:92
const Size & GetFloatingSize() const
Definition: dockwin.hxx:100
SAL_DLLPRIVATE SfxChildWindow * GetChildWindow_Impl()
Definition: dockwin.hxx:74
std::unique_ptr< SfxDockingWindow_Impl > pImpl
Definition: dockwin.hxx:52
sal_uInt16 GetType() const
Definition: dockwin.hxx:97
const tools::Rectangle & GetInnerRect() const
Definition: dockwin.hxx:94
SfxChildWindow * pMgr
Definition: dockwin.hxx:51
DECL_DLLPRIVATE_LINK(TimerHdl, Timer *, void)
SFX_DECL_CHILDWINDOW(SfxDockingWrapper)
SfxDockingWrapper(vcl::Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo *pInfo)
Definition: dockwin.cxx:123
virtual void Resize()
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
virtual void Move()
#define SFX2_DLLPUBLIC
Definition: dllapi.h:29
bool IsDockingWindowVisible(const css::uno::Reference< css::frame::XFrame > &rFrame, std::u16string_view rDockingWindowName)
void SfxDockingWindowFactory(const css::uno::Reference< css::frame::XFrame > &rFrame, std::u16string_view rDockingWindowName)
sal_Int16 nId
SplitWindowItemFlags
StateChangedType
sal_Int64 WinBits