66 SAL_WARN_IF(!pParent,
"vcl",
"FloatWindow::FloatingWindow(): - pParent == NULL!");
71 SAL_WARN_IF(!pParent,
"vcl",
"FloatWindow::FloatingWindow(): - pParent == NULL and no AppWindow exists");
88 WinBits nFloatWinStyle = nStyle;
159 , mpNextFloat(nullptr)
160 , mpFirstPopupModeWin(nullptr)
165 , mbInPopupMode(false)
167 , mbPopupModeCanceled(false)
168 , mbPopupModeTearOff(false)
173 loadUI(pParent, rID, rUIXMLDescription, rFrame);
233 sal_uInt16& rArrangeIndex,
Point* pLOKTwipsPos)
263 sal_uInt16 nArrangeAttempts = 5;
289 nArrangeAttempts = 3;
305 nArrangeAttempts = 3;
315 sal_uInt16 nArrangeIndex = 0;
318 for ( ; nArrangeIndex < nArrangeAttempts; nArrangeIndex++ )
321 switch ( nArrangeAry[nArrangeIndex] )
335 if ( aPos.
X() < aScreenRect.
Left() )
338 if (bBreak || bLOKActive)
354 if( (devRectRTL.
Left() - aSize.
Width()) < aScreenRect.
Left() )
359 if ( aPos.
X()+aSize.
Width() > aScreenRect.
Right() )
362 if (bBreak || bLOKActive)
376 if ( aPos.
Y() < aScreenRect.
Top() )
378 if (bBreak || bLOKActive)
393 if (bBreak || bLOKActive)
420 if ( aPos.
Y() < aScreenRect.
Top() )
421 aPos.
setY( aScreenRect.
Top() );
431 else if ( aPos.
X()+aSize.
Width() > aScreenRect.
Right() )
434 if ( aPos.
X() < aScreenRect.
Left() )
443 if (nArrangeIndex >= nArrangeAttempts)
444 nArrangeIndex = nArrangeAttempts - 1;
446 rArrangeIndex = nArrangeIndex;
451 if( pFloatingWindow && pFloatingWindow->
mpImplData->mpBox )
453 pFloatingWindow->
mpImplData->maItemEdgeClipRect =
457 if (bLOKActive && pLOKTwipsPos)
483 Point aAbsolute( rPos );
491 pWindowOutDev->
ReMirror( aAbsolute );
515 pParentWinOutDev->
ReMirror(aFloatRect);
540 pParentWinOutDev->
ReMirror(aFloatRect);
551 rbHitTestInsideRect =
false;
566 if ( devRect.
Contains( aAbsolute ) )
578 rbHitTestInsideRect =
true;
597 pLastFoundWin = pWin;
603 return pLastFoundWin;
641 sal_uInt16 nKeyCode = aKeyCode.
GetCode();
659 std::vector<vcl::LOKPayloadItem> aPayload
661 std::make_pair(OString(
"rectangle"), aRect.
toString())
682 std::vector<vcl::LOKPayloadItem> aItems;
689 aItems.emplace_back(
"type",
"dropdown");
691 aItems.emplace_back(
"type",
"dialog");
692 aItems.emplace_back(
"position",
mpImplData->maLOKTwipsPos.toString());
698 aItems.emplace_back(
"type",
"tooltip");
700 aItems.emplace_back(
"type",
"child");
702 aItems.emplace_back(
"parentId", OString::number(pParent->
GetLOKWindowId()));
704 aItems.emplace_back(
"position",
mpImplData->maPos.toString());
792 sal_uInt16 nArrangeIndex;
894 std::vector<VclPtr<FloatingWindow>> aCancelFloats;
897 pFloat !=
nullptr && pFloat !=
this;
899 aCancelFloats.push_back(pFloat);
900 for (
auto & it : aCancelFloats)
919 Window::EndSaveFocus(xFocusId);
936 mpImplData->mpBox->ImplFloatControl(
false,
this );
981 pWin->ImplCallMove();
const StyleSettings & GetStyleSettings() const
static bool GetLayoutRTL()
static SAL_DLLPRIVATE unsigned int GetBestScreen(const tools::Rectangle &)
Get the "best" screen.
static unsigned int GetScreenCount()
Get the number of screens available for the display.
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.
static tools::Rectangle GetScreenPosSizePixel(unsigned int nScreen)
Get a screen's rectangular area.
DataChangedEventType GetType() const
AllSettingsFlags GetFlags() const
Point maLOKTwipsPos
absolute position of the floating window in the document - in twips (for toplevel floating windows).
tools::Rectangle maItemEdgeClipRect
void StartPopupMode(const tools::Rectangle &rRect, FloatWinPopupFlags nFlags)
SAL_DLLPRIVATE FloatingWindow * ImplFindLastLevelFloat()
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
SAL_DLLPRIVATE bool ImplIsFloatPopupModeWindow(const vcl::Window *pWindow)
SAL_DLLPRIVATE FloatingWindow * ImplFloatHitTest(vcl::Window *pReference, const Point &rPos, bool &rbHitTestInsideRect)
void PixelInvalidate(const tools::Rectangle *pRectangle) override
Notification about some rectangle of the output device got invalidated.
virtual void doDeferredInit(WinBits nBits) override
static Point ImplCalcPos(vcl::Window *pWindow, const tools::Rectangle &rRect, FloatWinPopupFlags nFlags, sal_uInt16 &rArrangeIndex, Point *pLOKTwipsPos=nullptr)
void EndPopupMode(FloatWinPopupEndFlags nFlags=FloatWinPopupEndFlags::NONE)
virtual bool EventNotify(NotifyEvent &rNEvt) override
SAL_DLLPRIVATE void ImplInitSettings()
SAL_DLLPRIVATE tools::Rectangle ImplGetItemEdgeClipRect() const
SAL_DLLPRIVATE void ImplInitFloating(vcl::Window *pParent, WinBits nStyle)
bool IsInPopupMode() const
void SetTitleType(FloatWinTitleType nTitle)
static tools::Rectangle ImplConvertToRelPos(vcl::Window *pReference, const tools::Rectangle &rRect)
FloatWinPopupFlags GetPopupModeFlags() const
FloatingWindow(const FloatingWindow &)=delete
tools::Rectangle maFloatRect
virtual void StateChanged(StateChangedType nType) override
virtual void PopupModeEnd()
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
VclPtr< FloatingWindow > mpNextFloat
Link< FloatingWindow *, void > maPopupModeEndHdl
VclPtr< vcl::Window > mpFirstPopupModeWin
FloatWinTitleType mnOldTitle
FloatWinPopupFlags mnPopupModeFlags
static Point ImplConvertToAbsPos(vcl::Window *pReference, const Point &rPos)
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
std::unique_ptr< ImplData > mpImplData
FloatWinTitleType mnTitle
void AddPopupModeWindow(vcl::Window *pWindow)
SAL_DLLPRIVATE void ImplCallPopupModeEnd()
virtual ~FloatingWindow() override
SAL_DLLPRIVATE void ImplEndPopupMode(FloatWinPopupEndFlags nFlags, const VclPtr< vcl::Window > &xFocusId)
VclPtr< vcl::Window > mxPrevFocusWin
A tooltip: adds tips to widgets in a floating / popup window.
void SetDisplayActive(bool bActive)
void GetBorder(sal_Int32 &rLeftBorder, sal_Int32 &rTopBorder, sal_Int32 &rRightBorder, sal_Int32 &rBottomBorder) const
const vcl::KeyCode & GetKeyCode() const
MapUnit GetMapUnit() const
const KeyEvent * GetKeyEvent() const
NotifyEventType GetType() const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
SAL_WARN_UNUSED_RESULT Point LogicToLogic(const Point &rPtSource, const MapMode *pMapModeSource, const MapMode *pMapModeDest) const
SAL_DLLPRIVATE void ReMirror(Point &rPoint) const
virtual bool HasMirroredGraphics() const
const AllSettings & GetSettings() 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
virtual void PositionByToolkit(const tools::Rectangle &, FloatWinPopupFlags)
constexpr tools::Long Height() const
constexpr tools::Long Width() const
const Color & GetWindowColor() const
const Color & GetFaceColor() const
virtual OUString GetText() const override
void loadUI(vcl::Window *pParent, const OUString &rID, const OUString &rUIXMLDescription, const css::uno::Reference< css::frame::XFrame > &rFrame=css::uno::Reference< css::frame::XFrame >())
virtual bool EventNotify(NotifyEvent &rNEvt) override
SAL_DLLPRIVATE void DoInitialLayout()
bool UpdatePositionData()
bool isLayoutEnabled() const
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
VclPtr< vcl::Window > mpDialogParent
static VclPtr< reference_type > Create(Arg &&... arg)
A construction helper for VclPtr.
virtual void notifyWindow(vcl::LOKWindowId nLOKWindowId, const OUString &rAction, const std::vector< LOKPayloadItem > &rPayload=std::vector< LOKPayloadItem >()) const =0
Callbacks.
sal_uInt16 GetCode() const
Point AbsoluteScreenToOutputPixel(const Point &rPos) const
Point OutputToScreenPixel(const Point &rPos) const
SAL_DLLPRIVATE bool ImplIsWindowOrChild(const vcl::Window *pWindow, bool bSystemWindow=false) const
SAL_DLLPRIVATE tools::Rectangle ImplOutputToUnmirroredAbsoluteScreenPixel(const tools::Rectangle &rRect) const
void SetActivateMode(ActivateModeFlags nMode)
vcl::Window * GetParent() const
virtual void StateChanged(StateChangedType nStateChange)
void SetLOKNotifier(const vcl::ILibreOfficeKitNotifier *pNotifier, bool bParent=false)
Interface to register for dialog / window tunneling.
bool HasChildPathFocus(bool bSystemWindow=false) const
tools::Rectangle GetDesktopRectPixel() const
SAL_DLLPRIVATE tools::Rectangle ImplUnmirroredAbsoluteScreenToOutputPixel(const tools::Rectangle &rRect) const
void ApplyControlBackground(vcl::RenderContext &rRenderContext, const Color &rDefaultColor)
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
void ReleaseLOKNotifier()
Indicate that LOK is not going to use this dialog any more.
virtual Point GetPosPixel() const
bool IsMapModeEnabled() const
const AllSettings & GetSettings() const
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
SAL_DLLPRIVATE vcl::Window * ImplGetParent() const
const MapMode & GetMapMode() const
VclPtr< vcl::Window > GetParentWithLOKNotifier()
Find the nearest parent with LOK Notifier; can be itself if this Window has LOK notifier set.
::OutputDevice const * GetOutDev() const
const vcl::ILibreOfficeKitNotifier * GetLOKNotifier() const
std::unique_ptr< WindowImpl > mpWindowImpl
vcl::LOKWindowId GetLOKWindowId() const
SalFrame * ImplGetFrame() const
bool IsRTLEnabled() const
Point PixelToLogic(const Point &rDevicePt) const
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
bool IsControlBackground() const
virtual void DataChanged(const DataChangedEvent &rDCEvt)
DialogControlFlags GetDialogControlFlags() const
const Color & GetControlBackground() const
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
virtual void SetPosPixel(const Point &rNewPos)
Point OutputToAbsoluteScreenPixel(const Point &rPos) const
Point ScreenToOutputPixel(const Point &rPos) const
void SetDialogControlFlags(DialogControlFlags nFlags)
SAL_DLLPRIVATE vcl::Window * ImplGetClientWindow() const
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle, SystemParentData *pSystemParentData)
IMPL_LINK_NOARG(FloatingWindow, ImplEndPopupModeHdl, void *, void)
constexpr sal_uInt16 KEY_ESCAPE
#define LINK(Instance, Class, Member)
#define SAL_WARN_IF(condition, area, stream)
OUString toString(OptionInfo const *info)
ImplSVFrameData maFrameData
ImplSVWinData * mpWinData
VclPtr< WorkWindow > mpAppWin
VclPtr< FloatingWindow > mpFirstFloat
VclPtr< vcl::Window > mpFocusWin
ImplSVData * ImplGetSVData()
@ MakeClientWindowVisibleBeforePopup
@ FloatWinPopupModeEndCancel
WinBits const WB_CLOSEABLE
WinBits const WB_MOVEABLE
WinBits const WB_DIALOGCONTROL
WinBits const WB_OWNERDRAWDECORATION
WinBits const WB_SIZEABLE
WinBits const WB_SYSTEMWINDOW
WinBits const WB_NODIALOGCONTROL
WinBits const WB_STANDALONE