38#include <rtl/ustrbuf.hxx>
55 std::unique_ptr<TaskPaneList>
91 const css::uno::Reference<css::frame::XFrame> &rFrame)
120 if (pControl && pControl->
GetText().indexOf(
'~') != -1)
129 void processChildren(
const vcl::Window *pParent,
bool bShowAccel)
140 processChildren(pTabPage, bShowAccel);
145 processChildren(pChild, bShowAccel);
150 processChildren(pChild, bShowAccel);
168 const bool bShowAccel = pCData && pCData->
IsMod2() && pCData->
IsDown();
169 processChildren(pWindow, bShowAccel);
195 return Window::EventNotify( rNEvt );
231 pTList = pSysWin->
mpImplData->mpTaskPaneList.get();
237 return Window::PreNotify( rNEvt );
297 bool bChanged = (i_rURL !=
mpImplData->maRepresentedURL);
306 pWindow->
mpWindowImpl->mpFrame->SetRepresentedURL( i_rURL );
371 if (
mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame )
381 if( aSize.
Width() > SHRT_MAX || aSize.
Width() <= 0 )
390 if (
mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame )
409 if (!aTokenStr.empty())
412 if (rData.
x() > -16384 && rData.
x() < 16384)
420 if (!aTokenStr.empty())
423 if (rData.
y() > -16384 && rData.
y() < 16384)
431 if (!aTokenStr.empty())
438 if (rData.
width() > 0 && rData.
width() < 16384)
446 if (!aTokenStr.empty())
461 if (!aTokenStr.empty())
475 if (!aTokenStr.empty())
486 if (!aTokenStr.empty())
497 if (!aTokenStr.empty())
508 if (!aTokenStr.empty())
529 OUStringBuffer rStrBuf(64);
534 rStrBuf.append(
static_cast<sal_Int32
>(aRect.
Left()));
537 rStrBuf.append(
static_cast<sal_Int32
>(aRect.
Top()));
540 rStrBuf.append(
static_cast<sal_Int32
>(aRect.
GetWidth()));
543 rStrBuf.append(
static_cast<sal_Int32
>(aRect.
GetHeight()));
544 rStrBuf.append(
';' );
549 rStrBuf.append(
static_cast<sal_Int32
>(state()));
553 rStrBuf.append(
static_cast<sal_Int32
>(GetMaximizedX()));
556 rStrBuf.append(
static_cast<sal_Int32
>(GetMaximizedY()));
557 rStrBuf.append(
',' );
559 rStrBuf.append(
static_cast<sal_Int32
>(GetMaximizedWidth()));
562 rStrBuf.append(
static_cast<sal_Int32
>(GetMaximizedHeight()));
565 return rStrBuf.makeStringAndClear();
581 if( io_rX + i_nWidth < aScreenRect.
Left() )
584 io_rX = aScreenRect.
Left();
587 if( io_rX > aScreenRect.
Right() - i_nWidth )
590 io_rX = aScreenRect.
Right() - i_nWidth;
593 if( io_rY + i_nHeight < aScreenRect.
Top() )
596 io_rY = aScreenRect.
Top();
599 if( io_rY > aScreenRect.
Bottom() - i_nHeight )
602 io_rY = aScreenRect.
Bottom() - i_nHeight;
605 if( bMove && pParent )
610 Point aPos( (aParentSizePixel.
Width() - i_nWidth) / 2,
611 (aParentSizePixel.
Height() - i_nHeight) / 2 );
612 io_rX = aParentAbsPos.
X() + aPos.
X();
613 io_rY = aParentAbsPos.
Y() + aPos.
Y();
640 aState.
setWidth(maMinOutSize.Width());
652 ImplMoveToScreen(nX, nY, aState.
width(), aState.
height(), pWindow);
653 aState.
setPos({ nX, nY });
668 bool bWrapped =
false;
675 if( std::abs(g.
x()-aState.
x()) < 2 && std::abs(g.
y()-aState.
y()) < 5 )
683 aState.
setY(displacement);
692 aState.
move(displacement, displacement);
700 mpWindowImpl->mpFrame->SetWindowState( &aState );
740 nX = rGeom.
width() - nWidth;
744 nY = rGeom.
height() - nHeight;
745 setPosSizePixel( nX, nY, nWidth, nHeight, nPosSize );
751 mbInitialLayoutSizeCalculated =
true;
773 if ( mpWindowImpl->mpFrame->GetWindowState( &aState ) )
776 nValidMask &= aState.
mask();
779 rData.
setX( aState.
x() );
781 rData.
setY( aState.
y() );
799 aState.
rState() &=
~vcl::WindowState::Minimized;
809 Point aPos = GetPosPixel();
810 Size aSize = GetSizePixel();
816 rData.
setX(aPos.
X());
818 rData.
setY(aPos.
Y());
838 aData.setMask(nMask);
839 GetWindowState(
aData);
840 return aData.toStr();
845 if ( mpMenuBar == pMenuBar )
848 MenuBar* pOldMenuBar = mpMenuBar;
851 mpMenuBar = pMenuBar;
858 pOldWindow =
nullptr;
862 pOldWindow->
SetAccessible( css::uno::Reference< css::accessibility::XAccessible >() );
866 SAL_WARN_IF( pMenuBar->
pWindow,
"vcl",
"SystemWindow::SetMenuBar() - MenuBars can only set in one SystemWindow at time" );
869 static_cast<ImplBorderWindow*
>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarWindow(pNewWindow);
874 static_cast<ImplBorderWindow*
>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarWindow(
nullptr );
878 bool bDelete = (pMenuBar ==
nullptr);
879 if( bDelete && pOldWindow )
881 if( mpImplData->mpTaskPaneList )
882 mpImplData->mpTaskPaneList->RemoveWindow( pOldWindow );
886 pOldWindow =
nullptr;
899 if( mpImplData->mpTaskPaneList )
902 mpImplData->mpTaskPaneList->RemoveWindow( pOldWindow );
904 mpImplData->mpTaskPaneList->AddWindow( pNewWindow );
909 const css::uno::Reference<css::frame::XFrame>& rFrame,
911 bool bReloadNotebookbar)
913 if (rUIXMLDescription != maNotebookBarUIFile || bReloadNotebookbar)
916 ->SetNotebookBar(rUIXMLDescription, rFrame, aNotebookBarAddonsItem);
917 maNotebookBarUIFile = rUIXMLDescription;
919 GetNotebookBar()->SetSystemWindow(
this);
925 static_cast<ImplBorderWindow*
>(mpWindowImpl->mpBorderWindow.get())->CloseNotebookBar();
926 maNotebookBarUIFile.clear();
931 return static_cast<ImplBorderWindow*
>(mpWindowImpl->mpBorderWindow.get())->GetNotebookBar();
936 if ( mnMenuBarMode != nMode )
938 mnMenuBarMode = nMode;
942 static_cast<ImplBorderWindow*
>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarMode(
true );
944 static_cast<ImplBorderWindow*
>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarMode(
false );
951 if( mpImplData && mpImplData->mpTaskPaneList )
952 return mpImplData->mpTaskPaneList->IsInList( pWin );
958 return mpWindowImpl->mpFrame->maGeometry.screen();
963 mpWindowImpl->mpFrame->SetScreenNumber( nDisplayScreen );
968 mpWindowImpl->mpFrame->SetApplicationID( rApplicationID );
973 mpImplData->maCloseHdl = rLink;
978 return mpImplData->maCloseHdl;
985 if (isCalculatingInitialLayoutSize())
987 InvalidateSizeCache();
988 if (hasPendingLayout())
990 maLayoutIdle.Start();
1011 const_cast<SystemWindow*
>(
this)->settingOptimalLayoutSize(pBox);
1038 SAL_WARN_IF(pBox,
"vcl.layout",
"SystemWindow has become non-layout because extra children have been added directly to it.");
1042 setPosSizeOnContainee(GetSizePixel(), *pBox);
1047 setDeferredProperties();
1053 const_cast<SystemWindow*
>(
this)->setDeferredProperties();
1063 maLayoutIdle.Stop();
1068 settingOptimalLayoutSize(pBox);
1070 Size aSize = get_preferred_size();
1077 SetMinOutputSizePixel(aSize);
1079 if (!bAllowWindowShrink)
1081 Size aCurrentSize = GetSizePixel();
1086 SetSizePixel(aSize);
1087 setPosSizeOnContainee(aSize, *pBox);
1092 if (GetSettings().GetStyleSettings().GetAutoMnemonic())
1097 mbIsCalculatingInitialLayoutSize =
true;
1098 setDeferredProperties();
1099 setOptimalLayoutSize(!mbInitialLayoutSizeCalculated);
1100 mbInitialLayoutSizeCalculated =
true;
1101 mbIsCalculatingInitialLayoutSize =
false;
1107 SAL_WARN(
"vcl.layout",
"SystemWindow in layout without doDeferredInit impl");
1113 setDeferredProperties();
1114 ImplAdjustNWFSizes();
1119 Size aSize(GetOutputSizePixel());
1125 xOutput->
DrawOutDev(aPos, aSize, aPos, aSize, *GetOutDev());
1133 mbPaintComplete =
false;
1139 mbPaintComplete =
true;
1146 mbPaintComplete =
false;
1156 if (
MenuBar* pMenu = GetMenuBar())
1158 sal_uInt16 nMenuItems = pMenu->GetItemCount();
1159 for ( sal_uInt16
i = 0;
i < nMenuItems; ++
i )
1160 rMnemonicGenerator.
RegisterMnemonic( pMenu->GetItemText( pMenu->GetItemId(
i ) ) );
1166 if (
MenuBar* pMenuBar = GetMenuBar())
1167 return pMenuBar->GetMenuBarHeight();
static OUString GetUIRootDir()
static void Yield()
Process the next event.
static unsigned int GetScreenCount()
Get the number of screens available for the display.
static tools::Rectangle GetScreenPosSizePixel(unsigned int nScreen)
Get a screen's rectangular area.
static bool IsQuit()
Has Quit() been called?
CommandEventId GetCommand() const
const CommandModKeyData * GetModKeyData() const
void SetShowAccelerator(bool val)
const vcl::KeyCode & GetKeyCode() const
void RegisterMnemonic(const OUString &rKey)
const KeyEvent * GetKeyEvent() const
const CommandEvent * GetCommandEvent() const
NotifyEventType GetType() const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
virtual void DrawOutDev(const Point &rDestPt, const Size &rDestSize, const Point &rSrcPt, const Size &rSrcSize)
constexpr tools::Long Y() const
constexpr tools::Long X() const
constexpr sal_uInt32 leftDecoration() const
constexpr sal_uInt32 bottomDecoration() const
constexpr sal_uInt32 topDecoration() const
constexpr sal_uInt32 rightDecoration() const
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
Link< SystemWindow &, void > maCloseHdl
OUString maRepresentedURL
std::unique_ptr< TaskPaneList > mpTaskPaneList
MenuBar * GetMenuBar() 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 >())
bool mbInitialLayoutSizeCalculated
const Link< SystemWindow &, void > & GetCloseHdl() const
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout) override
virtual bool EventNotify(NotifyEvent &rNEvt) override
VclPtr< MenuBar > mpMenuBar
SAL_DLLPRIVATE bool ImplIsInTaskPaneList(vcl::Window *pWin)
void CollectMenuBarMnemonics(MnemonicGenerator &rMnemonicGenerator) const
SystemWindow(WindowType nType, const char *pIdleDebugName)
virtual ~SystemWindow() override
virtual void SetText(const OUString &rStr) override
void SetMinOutputSizePixel(const Size &rSize)
void ShowTitleButton(TitleButton nButton, bool bVisible)
virtual void PostPaint(vcl::RenderContext &rRenderContext) override
void SetNotebookBar(const OUString &rUIXMLDescription, const css::uno::Reference< css::frame::XFrame > &rFrame, const NotebookBarAddonsItem &aNotebookBarAddonsItem, bool bReloadNotebookbar=false)
VclPtr< VirtualDevice > createScreenshot()
SAL_DLLPRIVATE void setPosSizeOnContainee(Size aSize, Window &rBox)
virtual bool PreNotify(NotifyEvent &rNEvt) override
void SetIcon(sal_uInt16 nIcon)
virtual void Resizing(Size &rSize)
SAL_DLLPRIVATE void DoInitialLayout()
bool mbIsCalculatingInitialLayoutSize
void SetRepresentedURL(const OUString &)
bool IsTitleButtonVisible(TitleButton nButton) const
SAL_DLLPRIVATE void ensureRepaint()
virtual void TitleButtonClick(TitleButton nButton)
virtual Size GetOptimalSize() const override
bool isLayoutEnabled() const
std::unique_ptr< ImplData > mpImplData
virtual void settingOptimalLayoutSize(Window *pBox)
const Size & GetMaxOutputSizePixel() const
void SetCloseHdl(const Link< SystemWindow &, void > &rLink)
TaskPaneList * GetTaskPaneList()
virtual void doDeferredInit(WinBits nBits)
void SetWindowState(const vcl::WindowData &rData)
void SetMaxOutputSizePixel(const Size &rSize)
OUString GetWindowState(vcl::WindowDataMask nMask=vcl::WindowDataMask::All) const
void SetApplicationID(const OUString &rApplicationID)
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
void setOptimalLayoutSize(bool bAllowWindowShrink)
void SetMenuBarMode(MenuBarMode nMode)
VclPtr< NotebookBar > const & GetNotebookBar() const
VclPtr< vcl::Window > mpDialogParent
virtual void PrePaint(vcl::RenderContext &rRenderContext) override
void SetScreenNumber(unsigned int nNewScreen)
Move the Window to a new screen.
unsigned int GetScreenNumber() const
Returns the screen number the window is on.
void SetMenuBar(MenuBar *pMenuBar)
static SAL_DLLPRIVATE void ImplMoveToScreen(tools::Long &io_rX, tools::Long &io_rY, tools::Long i_nWidth, tools::Long i_nHeight, vcl::Window const *i_pConfigureWin)
virtual void Resize() override
MenuBarMode mnMenuBarMode
int GetMenuBarHeight() const
TabPage * GetTabPage(sal_uInt16 nPageId) const
sal_uInt16 GetCurPageId() const
bool HandleKeyEvent(const KeyEvent &rKeyEvent)
void SetPriority(TaskPriority ePriority)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
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)
bool SetOutputSizePixel(const Size &rNewSize, bool bErase=true, bool bAlphaMaskTransparent=false)
sal_uInt16 GetCode() const
void SetMaximizedX(int nRX)
int GetMaximizedX() const
int GetMaximizedY() const
unsigned int GetMaximizedWidth() const
WindowState state() const
void SetMaximizedY(int nRY)
void SetMaximizedHeight(unsigned int nRHeight)
void setMask(WindowDataMask nMask)
WindowDataMask mask() const
void SetMaximizedWidth(unsigned int nRWidth)
unsigned int GetMaximizedHeight() const
void setState(WindowState nState)
constexpr sal_Int32 height() const
constexpr sal_Int32 y() const
void setPos(const Point &aPos)
void setWidth(sal_Int32 nWidth)
constexpr sal_Int32 x() const
constexpr sal_Int32 width() const
void move(sal_Int32 nDX, sal_Int32 nDY)
void setHeight(sal_Int32 nHeight)
virtual void PrePaint(vcl::RenderContext &rRenderContext)
vcl::Window * GetParent() const
WindowType GetType() const
SAL_DLLPRIVATE vcl::Window * ImplGetBorderWindow() const
void SetAccessible(const css::uno::Reference< css::accessibility::XAccessible > &)
bool IsCreatedWithToolkit() const
void GrabFocusToDocument()
Size CalcWindowSize(const Size &rOutSz) const
virtual Size GetOptimalSize() const
std::unique_ptr< WindowImpl > mpWindowImpl
bool IsSystemWindow() const
Size GetOutputSizePixel() const
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Point OutputToAbsoluteScreenPixel(const Point &rPos) const
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
virtual void SetText(const OUString &rStr)
virtual OUString GetText() const
vcl::Window * ImplGetWindow() const
if this is a proxy return the client, otherwise itself
virtual void PostPaint(vcl::RenderContext &rRenderContext)
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
SAL_DLLPRIVATE bool ImplIsRealParentPath(const vcl::Window *pWindow) const
Size bestmaxFrameSizeForScreenSize(const Size &rScreenSize)
vcl::Window * firstLogicalChildOfParent(const vcl::Window *pTopLevel)
void GenerateAutoMnemonicsOnHierarchy(const vcl::Window *pWindow)
vcl::Window * nextLogicalChildOfParent(const vcl::Window *pTopLevel, const vcl::Window *pChild)
constexpr sal_uInt16 KEY_F6
bool isLayoutEnabled(const vcl::Window *pWindow)
#define LINK(Instance, Class, Member)
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
constexpr OUStringLiteral aData
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
std::basic_string_view< charT, traits > getToken(std::basic_string_view< charT, traits > sv, charT delimiter, std::size_t &position)
IMPL_LINK_NOARG(QuickSelectionEngine_Data, SearchStringTimeout, Timer *, void)
ImplSVFrameData maFrameData
VclPtr< vcl::Window > mpFirstFrame
ImplSVData * ImplGetSVData()
static void ImplHandleControlAccelerator(const vcl::Window *pWindow, bool bShow)
@ RESIZE
Resize runs before repaint, so we won't paint twice.
@ Update
The invalidated area is updated immediately.
void ImplHandleResize(vcl::Window *pWindow, tools::Long nNewWidth, tools::Long nNewHeight)
WinBits const WB_CLOSEABLE
WinBits const WB_DIALOGCONTROL
WinBits const WB_NODIALOGCONTROL