LibreOffice Module vcl (master) 1
syswin.cxx
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
20#include <memory>
21
22#include <o3tl/safeint.hxx>
23#include <sal/config.h>
24#include <sal/log.hxx>
25
26#include <vcl/layout.hxx>
27#include <vcl/mnemonic.hxx>
28#include <vcl/settings.hxx>
29#include <vcl/svapp.hxx>
30#include <vcl/menu.hxx>
31#include <vcl/event.hxx>
32#include <vcl/syswin.hxx>
33#include <vcl/taskpanelist.hxx>
34#include <vcl/tabctrl.hxx>
35#include <vcl/tabpage.hxx>
36#include <vcl/virdev.hxx>
37
38#include <rtl/strbuf.hxx>
39#include <o3tl/string_view.hxx>
40
41#include <accel.hxx>
42#include <salframe.hxx>
43#include <svdata.hxx>
44#include <brdwin.hxx>
45#include <window.h>
46
47using namespace ::com::sun::star::uno;
48using namespace ::com::sun::star::lang;
49
51{
52public:
53 ImplData();
54
55 std::unique_ptr<TaskPaneList>
60};
61
63{
64 mpTaskPaneList = nullptr;
65 maMaxOutSize = Size( SHRT_MAX, SHRT_MAX );
66}
67
68SystemWindow::SystemWindow(WindowType nType, const char* pIdleDebugName)
69 : Window(nType)
70 , mbDockBtn(false)
71 , mbHideBtn(false)
72 , mbSysChild(false)
75 , mbPaintComplete(false)
77 , mnIcon(0)
78 , mpImplData(new ImplData)
79 , maLayoutIdle( pIdleDebugName )
80 , mbIsDeferredInit(false)
81{
82 mpWindowImpl->mbSysWin = true;
84
85 //To-Do, reuse maResizeTimer
87 maLayoutIdle.SetInvokeHandler( LINK( this, SystemWindow, ImplHandleLayoutTimerHdl ) );
88}
89
90void SystemWindow::loadUI(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription,
91 const css::uno::Reference<css::frame::XFrame> &rFrame)
92{
93 mbIsDeferredInit = true;
94 mpDialogParent = pParent; //should be unset in doDeferredInit
95 m_pUIBuilder.reset( new VclBuilder(this, AllSettings::GetUIRootDir(), rUIXMLDescription, rID, rFrame) );
96}
97
99{
100 disposeOnce();
101}
102
104{
106 mpImplData.reset();
107
108 // Hack to make sure code called from base ~Window does not interpret this
109 // as a SystemWindow (which it no longer is by then):
110 mpWindowImpl->mbSysWin = false;
114 Window::dispose();
115}
116
117static void ImplHandleControlAccelerator( const vcl::Window* pWindow, bool bShow )
118{
119 Control *pControl = dynamic_cast<Control*>(pWindow->ImplGetWindow());
120 if (pControl && pControl->GetText().indexOf('~') != -1)
121 {
122 pControl->SetShowAccelerator( bShow );
124 }
125}
126
127namespace
128{
129 void processChildren(const vcl::Window *pParent, bool bShowAccel)
130 {
131 // go through its children
132 vcl::Window* pChild = firstLogicalChildOfParent(pParent);
133 while (pChild)
134 {
135 if (pChild->GetType() == WindowType::TABCONTROL)
136 {
137 // find currently shown tab page
138 TabControl* pTabControl = static_cast<TabControl*>(pChild);
139 TabPage* pTabPage = pTabControl->GetTabPage( pTabControl->GetCurPageId() );
140 processChildren(pTabPage, bShowAccel);
141 }
142 else if (pChild->GetType() == WindowType::TABPAGE)
143 {
144 // bare tabpage without tabcontrol parent (options dialog)
145 processChildren(pChild, bShowAccel);
146 }
147 else if ((pChild->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) == WB_DIALOGCONTROL)
148 {
149 // special controls that manage their children outside of widget layout
150 processChildren(pChild, bShowAccel);
151 }
152 else
153 {
154 ImplHandleControlAccelerator(pChild, bShowAccel);
155 }
156 pChild = nextLogicalChildOfParent(pParent, pChild);
157 }
158 }
159}
160
161namespace
162{
163 bool ToggleMnemonicsOnHierarchy(const CommandEvent& rCEvent, const vcl::Window *pWindow)
164 {
165 if (rCEvent.GetCommand() == CommandEventId::ModKeyChange && ImplGetSVData()->maNWFData.mbAutoAccel)
166 {
167 const CommandModKeyData *pCData = rCEvent.GetModKeyData();
168 const bool bShowAccel = pCData && pCData->IsMod2() && pCData->IsDown();
169 processChildren(pWindow, bShowAccel);
170 return true;
171 }
172 return false;
173 }
174}
175
177{
178 if (rNEvt.GetType() == MouseNotifyEvent::COMMAND)
179 ToggleMnemonicsOnHierarchy(*rNEvt.GetCommandEvent(), this);
180
181 // capture KeyEvents for menu handling
182 if (rNEvt.GetType() == MouseNotifyEvent::KEYINPUT)
183 {
184 MenuBar* pMBar = mpMenuBar;
185 if ( !pMBar && ( GetType() == WindowType::FLOATINGWINDOW ) )
186 {
188 if( pWin && pWin->IsSystemWindow() )
189 pMBar = static_cast<SystemWindow*>(pWin)->GetMenuBar();
190 }
191 if (pMBar && pMBar->ImplHandleKeyEvent(*rNEvt.GetKeyEvent()))
192 return true;
193 }
194
195 return Window::EventNotify( rNEvt );
196}
197
199{
200 // capture KeyEvents for taskpane cycling
201 if ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
202 {
203 if( rNEvt.GetKeyEvent()->GetKeyCode().GetCode() == KEY_F6 &&
204 rNEvt.GetKeyEvent()->GetKeyCode().IsMod1() &&
205 !rNEvt.GetKeyEvent()->GetKeyCode().IsShift() )
206 {
207 // Ctrl-F6 goes directly to the document
209 return true;
210 }
211 else
212 {
213 TaskPaneList *pTList = mpImplData->mpTaskPaneList.get();
214 if( !pTList && ( GetType() == WindowType::FLOATINGWINDOW ) )
215 {
217 if( pWin && pWin->IsSystemWindow() )
218 pTList = static_cast<SystemWindow*>(pWin)->mpImplData->mpTaskPaneList.get();
219 }
220 if( !pTList )
221 {
222 // search topmost system window which is the one to handle dialog/toolbar cycling
223 SystemWindow *pSysWin = this;
224 vcl::Window *pWin = this;
225 while( pWin )
226 {
227 pWin = pWin->GetParent();
228 if( pWin && pWin->IsSystemWindow() )
229 pSysWin = static_cast<SystemWindow*>(pWin);
230 }
231 pTList = pSysWin->mpImplData->mpTaskPaneList.get();
232 }
233 if( pTList && pTList->HandleKeyEvent( *rNEvt.GetKeyEvent() ) )
234 return true;
235 }
236 }
237 return Window::PreNotify( rNEvt );
238}
239
241{
242 if( !mpImplData )
243 return nullptr;
244 if( mpImplData->mpTaskPaneList )
245 return mpImplData->mpTaskPaneList.get();
246 else
247 {
248 mpImplData->mpTaskPaneList.reset( new TaskPaneList );
249 MenuBar* pMBar = mpMenuBar;
250 if ( !pMBar && ( GetType() == WindowType::FLOATINGWINDOW ) )
251 {
253 if ( pWin && pWin->IsSystemWindow() )
254 pMBar = static_cast<SystemWindow*>(pWin)->GetMenuBar();
255 }
256 if( pMBar )
257 mpImplData->mpTaskPaneList->AddWindow( pMBar->ImplGetWindow() );
258 return mpImplData->mpTaskPaneList.get();
259 }
260}
261
263{
264 VclPtr<vcl::Window> xWindow = this;
266 if ( xWindow->isDisposed() )
267 return false;
268
269 if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() )
270 return false;
271
272 // Is Window not closeable, ignore close
273 vcl::Window* pBorderWin = ImplGetBorderWindow();
274 WinBits nStyle;
275 if ( pBorderWin )
276 nStyle = pBorderWin->GetStyle();
277 else
278 nStyle = GetStyle();
279 if ( !(nStyle & WB_CLOSEABLE) )
280 return false;
281
282 Hide();
283
284 return true;
285}
286
288{
289}
290
292{
293}
294
295void SystemWindow::SetRepresentedURL( const OUString& i_rURL )
296{
297 bool bChanged = (i_rURL != mpImplData->maRepresentedURL);
298 mpImplData->maRepresentedURL = i_rURL;
299 if ( !mbSysChild && bChanged )
300 {
301 const vcl::Window* pWindow = this;
302 while ( pWindow->mpWindowImpl->mpBorderWindow )
303 pWindow = pWindow->mpWindowImpl->mpBorderWindow;
304
305 if ( pWindow->mpWindowImpl->mbFrame )
306 pWindow->mpWindowImpl->mpFrame->SetRepresentedURL( i_rURL );
307 }
308}
309
310void SystemWindow::SetIcon( sal_uInt16 nIcon )
311{
312 if ( mnIcon == nIcon )
313 return;
314
315 mnIcon = nIcon;
316
317 if ( !mbSysChild )
318 {
319 const vcl::Window* pWindow = this;
320 while ( pWindow->mpWindowImpl->mpBorderWindow )
321 pWindow = pWindow->mpWindowImpl->mpBorderWindow;
322
323 if ( pWindow->mpWindowImpl->mbFrame )
324 pWindow->mpWindowImpl->mpFrame->SetIcon( nIcon );
325 }
326}
327
328void SystemWindow::ShowTitleButton( TitleButton nButton, bool bVisible )
329{
330 if ( nButton == TitleButton::Docking )
331 {
332 if ( mbDockBtn != bVisible )
333 {
335 if ( mpWindowImpl->mpBorderWindow )
336 static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetDockButton( bVisible );
337 }
338 }
339 else if ( nButton == TitleButton::Hide )
340 {
341 if ( mbHideBtn != bVisible )
342 {
344 if ( mpWindowImpl->mpBorderWindow )
345 static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetHideButton( bVisible );
346 }
347 }
348 else if ( nButton == TitleButton::Menu )
349 {
350 if ( mpWindowImpl->mpBorderWindow )
351 static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuButton( bVisible );
352 }
353 else
354 return;
355}
356
358{
359 if ( nButton == TitleButton::Docking )
360 return mbDockBtn;
361 else /* if ( nButton == TitleButton::Hide ) */
362 return mbHideBtn;
363}
364
366{
367 maMinOutSize = rSize;
368 if ( mpWindowImpl->mpBorderWindow )
369 {
370 static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMinOutputSize( rSize.Width(), rSize.Height() );
371 if ( mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame )
372 mpWindowImpl->mpBorderWindow->mpWindowImpl->mpFrame->SetMinClientSize( rSize.Width(), rSize.Height() );
373 }
374 else if ( mpWindowImpl->mbFrame )
375 mpWindowImpl->mpFrame->SetMinClientSize( rSize.Width(), rSize.Height() );
376}
377
379{
380 Size aSize( rSize );
381 if( aSize.Width() > SHRT_MAX || aSize.Width() <= 0 )
382 aSize.setWidth( SHRT_MAX );
383 if( aSize.Height() > SHRT_MAX || aSize.Height() <= 0 )
384 aSize.setHeight( SHRT_MAX );
385
386 mpImplData->maMaxOutSize = aSize;
387 if ( mpWindowImpl->mpBorderWindow )
388 {
389 static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMaxOutputSize( aSize.Width(), aSize.Height() );
390 if ( mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame )
391 mpWindowImpl->mpBorderWindow->mpWindowImpl->mpFrame->SetMaxClientSize( aSize.Width(), aSize.Height() );
392 }
393 else if ( mpWindowImpl->mbFrame )
394 mpWindowImpl->mpFrame->SetMaxClientSize( aSize.Width(), aSize.Height() );
395}
396
398{
399 return mpImplData->maMaxOutSize;
400}
401
402vcl::WindowData::WindowData(std::string_view rStr)
403{
404 vcl::WindowData& rData = *this;
406 sal_Int32 nIndex = 0;
407
408 std::string_view aTokenStr = o3tl::getToken(rStr, 0, ',', nIndex);
409 if (!aTokenStr.empty())
410 {
411 rData.setX(o3tl::toInt32(aTokenStr));
412 if (rData.x() > -16384 && rData.x() < 16384)
413 nValidMask |= vcl::WindowDataMask::X;
414 else
415 rData.setX(0);
416 }
417 else
418 rData.setX(0);
419 aTokenStr = o3tl::getToken(rStr, 0, ',', nIndex);
420 if (!aTokenStr.empty())
421 {
422 rData.setY(o3tl::toInt32(aTokenStr));
423 if (rData.y() > -16384 && rData.y() < 16384)
424 nValidMask |= vcl::WindowDataMask::Y;
425 else
426 rData.setY(0);
427 }
428 else
429 rData.setY(0);
430 aTokenStr = o3tl::getToken(rStr, 0, ',', nIndex);
431 if (!aTokenStr.empty())
432 {
433 rData.setWidth(o3tl::toInt32(aTokenStr));
434 if (rData.width() > 0 && rData.width() < 16384)
435 nValidMask |= vcl::WindowDataMask::Width;
436 else
437 rData.setWidth(0);
438 }
439 else
440 rData.setWidth(0);
441 aTokenStr = o3tl::getToken(rStr, 0, ';', nIndex);
442 if (!aTokenStr.empty())
443 {
444 rData.setHeight(o3tl::toInt32(aTokenStr));
445 if (rData.height() > 0 && rData.height() < 16384)
446 nValidMask |= vcl::WindowDataMask::Height;
447 else
448 rData.setHeight(0);
449 }
450 else
451 rData.setHeight(0);
452 aTokenStr = o3tl::getToken(rStr, 0, ';', nIndex);
453 if (!aTokenStr.empty())
454 {
455 // #94144# allow Minimize again, should be masked out when read from configuration
456 // 91625 - ignore Minimize
457 vcl::WindowState nState = static_cast<vcl::WindowState>(o3tl::toInt32(aTokenStr));
458 //nState &= ~vcl::WindowState::Minimized;
459 rData.setState(nState);
460 nValidMask |= vcl::WindowDataMask::State;
461 }
462 else
464
465 // read maximized pos/size
466 aTokenStr = o3tl::getToken(rStr, 0, ',', nIndex);
467 if (!aTokenStr.empty())
468 {
469 rData.SetMaximizedX(o3tl::toInt32(aTokenStr));
470 if (rData.GetMaximizedX() > -16384 && rData.GetMaximizedX() < 16384)
472 else
473 rData.SetMaximizedX(0);
474 }
475 else
476 rData.SetMaximizedX(0);
477 aTokenStr = o3tl::getToken(rStr, 0, ',', nIndex);
478 if (!aTokenStr.empty())
479 {
480 rData.SetMaximizedY(o3tl::toInt32(aTokenStr));
481 if (rData.GetMaximizedY() > -16384 && rData.GetMaximizedY() < 16384)
483 else
484 rData.SetMaximizedY(0);
485 }
486 else
487 rData.SetMaximizedY(0);
488 aTokenStr = o3tl::getToken(rStr, 0, ',', nIndex);
489 if (!aTokenStr.empty())
490 {
491 rData.SetMaximizedWidth(o3tl::toInt32(aTokenStr));
492 if (rData.GetMaximizedWidth() > 0 && rData.GetMaximizedWidth() < 16384)
494 else
495 rData.SetMaximizedWidth(0);
496 }
497 else
498 rData.SetMaximizedWidth(0);
499 aTokenStr = o3tl::getToken(rStr, 0, ';', nIndex);
500 if (!aTokenStr.empty())
501 {
502 rData.SetMaximizedHeight(o3tl::toInt32(aTokenStr));
503 if (rData.GetMaximizedHeight() > 0 && rData.GetMaximizedHeight() < 16384)
505 else
506 rData.SetMaximizedHeight(0);
507 }
508 else
509 rData.SetMaximizedHeight(0);
510
511 // mark valid fields
512 rData.setMask(nValidMask);
513}
514
516{
517 const vcl::WindowDataMask nValidMask = mask();
518 if ( nValidMask == vcl::WindowDataMask::NONE )
519 return OString();
520
521 OStringBuffer rStrBuf(64);
522
523 tools::Rectangle aRect = posSize();
524
525 if (nValidMask & vcl::WindowDataMask::X)
526 rStrBuf.append(static_cast<sal_Int32>(aRect.Left()));
527 rStrBuf.append(',');
528 if (nValidMask & vcl::WindowDataMask::Y)
529 rStrBuf.append(static_cast<sal_Int32>(aRect.Top()));
530 rStrBuf.append(',');
531 if (nValidMask & vcl::WindowDataMask::Width)
532 rStrBuf.append(static_cast<sal_Int32>(aRect.GetWidth()));
533 rStrBuf.append(',');
534 if (nValidMask & vcl::WindowDataMask::Height)
535 rStrBuf.append(static_cast<sal_Int32>(aRect.GetHeight()));
536 rStrBuf.append( ';' );
537 if (nValidMask & vcl::WindowDataMask::State)
538 {
539 // #94144# allow Minimize again, should be masked out when read from configuration
540 // 91625 - ignore Minimize
541 rStrBuf.append(static_cast<sal_Int32>(state()));
542 }
543 rStrBuf.append(';');
544 if (nValidMask & vcl::WindowDataMask::MaximizedX)
545 rStrBuf.append(static_cast<sal_Int32>(GetMaximizedX()));
546 rStrBuf.append(',');
547 if (nValidMask & vcl::WindowDataMask::MaximizedY)
548 rStrBuf.append(static_cast<sal_Int32>(GetMaximizedY()));
549 rStrBuf.append( ',' );
551 rStrBuf.append(static_cast<sal_Int32>(GetMaximizedWidth()));
552 rStrBuf.append(',');
554 rStrBuf.append(static_cast<sal_Int32>(GetMaximizedHeight()));
555 rStrBuf.append(';');
556
557 return rStrBuf.makeStringAndClear();
558}
559
560void SystemWindow::ImplMoveToScreen( tools::Long& io_rX, tools::Long& io_rY, tools::Long i_nWidth, tools::Long i_nHeight, vcl::Window const * i_pConfigureWin )
561{
562 tools::Rectangle aScreenRect;
564 aScreenRect = Application::GetScreenPosSizePixel( GetScreenNumber() );
565 else
566 {
567 aScreenRect = Application::GetScreenPosSizePixel( 0 );
568 for( unsigned int i = 1; i < Application::GetScreenCount(); i++ )
570 }
571 // unfortunately most of the time width and height are not really known
572 if( i_nWidth < 1 )
573 i_nWidth = 50;
574 if( i_nHeight < 1 )
575 i_nHeight = 50;
576
577 // check left border
578 bool bMove = false;
579 if( io_rX + i_nWidth < aScreenRect.Left() )
580 {
581 bMove = true;
582 io_rX = aScreenRect.Left();
583 }
584 // check right border
585 if( io_rX > aScreenRect.Right() - i_nWidth )
586 {
587 bMove = true;
588 io_rX = aScreenRect.Right() - i_nWidth;
589 }
590 // check top border
591 if( io_rY + i_nHeight < aScreenRect.Top() )
592 {
593 bMove = true;
594 io_rY = aScreenRect.Top();
595 }
596 // check bottom border
597 if( io_rY > aScreenRect.Bottom() - i_nHeight )
598 {
599 bMove = true;
600 io_rY = aScreenRect.Bottom() - i_nHeight;
601 }
602 vcl::Window* pParent = i_pConfigureWin->GetParent();
603 if( bMove && pParent )
604 {
605 // calculate absolute screen pos here, since that is what is contained in WindowData
606 Point aParentAbsPos( pParent->OutputToAbsoluteScreenPixel( Point(0,0) ) );
607 Size aParentSizePixel( pParent->GetOutputSizePixel() );
608 Point aPos( (aParentSizePixel.Width() - i_nWidth) / 2,
609 (aParentSizePixel.Height() - i_nHeight) / 2 );
610 io_rX = aParentAbsPos.X() + aPos.X();
611 io_rY = aParentAbsPos.Y() + aPos.Y();
612 }
613}
614
616{
617 const vcl::WindowDataMask nValidMask = rData.mask();
618 if ( nValidMask == vcl::WindowDataMask::NONE )
619 return;
620
621 if ( mbSysChild )
622 return;
623
624 vcl::Window* pWindow = this;
625 while ( pWindow->mpWindowImpl->mpBorderWindow )
626 pWindow = pWindow->mpWindowImpl->mpBorderWindow;
627
628 if ( pWindow->mpWindowImpl->mbFrame )
629 {
630 const vcl::WindowState nState = rData.state();
631 vcl::WindowData aState = rData;
632
633 if (rData.mask() & vcl::WindowDataMask::Size)
634 {
635 // #i43799# adjust window state sizes if a minimal output size was set
636 // otherwise the frame and the client might get different sizes
637 if (maMinOutSize.Width() > static_cast<tools::Long>(aState.width()))
638 aState.setWidth(maMinOutSize.Width());
639 if (maMinOutSize.Height() > static_cast<tools::Long>(aState.width()))
640 aState.setHeight(maMinOutSize.Height());
641 }
642
643 // #94144# allow Minimize again, should be masked out when read from configuration
644 // 91625 - ignore Minimize
645 //nState &= ~(WindowState::Minimized);
647
648 // normalize window positions onto screen
649 tools::Long nX = aState.x(), nY = aState.y();
650 ImplMoveToScreen(nX, nY, aState.width(), aState.height(), pWindow);
651 aState.setPos({ nX, nY });
652 nX = aState.GetMaximizedX();
653 nY = aState.GetMaximizedY();
654 ImplMoveToScreen(nX, nY, aState.GetMaximizedWidth(), aState.GetMaximizedHeight(), pWindow);
655 aState.SetMaximizedX(nX);
656 aState.SetMaximizedY(nY);
657
658 // #96568# avoid having multiple frames at the same screen location
659 // do the check only if not maximized
662 {
663 tools::Rectangle aDesktop = GetDesktopRectPixel();
664 ImplSVData *pSVData = ImplGetSVData();
665 vcl::Window *pWin = pSVData->maFrameData.mpFirstFrame;
666 bool bWrapped = false;
667 while( pWin )
668 {
669 if( !pWin->ImplIsRealParentPath( this ) && ( pWin != this ) &&
670 pWin->ImplGetWindow()->IsTopWindow() && pWin->mpWindowImpl->mbReallyVisible )
671 {
672 SalFrameGeometry g = pWin->mpWindowImpl->mpFrame->GetGeometry();
673 if( std::abs(g.x()-aState.x()) < 2 && std::abs(g.y()-aState.y()) < 5 )
674 {
675 tools::Long displacement = g.topDecoration() ? g.topDecoration() : 20;
676 if( static_cast<tools::Long>(aState.x() + displacement + aState.width() + g.rightDecoration()) > aDesktop.Right() ||
677 static_cast<tools::Long>(aState.y() + displacement + aState.height() + g.bottomDecoration()) > aDesktop.Bottom() )
678 {
679 // displacing would leave screen
680 aState.setX(g.leftDecoration() ? g.leftDecoration() : 10); // should result in (0,0)
681 aState.setY(displacement);
682 if( bWrapped ||
683 static_cast<tools::Long>(aState.x() + displacement + aState.width() + g.rightDecoration()) > aDesktop.Right() ||
684 static_cast<tools::Long>(aState.y() + displacement + aState.height() + g.bottomDecoration()) > aDesktop.Bottom() )
685 break; // further displacement not possible -> break
686 // avoid endless testing
687 bWrapped = true;
688 }
689 else
690 aState.move(displacement, displacement);
691 pWin = pSVData->maFrameData.mpFirstFrame; // check new pos again
692 }
693 }
694 pWin = pWin->mpWindowImpl->mpFrameData->mpNextFrame;
695 }
696 }
697
698 mpWindowImpl->mpFrame->SetWindowState( &aState );
699
700 // do a synchronous resize for layout reasons
701 // but use rData only when the window is not to be maximized (#i38089#)
702 // otherwise we have no useful size information
704 {
705 // query maximized size from frame
706 SalFrameGeometry aGeometry = mpWindowImpl->mpFrame->GetGeometry();
707
708 // but use it only if it is different from the restore size (rData)
709 // as currently only on windows the exact size of a maximized window
710 // can be computed without actually showing the window
711 if (aGeometry.width() != rData.width() || aGeometry.height() != rData.height())
712 ImplHandleResize(pWindow, aGeometry.width(), aGeometry.height());
713 }
714 else
715 if (rData.mask() & vcl::WindowDataMask::Size)
716 ImplHandleResize(pWindow, aState.width(), aState.height()); // #i43799# use aState and not rData, see above
717 }
718 else
719 {
721 if ( nValidMask & vcl::WindowDataMask::X )
722 nPosSize |= PosSizeFlags::X;
723 if ( nValidMask & vcl::WindowDataMask::Y )
724 nPosSize |= PosSizeFlags::Y;
725 if ( nValidMask & vcl::WindowDataMask::Width )
726 nPosSize |= PosSizeFlags::Width;
727 if ( nValidMask & vcl::WindowDataMask::Height )
728 nPosSize |= PosSizeFlags::Height;
729
730 tools::Long nX = rData.x();
731 tools::Long nY = rData.y();
732 tools::Long nWidth = rData.width();
733 tools::Long nHeight = rData.height();
734 const SalFrameGeometry& rGeom = pWindow->mpWindowImpl->mpFrame->GetGeometry();
735 if( nX < 0 )
736 nX = 0;
737 if( nX + nWidth > static_cast<tools::Long>(rGeom.width()) )
738 nX = rGeom.width() - nWidth;
739 if( nY < 0 )
740 nY = 0;
741 if( nY + nHeight > static_cast<tools::Long>(rGeom.height()) )
742 nY = rGeom.height() - nHeight;
743 setPosSizePixel( nX, nY, nWidth, nHeight, nPosSize );
744 }
745
746 // tdf#146648 if an explicit size state was set, then use it as the preferred
747 // size for layout
748 if (nValidMask & vcl::WindowDataMask::Size)
749 mbInitialLayoutSizeCalculated = true;
750}
751
753{
754 vcl::WindowDataMask nValidMask = rData.mask();
755 if ( nValidMask == vcl::WindowDataMask::NONE )
756 return;
757
758 if ( mbSysChild )
759 {
761 return;
762 }
763
764 const vcl::Window* pWindow = this;
765 while ( pWindow->mpWindowImpl->mpBorderWindow )
766 pWindow = pWindow->mpWindowImpl->mpBorderWindow;
767
768 if ( pWindow->mpWindowImpl->mbFrame )
769 {
770 vcl::WindowData aState;
771 if ( mpWindowImpl->mpFrame->GetWindowState( &aState ) )
772 {
773 // Limit mask only to what we've received, the rest is not set.
774 nValidMask &= aState.mask();
775 rData.setMask( nValidMask );
776 if ( nValidMask & vcl::WindowDataMask::X )
777 rData.setX( aState.x() );
778 if ( nValidMask & vcl::WindowDataMask::Y )
779 rData.setY( aState.y() );
780 if ( nValidMask & vcl::WindowDataMask::Width )
781 rData.setWidth( aState.width() );
782 if ( nValidMask & vcl::WindowDataMask::Height )
783 rData.setHeight( aState.height() );
784 if ( nValidMask & vcl::WindowDataMask::MaximizedX )
785 rData.SetMaximizedX( aState.GetMaximizedX() );
786 if ( nValidMask & vcl::WindowDataMask::MaximizedY )
787 rData.SetMaximizedY( aState.GetMaximizedY() );
788 if ( nValidMask & vcl::WindowDataMask::MaximizedWidth )
789 rData.SetMaximizedWidth( aState.GetMaximizedWidth() );
790 if ( nValidMask & vcl::WindowDataMask::MaximizedHeight )
791 rData.SetMaximizedHeight( aState.GetMaximizedHeight() );
792 if ( nValidMask & vcl::WindowDataMask::State )
793 {
794 // #94144# allow Minimize again, should be masked out when read from configuration
795 // 91625 - ignore Minimize
796 if (!(nValidMask & vcl::WindowDataMask::Minimized))
797 aState.rState() &= ~vcl::WindowState::Minimized;
798 rData.setState(aState.state());
799 }
800 rData.setMask( nValidMask );
801 }
802 else
804 }
805 else
806 {
807 Point aPos = GetPosPixel();
808 Size aSize = GetSizePixel();
810
812 rData.setMask( nValidMask );
813 if (nValidMask & vcl::WindowDataMask::X)
814 rData.setX(aPos.X());
815 if (nValidMask & vcl::WindowDataMask::Y)
816 rData.setY(aPos.Y());
817 if (nValidMask & vcl::WindowDataMask::Width)
818 rData.setWidth(aSize.Width());
819 if (nValidMask & vcl::WindowDataMask::Height)
820 rData.setHeight(aSize.Height());
821 if (nValidMask & vcl::WindowDataMask::State)
822 rData.setState(nState);
823 }
824}
825
826void SystemWindow::SetWindowState(std::string_view rStr)
827{
828 if (rStr.empty())
829 return;
830 SetWindowState(vcl::WindowData(rStr));
831}
832
834{
836 aData.setMask(nMask);
837 GetWindowState(aData);
838 return aData.toStr();
839}
840
842{
843 if ( mpMenuBar == pMenuBar )
844 return;
845
846 MenuBar* pOldMenuBar = mpMenuBar;
847 vcl::Window* pOldWindow = nullptr;
848 VclPtr<vcl::Window> pNewWindow;
849 mpMenuBar = pMenuBar;
850
851 if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WindowType::BORDERWINDOW) )
852 {
853 if ( pOldMenuBar )
854 pOldWindow = pOldMenuBar->ImplGetWindow();
855 else
856 pOldWindow = nullptr;
857 if ( pOldWindow )
858 {
859 CallEventListeners( VclEventId::WindowMenubarRemoved, static_cast<void*>(pOldMenuBar) );
860 pOldWindow->SetAccessible( css::uno::Reference< css::accessibility::XAccessible >() );
861 }
862 if ( pMenuBar )
863 {
864 SAL_WARN_IF( pMenuBar->pWindow, "vcl", "SystemWindow::SetMenuBar() - MenuBars can only set in one SystemWindow at time" );
865
866 pNewWindow = MenuBar::ImplCreate(mpWindowImpl->mpBorderWindow, pOldWindow, pMenuBar);
867 static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarWindow(pNewWindow);
868
869 CallEventListeners( VclEventId::WindowMenubarAdded, static_cast<void*>(pMenuBar) );
870 }
871 else
872 static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarWindow( nullptr );
873 ImplToBottomChild();
874 if ( pOldMenuBar )
875 {
876 bool bDelete = (pMenuBar == nullptr);
877 if( bDelete && pOldWindow )
878 {
879 if( mpImplData->mpTaskPaneList )
880 mpImplData->mpTaskPaneList->RemoveWindow( pOldWindow );
881 }
882 MenuBar::ImplDestroy( pOldMenuBar, bDelete );
883 if( bDelete )
884 pOldWindow = nullptr; // will be deleted in MenuBar::ImplDestroy,
885 }
886
887 }
888 else
889 {
890 if( pMenuBar )
891 pNewWindow = pMenuBar->ImplGetWindow();
892 if( pOldMenuBar )
893 pOldWindow = pOldMenuBar->ImplGetWindow();
894 }
895
896 // update taskpane list to make menubar accessible
897 if( mpImplData->mpTaskPaneList )
898 {
899 if( pOldWindow )
900 mpImplData->mpTaskPaneList->RemoveWindow( pOldWindow );
901 if( pNewWindow )
902 mpImplData->mpTaskPaneList->AddWindow( pNewWindow );
903 }
904}
905
906void SystemWindow::SetNotebookBar(const OUString& rUIXMLDescription,
907 const css::uno::Reference<css::frame::XFrame>& rFrame,
908 const NotebookBarAddonsItem& aNotebookBarAddonsItem,
909 bool bReloadNotebookbar)
910{
911 if (rUIXMLDescription != maNotebookBarUIFile || bReloadNotebookbar)
912 {
913 static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())
914 ->SetNotebookBar(rUIXMLDescription, rFrame, aNotebookBarAddonsItem);
915 maNotebookBarUIFile = rUIXMLDescription;
916 if(GetNotebookBar())
917 GetNotebookBar()->SetSystemWindow(this);
918 }
919}
920
922{
923 static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->CloseNotebookBar();
924 maNotebookBarUIFile.clear();
925}
926
928{
929 return static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->GetNotebookBar();
930}
931
933{
934 if ( mnMenuBarMode != nMode )
935 {
936 mnMenuBarMode = nMode;
937 if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WindowType::BORDERWINDOW) )
938 {
939 if ( nMode == MenuBarMode::Hide )
940 static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarMode( true );
941 else
942 static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarMode( false );
943 }
944 }
945}
946
948{
949 if( mpImplData && mpImplData->mpTaskPaneList )
950 return mpImplData->mpTaskPaneList->IsInList( pWin );
951 return false;
952}
953
955{
956 return mpWindowImpl->mpFrame->maGeometry.screen();
957}
958
959void SystemWindow::SetScreenNumber(unsigned int nDisplayScreen)
960{
961 mpWindowImpl->mpFrame->SetScreenNumber( nDisplayScreen );
962}
963
964void SystemWindow::SetApplicationID(const OUString &rApplicationID)
965{
966 mpWindowImpl->mpFrame->SetApplicationID( rApplicationID );
967}
968
970{
971 mpImplData->maCloseHdl = rLink;
972}
973
975{
976 return mpImplData->maCloseHdl;
977}
978
980{
981 if (!isLayoutEnabled())
982 return;
983 if (isCalculatingInitialLayoutSize())
984 return;
985 InvalidateSizeCache();
986 if (hasPendingLayout())
987 return;
988 maLayoutIdle.Start();
989}
990
992{
993 queue_resize();
994}
995
997{
998 //pre dtor called, and single child is a container => we're layout enabled
999 return mpImplData && ::isLayoutEnabled(this);
1000}
1001
1003{
1004 if (!isLayoutEnabled())
1005 return Window::GetOptimalSize();
1006
1007 Window *pBox = GetWindow(GetWindowType::FirstChild);
1008 // tdf#141318 Do the same as SystemWindow::setOptimalLayoutSize in case we're called before initial layout
1009 const_cast<SystemWindow*>(this)->settingOptimalLayoutSize(pBox);
1011
1012 sal_Int32 nBorderWidth = get_border_width();
1013
1014 aSize.AdjustHeight(2 * nBorderWidth );
1015 aSize.AdjustWidth(2 * nBorderWidth );
1016
1017 return Window::CalcWindowSize(aSize);
1018}
1019
1021{
1022 sal_Int32 nBorderWidth = get_border_width();
1023
1024 aSize.AdjustWidth( -(2 * nBorderWidth) );
1025 aSize.AdjustHeight( -(2 * nBorderWidth) );
1026
1028 VclContainer::setLayoutAllocation(rBox, aPos, CalcOutputSize(aSize));
1029}
1030
1031IMPL_LINK_NOARG( SystemWindow, ImplHandleLayoutTimerHdl, Timer*, void )
1032{
1033 Window *pBox = GetWindow(GetWindowType::FirstChild);
1034 if (!isLayoutEnabled())
1035 {
1036 SAL_WARN_IF(pBox, "vcl.layout", "SystemWindow has become non-layout because extra children have been added directly to it.");
1037 return;
1038 }
1039 assert(pBox);
1040 setPosSizeOnContainee(GetSizePixel(), *pBox);
1041}
1042
1043void SystemWindow::SetText(const OUString& rStr)
1044{
1045 setDeferredProperties();
1046 Window::SetText(rStr);
1047}
1048
1050{
1051 const_cast<SystemWindow*>(this)->setDeferredProperties();
1052 return Window::GetText();
1053}
1054
1056{
1057}
1058
1059void SystemWindow::setOptimalLayoutSize(bool bAllowWindowShrink)
1060{
1061 maLayoutIdle.Stop();
1062
1063 //resize SystemWindow to fit requisition on initial show
1064 Window *pBox = GetWindow(GetWindowType::FirstChild);
1065
1066 settingOptimalLayoutSize(pBox);
1067
1068 Size aSize = get_preferred_size();
1069
1070 Size aMax(bestmaxFrameSizeForScreenSize(GetDesktopRectPixel().GetSize()));
1071
1072 aSize.setWidth( std::min(aMax.Width(), aSize.Width()) );
1073 aSize.setHeight( std::min(aMax.Height(), aSize.Height()) );
1074
1075 SetMinOutputSizePixel(aSize);
1076
1077 if (!bAllowWindowShrink)
1078 {
1079 Size aCurrentSize = GetSizePixel();
1080 aSize.setWidth(std::max(aSize.Width(), aCurrentSize.Width()));
1081 aSize.setHeight(std::max(aSize.Height(), aCurrentSize.Height()));
1082 }
1083
1084 SetSizePixel(aSize);
1085 setPosSizeOnContainee(aSize, *pBox);
1086}
1087
1089{
1090 if (GetSettings().GetStyleSettings().GetAutoMnemonic())
1092
1093 if (isLayoutEnabled())
1094 {
1095 mbIsCalculatingInitialLayoutSize = true;
1096 setDeferredProperties();
1097 setOptimalLayoutSize(!mbInitialLayoutSizeCalculated);
1098 mbInitialLayoutSizeCalculated = true;
1099 mbIsCalculatingInitialLayoutSize = false;
1100 }
1101}
1102
1104{
1105 SAL_WARN("vcl.layout", "SystemWindow in layout without doDeferredInit impl");
1106}
1107
1109{
1110 // same prerequisites as in Execute()
1111 setDeferredProperties();
1112 ImplAdjustNWFSizes();
1113 Show();
1114 ToTop();
1115 ensureRepaint();
1116
1117 Size aSize(GetOutputSizePixel());
1118
1120 xOutput->SetOutputSizePixel(aSize);
1121
1122 Point aPos;
1123 xOutput->DrawOutDev(aPos, aSize, aPos, aSize, *GetOutDev());
1124
1125 return xOutput;
1126}
1127
1129{
1130 Window::PrePaint(rRenderContext);
1131 mbPaintComplete = false;
1132}
1133
1135{
1136 Window::PostPaint(rRenderContext);
1137 mbPaintComplete = true;
1138}
1139
1141{
1142 // ensure repaint
1143 Invalidate();
1144 mbPaintComplete = false;
1145
1146 while (!mbPaintComplete && !Application::IsQuit())
1147 {
1149 }
1150}
1151
1153{
1154 if (MenuBar* pMenu = GetMenuBar())
1155 {
1156 sal_uInt16 nMenuItems = pMenu->GetItemCount();
1157 for ( sal_uInt16 i = 0; i < nMenuItems; ++i )
1158 rMnemonicGenerator.RegisterMnemonic( pMenu->GetItemText( pMenu->GetItemId( i ) ) );
1159 }
1160}
1161
1163{
1164 if (MenuBar* pMenuBar = GetMenuBar())
1165 return pMenuBar->GetMenuBarHeight();
1166 return 0;
1167}
1168
1169/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
constexpr int nBorderWidth
static OUString GetUIRootDir()
Definition: dialog.cxx:556
static void Yield()
Process the next event.
Definition: svapp.cxx:550
static unsigned int GetScreenCount()
Get the number of screens available for the display.
Definition: svapp.cxx:1327
static bool IsUnifiedDisplay()
Determines if the screens that make up a display are separate or form one large display area.
Definition: svapp.cxx:1333
static tools::Rectangle GetScreenPosSizePixel(unsigned int nScreen)
Get a screen's rectangular area.
Definition: svapp.cxx:1368
static bool IsQuit()
Has Quit() been called?
Definition: svapp.cxx:607
CommandEventId GetCommand() const
const CommandModKeyData * GetModKeyData() const
bool IsDown() const
bool IsMod2() const
Definition: ctrl.hxx:82
void SetShowAccelerator(bool val)
Definition: ctrl.cxx:358
const vcl::KeyCode & GetKeyCode() const
Definition: event.hxx:57
SAL_DLLPRIVATE bool ImplHandleKeyEvent(const KeyEvent &rKEvent)
Definition: menu.cxx:2476
static SAL_DLLPRIVATE VclPtr< vcl::Window > ImplCreate(vcl::Window *pParent, vcl::Window *pWindow, MenuBar *pMenu)
Definition: menu.cxx:2446
static SAL_DLLPRIVATE void ImplDestroy(MenuBar *pMenu, bool bDelete)
Definition: menu.cxx:2460
VclPtr< vcl::Window > pWindow
Definition: menu.hxx:128
SAL_DLLPRIVATE vcl::Window * ImplGetWindow() const
Definition: menu.hxx:210
void RegisterMnemonic(const OUString &rKey)
Definition: mnemonic.cxx:81
const KeyEvent * GetKeyEvent() const
Definition: event.hxx:316
const CommandEvent * GetCommandEvent() const
Definition: event.hxx:332
MouseNotifyEvent GetType() const
Definition: event.hxx:308
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:176
virtual void DrawOutDev(const Point &rDestPt, const Size &rDestSize, const Point &rSrcPt, const Size &rSrcSize)
Definition: outdev.cxx:433
constexpr sal_uInt32 leftDecoration() const
Definition: salgeom.hxx:68
constexpr sal_uInt32 bottomDecoration() const
Definition: salgeom.hxx:74
constexpr sal_uInt32 topDecoration() const
Definition: salgeom.hxx:70
constexpr sal_uInt32 rightDecoration() const
Definition: salgeom.hxx:72
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
Definition: syswin.cxx:59
OUString maRepresentedURL
Definition: syswin.cxx:58
std::unique_ptr< TaskPaneList > mpTaskPaneList
Definition: syswin.cxx:56
bool mbIsDeferredInit
Definition: syswin.hxx:114
bool mbSysChild
Definition: syswin.hxx:104
MenuBar * GetMenuBar() const
Definition: syswin.hxx:183
virtual OUString GetText() const override
Definition: syswin.cxx:1049
bool mbInitialLayoutSizeCalculated
Definition: syswin.hxx:106
bool mbPaintComplete
Definition: syswin.hxx:107
const Link< SystemWindow &, void > & GetCloseHdl() const
Definition: syswin.cxx:974
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout) override
Definition: syswin.cxx:979
void CloseNotebookBar()
Definition: syswin.cxx:921
virtual bool EventNotify(NotifyEvent &rNEvt) override
Definition: syswin.cxx:176
VclPtr< MenuBar > mpMenuBar
Definition: syswin.hxx:97
SAL_DLLPRIVATE bool ImplIsInTaskPaneList(vcl::Window *pWin)
Definition: syswin.cxx:947
void CollectMenuBarMnemonics(MnemonicGenerator &rMnemonicGenerator) const
Definition: syswin.cxx:1152
SystemWindow(WindowType nType, const char *pIdleDebugName)
Definition: syswin.cxx:68
virtual ~SystemWindow() override
Definition: syswin.cxx:98
virtual void SetText(const OUString &rStr) override
Definition: syswin.cxx:1043
void SetMinOutputSizePixel(const Size &rSize)
Definition: syswin.cxx:365
void ShowTitleButton(TitleButton nButton, bool bVisible)
Definition: syswin.cxx:328
virtual void PostPaint(vcl::RenderContext &rRenderContext) override
Definition: syswin.cxx:1134
void SetNotebookBar(const OUString &rUIXMLDescription, const css::uno::Reference< css::frame::XFrame > &rFrame, const NotebookBarAddonsItem &aNotebookBarAddonsItem, bool bReloadNotebookbar=false)
Definition: syswin.cxx:906
VclPtr< VirtualDevice > createScreenshot()
Definition: syswin.cxx:1108
SAL_DLLPRIVATE void setPosSizeOnContainee(Size aSize, Window &rBox)
Definition: syswin.cxx:1020
virtual bool PreNotify(NotifyEvent &rNEvt) override
Definition: syswin.cxx:198
OString GetWindowState(vcl::WindowDataMask nMask=vcl::WindowDataMask::All) const
Definition: syswin.cxx:833
void SetIcon(sal_uInt16 nIcon)
Definition: syswin.cxx:310
virtual void Resizing(Size &rSize)
Definition: syswin.cxx:291
SAL_DLLPRIVATE void DoInitialLayout()
Definition: syswin.cxx:1088
Size maMinOutSize
Definition: syswin.hxx:101
bool mbIsCalculatingInitialLayoutSize
Definition: syswin.hxx:105
void SetRepresentedURL(const OUString &)
Definition: syswin.cxx:295
bool mbHideBtn
Definition: syswin.hxx:103
sal_uInt16 mnIcon
Definition: syswin.hxx:109
bool IsTitleButtonVisible(TitleButton nButton) const
Definition: syswin.cxx:357
SAL_DLLPRIVATE void ensureRepaint()
Definition: syswin.cxx:1140
virtual void TitleButtonClick(TitleButton nButton)
Definition: syswin.cxx:287
virtual Size GetOptimalSize() const override
Definition: syswin.cxx:1002
bool isLayoutEnabled() const
Definition: syswin.cxx:996
std::unique_ptr< ImplData > mpImplData
Definition: syswin.hxx:110
virtual void settingOptimalLayoutSize(Window *pBox)
Definition: syswin.cxx:1055
const Size & GetMaxOutputSizePixel() const
Definition: syswin.cxx:397
void SetCloseHdl(const Link< SystemWindow &, void > &rLink)
Definition: syswin.cxx:969
TaskPaneList * GetTaskPaneList()
Definition: syswin.cxx:240
virtual void doDeferredInit(WinBits nBits)
Definition: syswin.cxx:1103
bool mbDockBtn
Definition: syswin.hxx:102
void loadUI(vcl::Window *pParent, const OString &rID, const OUString &rUIXMLDescription, const css::uno::Reference< css::frame::XFrame > &rFrame=css::uno::Reference< css::frame::XFrame >())
Definition: syswin.cxx:90
void SetWindowState(const vcl::WindowData &rData)
Definition: syswin.cxx:615
void SetMaxOutputSizePixel(const Size &rSize)
Definition: syswin.cxx:378
virtual bool Close()
Definition: syswin.cxx:262
void SetApplicationID(const OUString &rApplicationID)
Definition: syswin.cxx:964
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
Definition: syswin.cxx:103
void setOptimalLayoutSize(bool bAllowWindowShrink)
Definition: syswin.cxx:1059
void SetMenuBarMode(MenuBarMode nMode)
Definition: syswin.cxx:932
VclPtr< NotebookBar > const & GetNotebookBar() const
Definition: syswin.cxx:927
VclPtr< vcl::Window > mpDialogParent
Definition: syswin.hxx:115
virtual void PrePaint(vcl::RenderContext &rRenderContext) override
Definition: syswin.cxx:1128
void SetScreenNumber(unsigned int nNewScreen)
Move the Window to a new screen.
Definition: syswin.cxx:959
unsigned int GetScreenNumber() const
Returns the screen number the window is on.
Definition: syswin.cxx:954
void SetMenuBar(MenuBar *pMenuBar)
Definition: syswin.cxx:841
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)
Definition: syswin.cxx:560
virtual void Resize() override
Definition: syswin.cxx:991
MenuBarMode mnMenuBarMode
Definition: syswin.hxx:108
int GetMenuBarHeight() const
Definition: syswin.cxx:1162
Idle maLayoutIdle
Definition: syswin.hxx:111
TabPage * GetTabPage(sal_uInt16 nPageId) const
Definition: tabctrl.cxx:1914
sal_uInt16 GetCurPageId() const
Definition: tabctrl.cxx:1858
bool HandleKeyEvent(const KeyEvent &rKeyEvent)
void SetPriority(TaskPriority ePriority)
Definition: scheduler.cxx:597
void Stop()
Definition: scheduler.cxx:590
Definition: timer.hxx:27
void SetInvokeHandler(const Link< Timer *, void > &rLink)
Definition: timer.hxx:56
void disposeBuilder()
Definition: dialog.cxx:550
std::unique_ptr< VclBuilder > m_pUIBuilder
Definition: syswin.hxx:86
Creates a hierarchy of vcl::Windows (widgets) from a .ui file for dialogs, sidebar,...
Definition: builder.hxx:68
static void setLayoutAllocation(vcl::Window &rWindow, const Point &rPos, const Size &rSize)
Definition: layout.cxx:77
static Size getLayoutRequisition(const vcl::Window &rWindow)
Definition: layout.cxx:152
void clear()
Definition: vclptr.hxx:190
bool isDisposed() const
bool SetOutputSizePixel(const Size &rNewSize, bool bErase=true)
Definition: virdev.cxx:408
constexpr tools::Long GetWidth() const
constexpr tools::Long Top() const
constexpr tools::Long Right() const
constexpr tools::Long GetHeight() const
tools::Rectangle & Union(const tools::Rectangle &rRect)
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
bool IsMod1() const
Definition: keycod.hxx:56
sal_uInt16 GetCode() const
Definition: keycod.hxx:49
bool IsShift() const
Definition: keycod.hxx:54
void SetMaximizedX(int nRX)
Definition: windowstate.hxx:96
int GetMaximizedX() const
Definition: windowstate.hxx:97
int GetMaximizedY() const
Definition: windowstate.hxx:99
unsigned int GetMaximizedWidth() const
WindowState & rState()
Definition: windowstate.hxx:90
WindowState state() const
Definition: windowstate.hxx:89
void SetMaximizedY(int nRY)
Definition: windowstate.hxx:98
WindowDataMask mask() const
Definition: windowstate.hxx:93
OString toStr() const
Definition: syswin.cxx:515
unsigned int GetMaximizedHeight() const
constexpr sal_Int32 height() const
constexpr sal_Int32 y() const
void setX(sal_Int32 nX)
void setPos(const Point &aPos)
void setWidth(sal_Int32 nWidth)
constexpr sal_Int32 x() const
constexpr sal_Int32 width() const
void setY(sal_Int32 nY)
void move(sal_Int32 nDX, sal_Int32 nDY)
void setHeight(sal_Int32 nHeight)
virtual void PrePaint(vcl::RenderContext &rRenderContext)
Definition: paint.cxx:1012
vcl::Window * GetParent() const
Definition: window2.cxx:1120
WindowType GetType() const
Definition: window2.cxx:997
SAL_DLLPRIVATE vcl::Window * ImplGetBorderWindow() const
Definition: window2.cxx:893
void SetAccessible(const css::uno::Reference< css::accessibility::XAccessible > &)
bool IsCreatedWithToolkit() const
Definition: window2.cxx:1260
void GrabFocusToDocument()
Definition: window.cxx:2991
WinBits GetStyle() const
Definition: window2.cxx:976
Size CalcWindowSize(const Size &rOutSz) const
Definition: window2.cxx:560
Window(WindowType nType)
Definition: window.cxx:95
virtual Size GetOptimalSize() const
Definition: window3.cxx:26
void Hide()
Definition: window.hxx:884
std::unique_ptr< WindowImpl > mpWindowImpl
Definition: window.hxx:483
bool IsSystemWindow() const
Definition: window2.cxx:1020
Size GetOutputSizePixel() const
Definition: window3.cxx:89
bool IsTopWindow() const
Definition: stacking.cxx:608
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1143
Point OutputToAbsoluteScreenPixel(const Point &rPos) const
Definition: window.cxx:2857
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
Definition: event.cxx:219
virtual void SetText(const OUString &rStr)
Definition: window.cxx:3031
virtual OUString GetText() const
Definition: window.cxx:3060
vcl::Window * ImplGetWindow() const
if this is a proxy return the client, otherwise itself
Definition: window2.cxx:853
virtual void PostPaint(vcl::RenderContext &rRenderContext)
Definition: paint.cxx:1016
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
Definition: window2.cxx:924
SAL_DLLPRIVATE bool ImplIsRealParentPath(const vcl::Window *pWindow) const
Definition: stacking.cxx:669
Size bestmaxFrameSizeForScreenSize(const Size &rScreenSize)
Definition: dialog.cxx:705
vcl::Window * firstLogicalChildOfParent(const vcl::Window *pTopLevel)
Definition: dialog.cxx:188
void GenerateAutoMnemonicsOnHierarchy(const vcl::Window *pWindow)
Definition: dialog.cxx:204
vcl::Window * nextLogicalChildOfParent(const vcl::Window *pTopLevel, const vcl::Window *pChild)
Definition: dialog.cxx:132
sal_Int32 nState
sal_Int32 nIndex
constexpr sal_uInt16 KEY_F6
Definition: keycodes.hxx:88
bool isLayoutEnabled(const vcl::Window *pWindow)
Definition: layout.cxx:2917
#define SAL_WARN_IF(condition, area, stream)
#define SAL_WARN(area, stream)
const ContentProperties & rData
constexpr OUStringLiteral aData
int i
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)
long Long
WindowDataMask
Definition: windowstate.hxx:43
WindowState
Definition: windowstate.hxx:28
IMPL_LINK_NOARG(QuickSelectionEngine_Data, SearchStringTimeout, Timer *, void)
QPRO_FUNC_TYPE nType
ImplSVFrameData maFrameData
Definition: svdata.hxx:400
VclPtr< vcl::Window > mpFirstFrame
Definition: svdata.hxx:245
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:76
static void ImplHandleControlAccelerator(const vcl::Window *pWindow, bool bShow)
Definition: syswin.cxx:117
TitleButton
Definition: syswin.hxx:55
MenuBarMode
Definition: syswin.hxx:50
@ RESIZE
Resize runs before repaint, so we won't paint twice.
bool bVisible
@ WindowMenubarAdded
@ WindowMenubarRemoved
PosSizeFlags
Definition: window.hxx:126
StateChangedType
Definition: window.hxx:290
@ Update
The invalidated area is updated immediately.
void ImplHandleResize(vcl::Window *pWindow, tools::Long nNewWidth, tools::Long nNewHeight)
Definition: winproc.cxx:1854
sal_Int64 WinBits
WinBits const WB_CLOSEABLE
WindowType