38#define DOCKWIN_FLOATSTYLES (WB_SIZEABLE | WB_MOVEABLE | WB_CLOSEABLE | WB_STANDALONE)
46 sal_uInt64 mnLastTicks;
48 Timer m_aEndDockTimer;
60 virtual ~ImplDockFloatWin2()
override;
61 virtual void dispose()
override;
63 virtual void Move()
override;
64 virtual void Resize()
override;
67 virtual bool Close()
override;
75 mpDockWin( pDockingWin ),
76 mnLastTicks(
tools::
Time::GetSystemTicks() ),
77 m_aDockTimer(
"vcl::ImplDockFloatWin2 m_aDockTimer"),
78 m_aEndDockTimer(
"vcl::ImplDockFloatWin2 m_aEndDockTimer" ),
80 mnLastUserEvent( nullptr )
93 SetBackground( GetSettings().GetStyleSettings().GetFaceColor() );
95 m_aDockTimer.SetInvokeHandler(
LINK(
this, ImplDockFloatWin2, DockTimerHdl ) );
97 m_aDockTimer.SetTimeout( 50 );
99 m_aEndDockTimer.SetInvokeHandler(
LINK(
this, ImplDockFloatWin2, EndDockTimerHdl ) );
101 m_aEndDockTimer.SetTimeout( 50 );
104ImplDockFloatWin2::~ImplDockFloatWin2()
109void ImplDockFloatWin2::dispose()
111 if( mnLastUserEvent )
118 SAL_WARN_IF( !mpDockWin->IsFloatingMode(),
"vcl",
"docktimer called but not floating" );
120 PointerState aState = GetPointerState();
125 mpDockWin->GetWindow()->GetParent()->ImplGetFrameWindow()->HideTracking();
127 m_aDockTimer.Start();
131 mpDockWin->GetWindow()->GetParent()->ImplGetFrameWindow()->HideTracking();
132 mpDockWin->EndDocking( maDockRect,
false );
137 m_aDockTimer.Start();
143 SAL_WARN_IF( !mpDockWin->IsFloatingMode(),
"vcl",
"enddocktimer called but not floating" );
145 PointerState aState = GetPointerState();
148 mpDockWin->GetWindow()->GetParent()->ImplGetFrameWindow()->HideTracking();
149 mpDockWin->EndDocking( maDockRect,
true );
152 m_aEndDockTimer.Start();
158 mnLastUserEvent =
nullptr;
163 bool bRealMove =
true;
171 if( pBorder !=
this )
174 sal_Int32 nLeft, nTop, nRight, nBottom;
175 GetBorder( nLeft, nTop, nRight, nBottom );
182 bRealMove = aBorderRect.
Contains( aBorderState.maPos );
186 if( mpDockWin->GetWindow()->IsVisible() &&
198 if( ! mpDockWin->IsDocking() )
199 mpDockWin->StartDocking( aMousePos, maDockRect );
201 bool bFloatMode = mpDockWin->Docking( aMousePos, maDockRect );
206 maDockRect.SetPos( mpDockWin->GetWindow()->GetParent()->ImplGetFrameWindow()->ScreenToOutputPixel(
207 maDockRect.TopLeft() ) );
209 m_aEndDockTimer.Stop();
210 m_aDockTimer.Invoke();
214 mpDockWin->GetWindow()->GetParent()->ImplGetFrameWindow()->HideTracking();
216 m_aEndDockTimer.Invoke();
222void ImplDockFloatWin2::Move()
229 mpDockWin->GetWindow()->Move();
240 if( ! mnLastUserEvent )
244void ImplDockFloatWin2::Resize()
250 Size aSize( GetSizePixel() );
251 mpDockWin->GetWindow()->ImplPosSizeWindow( 0, 0, aSize.Width(), aSize.Height(),
PosSizeFlags::PosSize );
255void ImplDockFloatWin2::TitleButtonClick(
TitleButton nButton )
258 mpDockWin->TitleButtonClick( nButton );
261void ImplDockFloatWin2::Resizing(
Size& rSize )
264 mpDockWin->Resizing( rSize );
284 if (xWrapper && xWrapper->mpDockingWindow == pWindow)
285 return xWrapper.get();
298 return (pWrapper !=
nullptr);
313 return pWrapper && pWrapper->
IsLocked();
398 const auto& xWrapper = *it;
399 if (xWrapper && xWrapper->mpDockingWindow == pWindow)
404 auto pTemporaryOwner = std::move(*it);
438 virtual css::uno::Reference< css::accessibility::XAccessible >
CreateAccessible()
override;
443 mbToolBox( bToolBox )
469 return css::uno::Reference< css::accessibility::XAccessible >();
473 : mpDockingWindow(const_cast<
vcl::
Window*>(pWindow))
474 , mpFloatWin(nullptr)
475 , mpOldBorderWin(nullptr)
477 , maMaxOutSize( SHRT_MAX, SHRT_MAX )
487 , mbDockCanceled(false)
489 , mbLastFloatMode(false)
493 , mbStartDockingEnabled(false)
587 if ( aFrameMousePos.
X() < 0 )
588 aFrameMousePos.
setX( 0 );
589 if ( aFrameMousePos.
Y() < 0 )
590 aFrameMousePos.
setY( 0 );
591 if ( aFrameMousePos.
X() > aFrameSize.
Width()-1 )
592 aFrameMousePos.
setX( aFrameSize.
Width()-1 );
593 if ( aFrameMousePos.
Y() > aFrameSize.
Height()-1 )
604 bool bFloatMode =
Docking( aPos, aTrackRect );
617 if ( aCompRect == aTrackRect )
713 bool bFloating =
true;
783 pWin->SetText( xWindow->
GetText() );
799 pWin->mpWindowImpl->mpClientWindow = xWindow;
855 if ( mpOldBorderWin )
868 auto xFloatWin = std::move(mpFloatWin);
869 maPopupModeEndHdl.Call(xFloatWin);
870 xFloatWin.disposeAndClear();
934 pWin->SetPosPixel(
Point() );
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
Post a user event to the default window.
static void RemoveUserEvent(ImplSVEvent *nUserEvent)
Remove user event based on event ID.
void RemoveWindow(const vcl::Window *pWin)
void Lock(const vcl::Window *pWin)
bool IsInPopupMode(const vcl::Window *pWin)
bool IsDockable(const vcl::Window *pWin)
std::vector< std::unique_ptr< ImplDockingWindowWrapper, o3tl::default_delete< ImplDockingWindowWrapper > > > mvDockingWindows
bool IsFloating(const vcl::Window *pWin)
void Unlock(const vcl::Window *pWin)
void SetFloatingMode(const vcl::Window *pWin, bool bFloating)
void EndPopupMode(const vcl::Window *pWin)
void SetPosSizePixel(vcl::Window const *pWin, tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags)
void AddWindow(const vcl::Window *pWin)
SystemWindow * GetFloatingWindow(const vcl::Window *pWin)
ImplDockingWindowWrapper * GetDockingWindowWrapper(const vcl::Window *pWin)
tools::Rectangle GetPosSizePixel(const vcl::Window *pWin)
bool IsLocked(const vcl::Window *pWin)
void StartPopupMode(const vcl::Window *pWin, const tools::Rectangle &rRect, FloatWinPopupFlags nPopupModeFlags)
void SetPopupModeEndHdl(const vcl::Window *pWindow, const Link< FloatingWindow *, void > &rLink)
virtual void Resizing(Size &rSize)
WinBits GetFloatStyle() const
void StartPopupMode(const tools::Rectangle &rRect, FloatWinPopupFlags nFlags)
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
bool IsInPopupMode() const
virtual void Resize() override
ImplDockingWindowWrapper.
void SetDragArea(const tools::Rectangle &rRect)
void ToggleFloatingMode()
void StartPopupMode(const tools::Rectangle &rRect, FloatWinPopupFlags nPopupModeFlags)
void SetFloatStyle(WinBits nWinStyle)
tools::Rectangle maDragArea
bool Docking(const Point &rPos, tools::Rectangle &rRect)
void ShowMenuTitleButton(bool bVisible)
vcl::Window * GetWindow()
bool IsInPopupMode() const
bool IsFloatingMode() const
Size GetSizePixel() const
~ImplDockingWindowWrapper()
void SetMinOutputSizePixel(const Size &rSize)
SystemWindow * GetFloatingWindow() const
tools::Long mnTrackHeight
bool PrepareToggleFloatingMode()
void SetPopupModeEndHdl(const Link< FloatingWindow *, void > &rLink)
VclPtr< vcl::Window > mpDockingWindow
VclPtr< vcl::Window > mpParent
void TitleButtonClick(TitleButton nButton)
ImplDockingWindowWrapper(const vcl::Window *pWindow)
void Resizing(Size &rSize)
void EndDocking(const tools::Rectangle &rRect, bool bFloatMode)
void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags)
void StartDocking(const Point &rPos, tools::Rectangle const &rRect)
VclPtr< FloatingWindow > mpFloatWin
void SetFloatingMode(bool bFloatMode)
Point GetPosPixel() const
VclPtr< vcl::Window > mpOldBorderWin
bool mbStartDockingEnabled
void SetMaxOutputSizePixel(const Size &rSize)
void ImplStartDocking(const Point &rPos)
void Tracking(const TrackingEvent &rTEvt)
bool IsDockingCanceled() const
void ImplPreparePopupMode()
const Point & GetPosPixel() const
bool IsModifierChanged() const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
static bool GetDockingFloatsSupported()
const Size & GetMinOutputSizePixel() const
void SetMinOutputSizePixel(const Size &rSize)
void ShowTitleButton(TitleButton nButton, bool bVisible)
virtual void Resizing(Size &rSize)
bool IsTitleButtonVisible(TitleButton nButton) const
virtual void TitleButtonClick(TitleButton nButton)
const Size & GetMaxOutputSizePixel() const
void SetMaxOutputSizePixel(const Size &rSize)
virtual void Resize() override
bool IsTrackingEnded() const
bool IsTrackingCanceled() const
const MouseEvent & GetMouseEvent() const
A construction helper for a temporary VclPtr.
reference_type * get() const
Get the body.
static VclPtr< reference_type > Create(Arg &&... arg)
A construction helper for VclPtr.
Point AbsoluteScreenToOutputPixel(const Point &rPos) const
Point OutputToScreenPixel(const Point &rPos) const
SAL_DLLPRIVATE void ImplUpdateAll()
void StartTracking(StartTrackingFlags nFlags=StartTrackingFlags::NONE)
vcl::Window * GetParent() const
ActivateModeFlags GetActivateMode() const
bool IsInputEnabled() const
WindowType GetType() const
void GetBorder(sal_Int32 &rLeftBorder, sal_Int32 &rTopBorder, sal_Int32 &rRightBorder, sal_Int32 &rBottomBorder) const
vcl::Window * GetWindow(GetWindowType nType) const
PointerState GetPointerState()
virtual Point GetPosPixel() const
void SetParent(vcl::Window *pNewParent)
virtual void SetOutputSizePixel(const Size &rNewSize)
const AllSettings & GetSettings() const
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
virtual void KeyInput(const KeyEvent &rKEvt)
void ShowTracking(const tools::Rectangle &rRect, ShowTrackFlags nFlags=ShowTrackFlags::Small)
virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags=PosSizeFlags::All)
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible()
bool IsAlwaysOnTopEnabled() const
void SetSettings(const AllSettings &rSettings)
std::unique_ptr< WindowImpl > mpWindowImpl
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
virtual void SetPosPixel(const Point &rNewPos)
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
virtual OUString GetText() const
Point ScreenToOutputPixel(const Point &rPos) const
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
bool IsAlwaysEnableInput() const
returns the current AlwaysEnableInput state
DECL_LINK(CheckNameHdl, SvxNameDialog &, bool)
#define DOCKWIN_FLOATSTYLES
IMPL_LINK_NOARG(ImplDockFloatWin2, DockTimerHdl, Timer *, void)
RegionData_Impl * mpParent
constexpr sal_uInt16 KEY_MOD1
constexpr sal_uInt16 KEY_HOME
#define LINK(Instance, Class, Member)
#define SAL_WARN_IF(condition, area, stream)
constexpr OUStringLiteral aData
tools::Rectangle maTrackRect
@ HIGH_IDLE
Important idle events to be run before processing drawing events.
@ MakeClientWindowVisibleBeforePopup
@ WindowPrepareToggleFloating
WinBits const WB_CLOSEABLE
WinBits const WB_MOVEABLE
WinBits const WB_OWNERDRAWDECORATION
WinBits const WB_SIZEABLE
WinBits const WB_SYSTEMWINDOW
WinBits const WB_STDPOPUP
WinBits const WB_NOSHADOW