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