39#define DOCKWIN_FLOATSTYLES (WB_SIZEABLE | WB_MOVEABLE | WB_CLOSEABLE | WB_STANDALONE)
62 sal_uInt64 mnLastTicks;
74 virtual ~ImplDockFloatWin()
override;
75 virtual void dispose()
override;
77 virtual void Move()
override;
78 virtual void Resize()
override;
80 virtual bool Close()
override;
88 mpDockWin( pDockingWin ),
89 mnLastTicks(
tools::
Time::GetSystemTicks() ),
90 maDockIdle(
"vcl::ImplDockFloatWin maDockIdle" ),
92 mnLastUserEvent( nullptr )
107 maDockIdle.SetInvokeHandler(
LINK(
this, ImplDockFloatWin, DockTimerHdl ) );
111ImplDockFloatWin::~ImplDockFloatWin()
116void ImplDockFloatWin::dispose()
118 if( mnLastUserEvent )
129 SAL_WARN_IF( !mpDockWin->IsFloatingMode(),
"vcl",
"docktimer called but not floating" );
137 mpDockWin->GetParent()->ImplGetFrameWindow()->HideTracking();
138 mpDockWin->EndDocking( maDockRect,
true );
144 mpDockWin->GetParent()->ImplGetFrameWindow()->HideTracking();
145 mpDockWin->EndDocking( maDockRect,
false );
156 PointerState aState = mpDockWin->GetParent()->GetPointerState();
158 mnLastUserEvent =
nullptr;
159 if( mpDockWin->IsDockable() &&
167 if( ! mpDockWin->IsDocking() )
168 mpDockWin->StartDocking();
172 Point aMousePos = mpDockWin->GetParent()->OutputToScreenPixel( aState.maPos );
174 bool bFloatMode = mpDockWin->Docking( aMousePos, maDockRect );
178 DockTimerHdl(
nullptr );
182 mpDockWin->GetParent()->ImplGetFrameWindow()->HideTracking();
184 mpDockWin->EndDocking( maDockRect,
true );
190void ImplDockFloatWin::Move()
208 if( ! mnLastUserEvent )
212void ImplDockFloatWin::Resize()
219void ImplDockFloatWin::Resizing(
Size& rSize )
222 mpDockWin->Resizing( rSize );
227 return mpDockWin->Close();
251 Size aSize = Window::GetOutputSizePixel();
323 Window::ImplInit( pParent, nStyle,
nullptr );
340 else if ( Window::GetStyle() &
WB_3DLOOK )
356 maLayoutIdle( pIdleDebugName )
372 const css::uno::Reference<css::frame::XFrame> &rFrame)
380 const OUString& rUIXMLDescription,
const char* pIdleDebugName,
381 const css::uno::Reference<css::frame::XFrame> &rFrame)
383 maLayoutIdle( pIdleDebugName )
387 loadUI(pParent, rID, rUIXMLDescription, rFrame);
413 return Window::Tracking( rTEvt );
450 if ( aFrameMousePos.
X() < 0 )
451 aFrameMousePos.
setX( 0 );
452 if ( aFrameMousePos.
Y() < 0 )
453 aFrameMousePos.
setY( 0 );
454 if ( aFrameMousePos.
X() > aFrameSize.
Width()-1 )
455 aFrameMousePos.
setX( aFrameSize.
Width()-1 );
456 if ( aFrameMousePos.
Y() > aFrameSize.
Height()-1 )
468 bool bFloatMode =
Docking( aFramePos, aTrackRect );
480 if ( aCompRect == aTrackRect )
528 return Window::EventNotify( rNEvt );
539 if (!bDockingSupportCrippled && pMEvt->
IsMod1() && (pMEvt->
GetClicks() == 2) )
555 if ( pWindow !=
this )
570 rKey.
IsShift() && rKey.
IsMod1() && !bDockingSupportCrippled )
580 return Window::EventNotify( rNEvt );
613 Window::SetPosSizePixel( aPos, rRect.
GetSize() );
649 if (
GetSettings().GetStyleSettings().GetAutoMnemonic())
655 setDeferredProperties();
683 Window::StateChanged(
nType );
695 Window::DataChanged( rDCEvt );
719 setDeferredProperties();
749 pWin->mpWindowImpl->mpClientWindow =
this;
751 pWin->SetText( Window::GetText() );
752 Size aSize(Window::GetSizePixel());
753 pWin->SetOutputSizePixel(aSize);
760 pWin->SetMaxOutputSizePixel(
mpImplData->maMaxOutSize );
830 Window::setPosSizePixel( nX, nY, nWidth, nHeight, nFlags );
835 Window::setPosSizePixel( nX, nY, nWidth, nHeight, nFlags );
857 return Window::GetPosPixel();
863 return Window::GetPosPixel();
874 return Window::GetSizePixel();
880 return Window::GetSizePixel();
891 Window::SetOutputSizePixel( rNewSize );
898 Window::SetOutputSizePixel( rNewSize );
909 return Window::GetOutputSizePixel();
915 return Window::GetOutputSizePixel();
969 setDeferredProperties();
970 Window::SetText(rStr);
976 return Window::GetText();
1020 return Window::GetOptimalSize();
1036 bool bTriggerLayout =
true;
1039 bTriggerLayout =
false;
1043 bTriggerLayout =
false;
1060 setPosSizeOnContainee();
1092 !bTearable ? OUString(
"InterimDockParent") : OUString(
"InterimTearableParent"),
1093 !bTearable ? OUString(
"vcl/ui/interimdockparent.ui") : OUString(
"vcl/ui/interimtearableparent.ui"),
1094 "vcl::DropdownDockingWindow maLayoutIdle",
1096 , m_xBox(m_pUIBuilder->
get(
"box"))
1112 :
DockingWindow(pParent,
"DockingWindow",
"vcl/ui/dockingwindow.ui",
"vcl::ResizableDockingWindow maLayoutIdle", rFrame)
1113 , m_xBox(m_pUIBuilder->
get(
"box"))
1118 :
DockingWindow(pParent, nStyle,
"vcl::ResizableDockingWindow maLayoutIdle")
const StyleSettings & GetStyleSettings() const
static OUString GetUIRootDir()
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.
DataChangedEventType GetType() const
AllSettingsFlags GetFlags() const
ImplDockingWindowWrapper * GetDockingWindowWrapper(const vcl::Window *pWin)
VclPtr< vcl::Window > mpParent
Point GetFloatingPos() const
virtual bool PrepareToggleFloatingMode()
void SetMinOutputSizePixel(const Size &rSize)
SAL_DLLPRIVATE void ImplInitDockingWindowData()
void SetOutputSizePixel(const Size &rNewSize) override
Point GetPosPixel() const override
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
SAL_DLLPRIVATE void setPosSizeOnContainee()
bool IsFloatingMode() const
virtual void Resizing(Size &rSize)
std::unique_ptr< ImplData > mpImplData
virtual OUString GetText() const override
void SetFloatingMode(bool bFloatMode)
tools::Long mnTrackHeight
virtual void SetText(const OUString &rStr) override
virtual void StateChanged(StateChangedType nType) override
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle)
virtual Size GetOptimalSize() const override
Size GetSizePixel() const override
void SetFloatStyle(WinBits nWinStyle)
virtual void StartDocking()
virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags=PosSizeFlags::All) override
virtual bool EventNotify(NotifyEvent &rNEvt) override
virtual ~DockingWindow() override
const Size & GetMinOutputSizePixel() const
Size GetOutputSizePixel() const
virtual void EndDocking(const tools::Rectangle &rRect, bool bFloatMode)
SystemWindow * GetFloatingWindow() const
virtual bool Docking(const Point &rPos, tools::Rectangle &rRect)
VclPtr< FloatingWindow > mpFloatWin
void SetMaxOutputSizePixel(const Size &rSize)
SAL_DLLPRIVATE void DoInitialLayout()
void SetFloatingPos(const Point &rNewPos)
WinBits GetFloatStyle() const
void loadUI(vcl::Window *pParent, const OUString &rID, const OUString &rUIXMLDescription, const css::uno::Reference< css::frame::XFrame > &rFrame)
virtual void Tracking(const TrackingEvent &rTEvt) override
bool IsDockingCanceled() const
DockingWindow(const DockingWindow &)=delete
SAL_DLLPRIVATE void ImplInitSettings()
VclPtr< vcl::Window > mpOldBorderWin
VclPtr< vcl::Window > mpDialogParent
bool mbIsCalculatingInitialLayoutSize
bool isLayoutEnabled() const
void ImplStartDocking(const Point &rPos)
void setOptimalLayoutSize()
virtual void ToggleFloatingMode()
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout) override
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
virtual void doDeferredInit(WinBits nBits)
DropdownDockingWindow(vcl::Window *pParent, const css::uno::Reference< css::frame::XFrame > &rFrame=css::uno::Reference< css::frame::XFrame >(), bool bTearable=false)
VclPtr< vcl::Window > m_xBox
virtual ~DropdownDockingWindow() override
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
An idle is a timer to be scheduled immediately.
virtual void Start(bool bStartTimer=true) override
Schedules the task for execution.
ImplDockingWindowWrapper.
void SetFloatStyle(WinBits nWinStyle)
bool IsFloatingMode() const
WinBits GetFloatStyle() const
VclPtr< FloatingWindow > mpFloatWin
void SetFloatingMode(bool bFloatMode)
const vcl::KeyCode & GetKeyCode() const
sal_uInt16 GetClicks() const
const Point & GetPosPixel() const
bool IsModifierChanged() const
const KeyEvent * GetKeyEvent() const
vcl::Window * GetWindow() const
const MouseEvent * GetMouseEvent() const
NotifyEventType GetType() const
virtual void SetSettings(const AllSettings &rSettings)
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
VclPtr< vcl::Window > m_xBox
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
virtual ~ResizableDockingWindow() override
void InvalidateChildSizeCache()
ResizableDockingWindow(vcl::Window *pParent, const css::uno::Reference< css::frame::XFrame > &rFrame=css::uno::Reference< css::frame::XFrame >())
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
const Color & GetWindowColor() const
static bool GetDockingFloatsSupported()
const Color & GetFaceColor() const
const Size & GetMinOutputSizePixel() const
void SetMinOutputSizePixel(const Size &rSize)
virtual void Resizing(Size &rSize)
bool IsTitleButtonVisible(TitleButton nButton) const
const Size & GetMaxOutputSizePixel() const
void SetMaxOutputSizePixel(const Size &rSize)
OUString GetWindowState(vcl::WindowDataMask nMask=vcl::WindowDataMask::All) const
virtual void Resize() override
void SetPriority(TaskPriority ePriority)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
bool IsTrackingEnded() const
bool IsTrackingCanceled() const
const MouseEvent & GetMouseEvent() const
Creates a hierarchy of vcl::Windows (widgets) from a .ui file for dialogs, sidebar,...
static void setLayoutAllocation(vcl::Window &rWindow, const Point &rPos, const Size &rSize)
static Size getLayoutRequisition(const vcl::Window &rWindow)
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.
sal_uInt16 GetCode() const
sal_uInt16 GetModifier() const
Point AbsoluteScreenToOutputPixel(const Point &rPos) const
Point OutputToScreenPixel(const Point &rPos) const
SAL_DLLPRIVATE void ImplUpdateAll()
void SetActivateMode(ActivateModeFlags nMode)
void StartTracking(StartTrackingFlags nFlags=StartTrackingFlags::NONE)
vcl::Window * GetParent() const
void EnableAlwaysOnTop(bool bEnable=true)
ActivateModeFlags GetActivateMode() const
bool IsInputEnabled() const
tools::Rectangle GetDesktopRectPixel() const
bool IsBackground() const
const OUString & get_id() const
Get the ID of the window.
static DockingManager * GetDockingManager()
void GetBorder(sal_Int32 &rLeftBorder, sal_Int32 &rTopBorder, sal_Int32 &rRightBorder, sal_Int32 &rBottomBorder) const
Size get_preferred_size() const
vcl::Window * GetWindow(GetWindowType nType) const
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout)
PointerState GetPointerState()
virtual Point GetPosPixel() const
void SetParent(vcl::Window *pNewParent)
void Enable(bool bEnable=true, bool bChild=true)
bool IsCreatedWithToolkit() const
virtual void SetOutputSizePixel(const Size &rNewSize)
const AllSettings & GetSettings() const
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
void ShowTracking(const tools::Rectangle &rRect, ShowTrackFlags nFlags=ShowTrackFlags::Small)
void ToTop(ToTopFlags nFlags=ToTopFlags::NONE)
::OutputDevice const * GetOutDev() const
bool IsAlwaysOnTopEnabled() const
std::unique_ptr< WindowImpl > mpWindowImpl
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
bool IsControlBackground() const
const Color & GetControlBackground() const
void AlwaysEnableInput(bool bAlways, bool bChild=true)
Override EnableInput.
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
virtual void SetPosPixel(const Point &rNewPos)
Point OutputToAbsoluteScreenPixel(const Point &rPos) const
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
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
void EnableInput(bool bEnable=true, bool bChild=true)
void InvalidateSizeCache()
clear OptimalSize cache
Size bestmaxFrameSizeForScreenSize(const Size &rScreenSize)
void GenerateAutoMnemonicsOnHierarchy(const vcl::Window *pWindow)
DECL_LINK(CheckNameHdl, SvxNameDialog &, bool)
#define DOCKWIN_FLOATSTYLES
IMPL_LINK_NOARG(ImplDockFloatWin, DockTimerHdl, Timer *, void)
constexpr sal_uInt16 KEY_MOD1
constexpr sal_uInt16 KEY_F10
bool isLayoutEnabled(const vcl::Window *pWindow)
#define LINK(Instance, Class, Member)
#define SAL_WARN_IF(condition, area, stream)
constexpr OUStringLiteral aData
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
DockingManager * ImplGetDockingManager()
@ RESIZE
Resize runs before repaint, so we won't paint twice.
@ HIGH_IDLE
Important idle events to be run before processing drawing events.
WinBits const WB_CLOSEABLE
WinBits const WB_MOVEABLE
WinBits const WB_DIALOGCONTROL
WinBits const WB_DOCKABLE
WinBits const WB_SIZEABLE
WinBits const WB_SYSTEMWINDOW
WinBits const WB_NODIALOGCONTROL