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/mnemonic.hxx>
29 #include <vcl/settings.hxx>
30 #include <vcl/svapp.hxx>
31 #include <vcl/menu.hxx>
32 #include <vcl/event.hxx>
33 #include <vcl/syswin.hxx>
34 #include <vcl/taskpanelist.hxx>
35 #include <vcl/tabctrl.hxx>
36 #include <vcl/tabpage.hxx>
37 #include <vcl/virdev.hxx>
38 
39 #include <rtl/strbuf.hxx>
40 
41 #include <salframe.hxx>
42 #include <svdata.hxx>
43 #include <brdwin.hxx>
44 #include <window.h>
45 
46 using namespace ::com::sun::star::uno;
47 using namespace ::com::sun::star::lang;
48 
50 {
51 public:
52  ImplData();
53 
54  std::unique_ptr<TaskPaneList>
57  OUString maRepresentedURL;
59 };
60 
62 {
63  mpTaskPaneList = nullptr;
64  maMaxOutSize = Size( SHRT_MAX, SHRT_MAX );
65 }
66 
68  : Window(nType)
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, AllSettings::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  maMinOutSize = rSize;
372  if ( mpWindowImpl->mpBorderWindow )
373  {
374  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMinOutputSize( rSize.Width(), rSize.Height() );
375  if ( mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame )
376  mpWindowImpl->mpBorderWindow->mpWindowImpl->mpFrame->SetMinClientSize( rSize.Width(), rSize.Height() );
377  }
378  else if ( mpWindowImpl->mbFrame )
379  mpWindowImpl->mpFrame->SetMinClientSize( rSize.Width(), rSize.Height() );
380 }
381 
383 {
384  Size aSize( rSize );
385  if( aSize.Width() > SHRT_MAX || aSize.Width() <= 0 )
386  aSize.setWidth( SHRT_MAX );
387  if( aSize.Height() > SHRT_MAX || aSize.Height() <= 0 )
388  aSize.setHeight( SHRT_MAX );
389 
390  mpImplData->maMaxOutSize = aSize;
391  if ( mpWindowImpl->mpBorderWindow )
392  {
393  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMaxOutputSize( aSize.Width(), aSize.Height() );
394  if ( mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame )
395  mpWindowImpl->mpBorderWindow->mpWindowImpl->mpFrame->SetMaxClientSize( aSize.Width(), aSize.Height() );
396  }
397  else if ( mpWindowImpl->mbFrame )
398  mpWindowImpl->mpFrame->SetMaxClientSize( aSize.Width(), aSize.Height() );
399 }
400 
402 {
403  return mpImplData->maMaxOutSize;
404 }
405 
407  const OString& rStr)
408 {
410  sal_Int32 nIndex = 0;
411 
412  OString aTokenStr = rStr.getToken(0, ',', nIndex);
413  if (!aTokenStr.isEmpty())
414  {
415  rData.SetX(aTokenStr.toInt32());
416  if( rData.GetX() > -16384 && rData.GetX() < 16384 )
417  nValidMask |= WindowStateMask::X;
418  else
419  rData.SetX( 0 );
420  }
421  else
422  rData.SetX( 0 );
423  aTokenStr = rStr.getToken(0, ',', nIndex);
424  if (!aTokenStr.isEmpty())
425  {
426  rData.SetY(aTokenStr.toInt32());
427  if( rData.GetY() > -16384 && rData.GetY() < 16384 )
428  nValidMask |= WindowStateMask::Y;
429  else
430  rData.SetY( 0 );
431  }
432  else
433  rData.SetY( 0 );
434  aTokenStr = rStr.getToken(0, ',', nIndex);
435  if (!aTokenStr.isEmpty())
436  {
437  rData.SetWidth(aTokenStr.toInt32());
438  if( rData.GetWidth() > 0 && rData.GetWidth() < 16384 )
439  nValidMask |= WindowStateMask::Width;
440  else
441  rData.SetWidth( 0 );
442  }
443  else
444  rData.SetWidth( 0 );
445  aTokenStr = rStr.getToken(0, ';', nIndex);
446  if (!aTokenStr.isEmpty())
447  {
448  rData.SetHeight(aTokenStr.toInt32());
449  if( rData.GetHeight() > 0 && rData.GetHeight() < 16384 )
450  nValidMask |= WindowStateMask::Height;
451  else
452  rData.SetHeight( 0 );
453  }
454  else
455  rData.SetHeight( 0 );
456  aTokenStr = rStr.getToken(0, ';', nIndex);
457  if (!aTokenStr.isEmpty())
458  {
459  // #94144# allow Minimize again, should be masked out when read from configuration
460  // 91625 - ignore Minimize
461  WindowStateState nState = static_cast<WindowStateState>(aTokenStr.toInt32());
462  //nState &= ~(WindowStateState::Minimized);
463  rData.SetState( nState );
464  nValidMask |= WindowStateMask::State;
465  }
466  else
468 
469  // read maximized pos/size
470  aTokenStr = rStr.getToken(0, ',', nIndex);
471  if (!aTokenStr.isEmpty())
472  {
473  rData.SetMaximizedX(aTokenStr.toInt32());
474  if( rData.GetMaximizedX() > -16384 && rData.GetMaximizedX() < 16384 )
475  nValidMask |= WindowStateMask::MaximizedX;
476  else
477  rData.SetMaximizedX( 0 );
478  }
479  else
480  rData.SetMaximizedX( 0 );
481  aTokenStr = rStr.getToken(0, ',', nIndex);
482  if (!aTokenStr.isEmpty())
483  {
484  rData.SetMaximizedY(aTokenStr.toInt32());
485  if( rData.GetMaximizedY() > -16384 && rData.GetMaximizedY() < 16384 )
486  nValidMask |= WindowStateMask::MaximizedY;
487  else
488  rData.SetMaximizedY( 0 );
489  }
490  else
491  rData.SetMaximizedY( 0 );
492  aTokenStr = rStr.getToken(0, ',', nIndex);
493  if (!aTokenStr.isEmpty())
494  {
495  rData.SetMaximizedWidth(aTokenStr.toInt32());
496  if( rData.GetMaximizedWidth() > 0 && rData.GetMaximizedWidth() < 16384 )
497  nValidMask |= WindowStateMask::MaximizedWidth;
498  else
499  rData.SetMaximizedWidth( 0 );
500  }
501  else
502  rData.SetMaximizedWidth( 0 );
503  aTokenStr = rStr.getToken(0, ';', nIndex);
504  if (!aTokenStr.isEmpty())
505  {
506  rData.SetMaximizedHeight(aTokenStr.toInt32());
507  if( rData.GetMaximizedHeight() > 0 && rData.GetMaximizedHeight() < 16384 )
508  nValidMask |= WindowStateMask::MaximizedHeight;
509  else
510  rData.SetMaximizedHeight( 0 );
511  }
512  else
513  rData.SetMaximizedHeight( 0 );
514 
515  // mark valid fields
516  rData.SetMask( nValidMask );
517 }
518 
519 OString WindowStateData::ToStr() const
520 {
521  const WindowStateMask nValidMask = GetMask();
522  if ( nValidMask == WindowStateMask::NONE )
523  return OString();
524 
525  OStringBuffer rStrBuf(64);
526 
527  if ( nValidMask & WindowStateMask::X )
528  rStrBuf.append(static_cast<sal_Int32>(GetX()));
529  rStrBuf.append(',');
530  if ( nValidMask & WindowStateMask::Y )
531  rStrBuf.append(static_cast<sal_Int32>(GetY()));
532  rStrBuf.append(',');
533  if ( nValidMask & WindowStateMask::Width )
534  rStrBuf.append(static_cast<sal_Int32>(GetWidth()));
535  rStrBuf.append(',');
536  if ( nValidMask & WindowStateMask::Height )
537  rStrBuf.append(static_cast<sal_Int32>(GetHeight()));
538  rStrBuf.append( ';' );
539  if ( nValidMask & WindowStateMask::State )
540  {
541  // #94144# allow Minimize again, should be masked out when read from configuration
542  // 91625 - ignore Minimize
544  rStrBuf.append(static_cast<sal_Int32>(nState));
545  }
546  rStrBuf.append(';');
547  if ( nValidMask & WindowStateMask::MaximizedX )
548  rStrBuf.append(static_cast<sal_Int32>(GetMaximizedX()));
549  rStrBuf.append(',');
550  if ( nValidMask & WindowStateMask::MaximizedY )
551  rStrBuf.append(static_cast<sal_Int32>(GetMaximizedY()));
552  rStrBuf.append( ',' );
553  if ( nValidMask & WindowStateMask::MaximizedWidth )
554  rStrBuf.append(static_cast<sal_Int32>(GetMaximizedWidth()));
555  rStrBuf.append(',');
556  if ( nValidMask & WindowStateMask::MaximizedHeight )
557  rStrBuf.append(static_cast<sal_Int32>(GetMaximizedHeight()));
558  rStrBuf.append(';');
559 
560  return rStrBuf.makeStringAndClear();
561 }
562 
563 void SystemWindow::ImplMoveToScreen( tools::Long& io_rX, tools::Long& io_rY, tools::Long i_nWidth, tools::Long i_nHeight, vcl::Window const * i_pConfigureWin )
564 {
565  tools::Rectangle aScreenRect;
568  else
569  {
570  aScreenRect = Application::GetScreenPosSizePixel( 0 );
571  for( unsigned int i = 1; i < Application::GetScreenCount(); i++ )
572  aScreenRect.Union( Application::GetScreenPosSizePixel( i ) );
573  }
574  // unfortunately most of the time width and height are not really known
575  if( i_nWidth < 1 )
576  i_nWidth = 50;
577  if( i_nHeight < 1 )
578  i_nHeight = 50;
579 
580  // check left border
581  bool bMove = false;
582  if( io_rX + i_nWidth < aScreenRect.Left() )
583  {
584  bMove = true;
585  io_rX = aScreenRect.Left();
586  }
587  // check right border
588  if( io_rX > aScreenRect.Right() - i_nWidth )
589  {
590  bMove = true;
591  io_rX = aScreenRect.Right() - i_nWidth;
592  }
593  // check top border
594  if( io_rY + i_nHeight < aScreenRect.Top() )
595  {
596  bMove = true;
597  io_rY = aScreenRect.Top();
598  }
599  // check bottom border
600  if( io_rY > aScreenRect.Bottom() - i_nHeight )
601  {
602  bMove = true;
603  io_rY = aScreenRect.Bottom() - i_nHeight;
604  }
605  vcl::Window* pParent = i_pConfigureWin->GetParent();
606  if( bMove && pParent )
607  {
608  // calculate absolute screen pos here, since that is what is contained in WindowState
609  Point aParentAbsPos( pParent->OutputToAbsoluteScreenPixel( Point(0,0) ) );
610  Size aParentSizePixel( pParent->GetOutputSizePixel() );
611  Point aPos( (aParentSizePixel.Width() - i_nWidth) / 2,
612  (aParentSizePixel.Height() - i_nHeight) / 2 );
613  io_rX = aParentAbsPos.X() + aPos.X();
614  io_rY = aParentAbsPos.Y() + aPos.Y();
615  }
616 }
617 
619 {
620  const WindowStateMask nValidMask = rData.GetMask();
621  if ( nValidMask == WindowStateMask::NONE )
622  return;
623 
624  if ( mbSysChild )
625  return;
626 
627  vcl::Window* pWindow = this;
628  while ( pWindow->mpWindowImpl->mpBorderWindow )
629  pWindow = pWindow->mpWindowImpl->mpBorderWindow;
630 
631  if ( pWindow->mpWindowImpl->mbFrame )
632  {
633  const WindowStateState nState = rData.GetState();
634  SalFrameState aState;
635  aState.mnMask = rData.GetMask();
636  aState.mnX = rData.GetX();
637  aState.mnY = rData.GetY();
638  aState.mnWidth = rData.GetWidth();
639  aState.mnHeight = rData.GetHeight();
640 
642  {
643  // #i43799# adjust window state sizes if a minimal output size was set
644  // otherwise the frame and the client might get different sizes
645  if( maMinOutSize.Width() > aState.mnWidth )
646  aState.mnWidth = maMinOutSize.Width();
647  if( maMinOutSize.Height() > aState.mnHeight )
648  aState.mnHeight = maMinOutSize.Height();
649  }
650 
651  aState.mnMaximizedX = rData.GetMaximizedX();
652  aState.mnMaximizedY = rData.GetMaximizedY();
653  aState.mnMaximizedWidth = rData.GetMaximizedWidth();
654  aState.mnMaximizedHeight = rData.GetMaximizedHeight();
655  // #94144# allow Minimize again, should be masked out when read from configuration
656  // 91625 - ignore Minimize
657  //nState &= ~(WindowStateState::Minimized);
658  aState.mnState = nState & WindowStateState::SystemMask;
659 
660  // normalize window positions onto screen
661  ImplMoveToScreen( aState.mnX, aState.mnY, aState.mnWidth, aState.mnHeight, pWindow );
662  ImplMoveToScreen( aState.mnMaximizedX, aState.mnMaximizedY, aState.mnMaximizedWidth, aState.mnMaximizedHeight, pWindow );
663 
664  // #96568# avoid having multiple frames at the same screen location
665  // do the check only if not maximized
666  if( !((rData.GetMask() & WindowStateMask::State) && (nState & WindowStateState::Maximized)) )
668  {
670  ImplSVData *pSVData = ImplGetSVData();
671  vcl::Window *pWin = pSVData->maFrameData.mpFirstFrame;
672  bool bWrapped = false;
673  while( pWin )
674  {
675  if( !pWin->ImplIsRealParentPath( this ) && ( pWin != this ) &&
676  pWin->ImplGetWindow()->IsTopWindow() && pWin->mpWindowImpl->mbReallyVisible )
677  {
678  SalFrameGeometry g = pWin->mpWindowImpl->mpFrame->GetGeometry();
679  if( std::abs(g.nX-aState.mnX) < 2 && std::abs(g.nY-aState.mnY) < 5 )
680  {
681  tools::Long displacement = g.nTopDecoration ? g.nTopDecoration : 20;
682  if( static_cast<tools::Long>(aState.mnX + displacement + aState.mnWidth + g.nRightDecoration) > aDesktop.Right() ||
683  static_cast<tools::Long>(aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > aDesktop.Bottom() )
684  {
685  // displacing would leave screen
686  aState.mnX = g.nLeftDecoration ? g.nLeftDecoration : 10; // should result in (0,0)
687  aState.mnY = displacement;
688  if( bWrapped ||
689  static_cast<tools::Long>(aState.mnX + displacement + aState.mnWidth + g.nRightDecoration) > aDesktop.Right() ||
690  static_cast<tools::Long>(aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > aDesktop.Bottom() )
691  break; // further displacement not possible -> break
692  // avoid endless testing
693  bWrapped = true;
694  }
695  else
696  {
697  // displace
698  aState.mnX += displacement;
699  aState.mnY += displacement;
700  }
701  pWin = pSVData->maFrameData.mpFirstFrame; // check new pos again
702  }
703  }
704  pWin = pWin->mpWindowImpl->mpFrameData->mpNextFrame;
705  }
706  }
707 
708  mpWindowImpl->mpFrame->SetWindowState( &aState );
709 
710  // do a synchronous resize for layout reasons
711  // but use rData only when the window is not to be maximized (#i38089#)
712  // otherwise we have no useful size information
713  if( (rData.GetMask() & WindowStateMask::State) && (nState & WindowStateState::Maximized) )
714  {
715  // query maximized size from frame
716  SalFrameGeometry aGeometry = mpWindowImpl->mpFrame->GetGeometry();
717 
718  // but use it only if it is different from the restore size (rData)
719  // as currently only on windows the exact size of a maximized window
720  // can be computed without actually showing the window
721  if( aGeometry.nWidth != rData.GetWidth() || aGeometry.nHeight != rData.GetHeight() )
722  ImplHandleResize( pWindow, aGeometry.nWidth, aGeometry.nHeight );
723  }
724  else
726  ImplHandleResize( pWindow, aState.mnWidth, aState.mnHeight ); // #i43799# use aState and not rData, see above
727  }
728  else
729  {
730  PosSizeFlags nPosSize = PosSizeFlags::NONE;
731  if ( nValidMask & WindowStateMask::X )
732  nPosSize |= PosSizeFlags::X;
733  if ( nValidMask & WindowStateMask::Y )
734  nPosSize |= PosSizeFlags::Y;
735  if ( nValidMask & WindowStateMask::Width )
736  nPosSize |= PosSizeFlags::Width;
737  if ( nValidMask & WindowStateMask::Height )
738  nPosSize |= PosSizeFlags::Height;
739 
740  tools::Long nX = rData.GetX();
741  tools::Long nY = rData.GetY();
742  tools::Long nWidth = rData.GetWidth();
743  tools::Long nHeight = rData.GetHeight();
744  const SalFrameGeometry& rGeom = pWindow->mpWindowImpl->mpFrame->GetGeometry();
745  if( nX < 0 )
746  nX = 0;
747  if( nX + nWidth > static_cast<tools::Long>(rGeom.nWidth) )
748  nX = rGeom.nWidth - nWidth;
749  if( nY < 0 )
750  nY = 0;
751  if( nY + nHeight > static_cast<tools::Long>(rGeom.nHeight) )
752  nY = rGeom.nHeight - nHeight;
753  setPosSizePixel( nX, nY, nWidth, nHeight, nPosSize );
754  }
755 }
756 
758 {
759  WindowStateMask nValidMask = rData.GetMask();
760  if ( nValidMask == WindowStateMask::NONE )
761  return;
762 
763  if ( mbSysChild )
764  return;
765 
766  const vcl::Window* pWindow = this;
767  while ( pWindow->mpWindowImpl->mpBorderWindow )
768  pWindow = pWindow->mpWindowImpl->mpBorderWindow;
769 
770  if ( pWindow->mpWindowImpl->mbFrame )
771  {
772  SalFrameState aState;
773  aState.mnMask = WindowStateMask::All;
774  if ( mpWindowImpl->mpFrame->GetWindowState( &aState ) )
775  {
776  if ( nValidMask & WindowStateMask::X )
777  rData.SetX( aState.mnX );
778  if ( nValidMask & WindowStateMask::Y )
779  rData.SetY( aState.mnY );
780  if ( nValidMask & WindowStateMask::Width )
781  rData.SetWidth( aState.mnWidth );
782  if ( nValidMask & WindowStateMask::Height )
783  rData.SetHeight( aState.mnHeight );
784  if ( aState.mnMask & WindowStateMask::MaximizedX )
785  {
786  rData.SetMaximizedX( aState.mnMaximizedX );
787  nValidMask |= WindowStateMask::MaximizedX;
788  }
789  if ( aState.mnMask & WindowStateMask::MaximizedY )
790  {
791  rData.SetMaximizedY( aState.mnMaximizedY );
792  nValidMask |= WindowStateMask::MaximizedY;
793  }
795  {
796  rData.SetMaximizedWidth( aState.mnMaximizedWidth );
797  nValidMask |= WindowStateMask::MaximizedWidth;
798  }
800  {
801  rData.SetMaximizedHeight( aState.mnMaximizedHeight );
802  nValidMask |= WindowStateMask::MaximizedHeight;
803  }
804  if ( nValidMask & WindowStateMask::State )
805  {
806  // #94144# allow Minimize again, should be masked out when read from configuration
807  // 91625 - ignore Minimize
808  if ( !(nValidMask&WindowStateMask::Minimized) )
810  rData.SetState( aState.mnState );
811  }
812  rData.SetMask( nValidMask );
813  }
814  else
816  }
817  else
818  {
819  Point aPos = GetPosPixel();
820  Size aSize = GetSizePixel();
822 
823  if ( nValidMask & WindowStateMask::X )
824  rData.SetX( aPos.X() );
825  if ( nValidMask & WindowStateMask::Y )
826  rData.SetY( aPos.Y() );
827  if ( nValidMask & WindowStateMask::Width )
828  rData.SetWidth( aSize.Width() );
829  if ( nValidMask & WindowStateMask::Height )
830  rData.SetHeight( aSize.Height() );
831  if ( nValidMask & WindowStateMask::State )
832  rData.SetState( nState );
833  }
834 }
835 
836 void SystemWindow::SetWindowState(const OString& rStr)
837 {
838  if (rStr.isEmpty())
839  return;
840 
842  ImplWindowStateFromStr( aData, rStr );
843  SetWindowStateData( aData );
844 }
845 
847 {
849  aData.SetMask( nMask );
850  GetWindowStateData( aData );
851 
852  return aData.ToStr();
853 }
854 
856 {
857  if ( mpMenuBar == pMenuBar )
858  return;
859 
860  MenuBar* pOldMenuBar = mpMenuBar;
861  vcl::Window* pOldWindow = nullptr;
862  VclPtr<vcl::Window> pNewWindow;
863  mpMenuBar = pMenuBar;
864 
865  if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WindowType::BORDERWINDOW) )
866  {
867  if ( pOldMenuBar )
868  pOldWindow = pOldMenuBar->ImplGetWindow();
869  else
870  pOldWindow = nullptr;
871  if ( pOldWindow )
872  {
873  CallEventListeners( VclEventId::WindowMenubarRemoved, static_cast<void*>(pOldMenuBar) );
874  pOldWindow->SetAccessible( css::uno::Reference< css::accessibility::XAccessible >() );
875  }
876  if ( pMenuBar )
877  {
878  SAL_WARN_IF( pMenuBar->pWindow, "vcl", "SystemWindow::SetMenuBar() - MenuBars can only set in one SystemWindow at time" );
879 
880  pNewWindow = MenuBar::ImplCreate(mpWindowImpl->mpBorderWindow, pOldWindow, pMenuBar);
881  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarWindow(pNewWindow);
882 
883  CallEventListeners( VclEventId::WindowMenubarAdded, static_cast<void*>(pMenuBar) );
884  }
885  else
886  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarWindow( nullptr );
888  if ( pOldMenuBar )
889  {
890  bool bDelete = (pMenuBar == nullptr);
891  if( bDelete && pOldWindow )
892  {
893  if( mpImplData->mpTaskPaneList )
894  mpImplData->mpTaskPaneList->RemoveWindow( pOldWindow );
895  }
896  MenuBar::ImplDestroy( pOldMenuBar, bDelete );
897  if( bDelete )
898  pOldWindow = nullptr; // will be deleted in MenuBar::ImplDestroy,
899  }
900 
901  }
902  else
903  {
904  if( pMenuBar )
905  pNewWindow = pMenuBar->ImplGetWindow();
906  if( pOldMenuBar )
907  pOldWindow = pOldMenuBar->ImplGetWindow();
908  }
909 
910  // update taskpane list to make menubar accessible
911  if( mpImplData->mpTaskPaneList )
912  {
913  if( pOldWindow )
914  mpImplData->mpTaskPaneList->RemoveWindow( pOldWindow );
915  if( pNewWindow )
916  mpImplData->mpTaskPaneList->AddWindow( pNewWindow );
917  }
918 }
919 
920 void SystemWindow::SetNotebookBar(const OUString& rUIXMLDescription,
921  const css::uno::Reference<css::frame::XFrame>& rFrame,
922  const NotebookBarAddonsItem& aNotebookBarAddonsItem,
923  bool bReloadNotebookbar)
924 {
925  if (rUIXMLDescription != maNotebookBarUIFile || bReloadNotebookbar)
926  {
927  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())
928  ->SetNotebookBar(rUIXMLDescription, rFrame, aNotebookBarAddonsItem);
929  maNotebookBarUIFile = rUIXMLDescription;
930  if(GetNotebookBar())
932  }
933 }
934 
936 {
937  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->CloseNotebookBar();
938  maNotebookBarUIFile.clear();
939 }
940 
942 {
943  return static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->GetNotebookBar();
944 }
945 
947 {
948  if ( mnMenuBarMode != nMode )
949  {
950  mnMenuBarMode = nMode;
951  if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WindowType::BORDERWINDOW) )
952  {
953  if ( nMode == MenuBarMode::Hide )
954  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarMode( true );
955  else
956  static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetMenuBarMode( false );
957  }
958  }
959 }
960 
962 {
963  if( mpImplData && mpImplData->mpTaskPaneList )
964  return mpImplData->mpTaskPaneList->IsInList( pWin );
965  return false;
966 }
967 
968 unsigned int SystemWindow::GetScreenNumber() const
969 {
970  return mpWindowImpl->mpFrame->maGeometry.nDisplayScreenNumber;
971 }
972 
973 void SystemWindow::SetScreenNumber(unsigned int nDisplayScreen)
974 {
975  mpWindowImpl->mpFrame->SetScreenNumber( nDisplayScreen );
976 }
977 
978 void SystemWindow::SetApplicationID(const OUString &rApplicationID)
979 {
980  mpWindowImpl->mpFrame->SetApplicationID( rApplicationID );
981 }
982 
984 {
985  mpImplData->maCloseHdl = rLink;
986 }
987 
989 {
990  return mpImplData->maCloseHdl;
991 }
992 
994 {
995  if (!isLayoutEnabled())
996  return;
998  return;
1000  if (hasPendingLayout())
1001  return;
1002  maLayoutIdle.Start();
1003 }
1004 
1006 {
1007  queue_resize();
1008 }
1009 
1011 {
1012  //pre dtor called, and single child is a container => we're layout enabled
1013  return mpImplData && ::isLayoutEnabled(this);
1014 }
1015 
1017 {
1018  if (!isLayoutEnabled())
1019  return Window::GetOptimalSize();
1020 
1022  // tdf#141318 Do the same as SystemWindow::setOptimalLayoutSize in case we're called before initial layout
1023  const_cast<SystemWindow*>(this)->settingOptimalLayoutSize(pBox);
1025 
1026  sal_Int32 nBorderWidth = get_border_width();
1027 
1028  aSize.AdjustHeight(2 * nBorderWidth );
1029  aSize.AdjustWidth(2 * nBorderWidth );
1030 
1031  return Window::CalcWindowSize(aSize);
1032 }
1033 
1035 {
1036  sal_Int32 nBorderWidth = get_border_width();
1037 
1038  aSize.AdjustWidth( -(2 * nBorderWidth) );
1039  aSize.AdjustHeight( -(2 * nBorderWidth) );
1040 
1041  Point aPos(nBorderWidth, nBorderWidth);
1043 }
1044 
1045 IMPL_LINK_NOARG( SystemWindow, ImplHandleLayoutTimerHdl, Timer*, void )
1046 {
1047  Window *pBox = GetWindow(GetWindowType::FirstChild);
1048  if (!isLayoutEnabled())
1049  {
1050  SAL_WARN_IF(pBox, "vcl.layout", "SystemWindow has become non-layout because extra children have been added directly to it.");
1051  return;
1052  }
1053  assert(pBox);
1054  setPosSizeOnContainee(GetSizePixel(), *pBox);
1055 }
1056 
1057 void SystemWindow::SetText(const OUString& rStr)
1058 {
1060  Window::SetText(rStr);
1061 }
1062 
1063 OUString SystemWindow::GetText() const
1064 {
1065  const_cast<SystemWindow*>(this)->setDeferredProperties();
1066  return Window::GetText();
1067 }
1068 
1070 {
1071 }
1072 
1074 {
1075  maLayoutIdle.Stop();
1076 
1077  //resize SystemWindow to fit requisition on initial show
1079 
1081 
1082  Size aSize = get_preferred_size();
1083 
1085 
1086  aSize.setWidth( std::min(aMax.Width(), aSize.Width()) );
1087  aSize.setHeight( std::min(aMax.Height(), aSize.Height()) );
1088 
1089  SetMinOutputSizePixel(aSize);
1090  SetSizePixel(aSize);
1091  setPosSizeOnContainee(aSize, *pBox);
1092 }
1093 
1095 {
1096  if (GetSettings().GetStyleSettings().GetAutoMnemonic())
1097  Accelerator::GenerateAutoMnemonicsOnHierarchy(this);
1098 
1099  if (isLayoutEnabled())
1100  {
1105  }
1106 }
1107 
1109 {
1110  SAL_WARN("vcl.layout", "SystemWindow in layout without doDeferredInit impl");
1111 }
1112 
1114 {
1115  // same prerequisites as in Execute()
1118  Show();
1119  ToTop();
1120  ensureRepaint();
1121 
1122  Size aSize(GetOutputSizePixel());
1123 
1125  xOutput->SetOutputSizePixel(aSize);
1126 
1127  Point aPos;
1128  xOutput->DrawOutDev(aPos, aSize, aPos, aSize, *GetOutDev());
1129 
1130  return xOutput;
1131 }
1132 
1134 {
1135  Window::PrePaint(rRenderContext);
1136  mbPaintComplete = false;
1137 }
1138 
1140 {
1141  Window::PostPaint(rRenderContext);
1142  mbPaintComplete = true;
1143 }
1144 
1146 {
1147  // ensure repaint
1148  Invalidate();
1149  mbPaintComplete = false;
1150 
1151  while (!mbPaintComplete && !Application::IsQuit())
1152  {
1154  }
1155 }
1156 
1158 {
1159  if (MenuBar* pMenu = GetMenuBar())
1160  {
1161  sal_uInt16 nMenuItems = pMenu->GetItemCount();
1162  for ( sal_uInt16 i = 0; i < nMenuItems; ++i )
1163  rMnemonicGenerator.RegisterMnemonic( pMenu->GetItemText( pMenu->GetItemId( i ) ) );
1164  }
1165 }
1166 
1168 {
1169  if (MenuBar* pMenuBar = GetMenuBar())
1170  return pMenuBar->GetMenuBarHeight();
1171  return 0;
1172 }
1173 
1174 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual Point GetPosPixel() const
Definition: window.cxx:2780
unsigned int GetMaximizedHeight() const
Definition: windowstate.hxx:76
vcl::Window * ImplGetWindow() const
if this is a proxy return the client, otherwise itself
Definition: window2.cxx:829
void setDeferredProperties()
Definition: dialog.cxx:1572
static void setLayoutAllocation(vcl::Window &rWindow, const Point &rPos, const Size &rSize)
Definition: layout.cxx:70
sal_Int32 nIndex
bool IsMod2() const
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
void setWidth(tools::Long nWidth)
WindowStateState mnState
Definition: salwtype.hxx:245
SAL_DLLPRIVATE void ensureRepaint()
Definition: syswin.cxx:1145
VclPtr< MenuBar > mpMenuBar
Definition: syswin.hxx:97
void ImplHandleResize(vcl::Window *pWindow, tools::Long nNewWidth, tools::Long nNewHeight)
Definition: winproc.cxx:1639
const CommandEvent * GetCommandEvent() const
Definition: event.hxx:332
OString GetWindowState(WindowStateMask nMask=WindowStateMask::All) const
Definition: syswin.cxx:846
virtual void ImplAdjustNWFSizes()
Definition: window3.cxx:28
void SetState(WindowStateState nState)
Definition: windowstate.hxx:67
WinBits const WB_NODIALOGCONTROL
int GetMenuBarHeight() const
Definition: syswin.cxx:1167
tools::Long mnMaximizedHeight
Definition: salwtype.hxx:244
OString ToStr() const
Definition: syswin.cxx:519
const Link< SystemWindow &, void > & GetCloseHdl() const
Definition: syswin.cxx:988
Resize runs before repaint, so we won't paint twice.
int GetY() const
Definition: windowstate.hxx:62
static Size getLayoutRequisition(const vcl::Window &rWindow)
Definition: layout.cxx:145
long Long
ImplSVNWFData maNWFData
Definition: svdata.hxx:397
void CollectMenuBarMnemonics(MnemonicGenerator &rMnemonicGenerator) const
Definition: syswin.cxx:1157
SAL_DLLPRIVATE vcl::Window * ImplGetBorderWindow() const
Definition: window2.cxx:869
void InvalidateSizeCache()
clear OptimalSize cache
Definition: window2.cxx:1306
int GetX() const
Definition: windowstate.hxx:60
virtual Size GetSizePixel() const
Definition: window.cxx:2391
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
Definition: window2.cxx:900
virtual void SetSizePixel(const Size &rNewSize)
Definition: window2.cxx:1261
void ShowTitleButton(TitleButton nButton, bool bVisible)
Definition: syswin.cxx:332
TabPage * GetTabPage(sal_uInt16 nPageId) const
Definition: tabctrl.cxx:1894
WindowStateState GetState() const
Definition: windowstate.hxx:68
const Size & GetMaxOutputSizePixel() const
Definition: syswin.cxx:401
SAL_DLLPRIVATE bool ImplHandleCmdEvent(const CommandEvent &rCEvent)
Definition: menu.cxx:2560
sal_uInt16 GetCode() const
Definition: keycod.hxx:51
static bool IsUnifiedDisplay()
Determines if the screens that make up a display are separate or form one large display area...
Definition: svapp.cxx:1229
VclPtr< VirtualDevice > createScreenshot()
Definition: syswin.cxx:1113
PosSizeFlags
Definition: window.hxx:125
const KeyEvent * GetKeyEvent() const
Definition: event.hxx:316
std::unique_ptr< TaskPaneList > mpTaskPaneList
Definition: syswin.cxx:55
std::unique_ptr< ImplData > mpImplData
Definition: syswin.hxx:109
The invalidated area is updated immediately.
tools::Rectangle GetDesktopRectPixel() const
Definition: window.cxx:2785
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:1034
bool IsCreatedWithToolkit() const
Definition: window2.cxx:1236
unsigned int GetHeight() const
Definition: windowstate.hxx:66
const CommandModKeyData * GetModKeyData() const
void SetMaximizedWidth(unsigned int nRWidth)
Definition: windowstate.hxx:73
static SAL_DLLPRIVATE VclPtr< vcl::Window > ImplCreate(vcl::Window *pParent, vcl::Window *pWindow, MenuBar *pMenu)
Definition: menu.cxx:2493
unsigned int GetMaximizedWidth() const
Definition: windowstate.hxx:74
virtual void PrePaint(vcl::RenderContext &rRenderContext) override
Definition: syswin.cxx:1133
StateChangedType
Definition: window.hxx:289
constexpr tools::Long Width() const
sal_Int64 WinBits
tools::ULong nRightDecoration
Definition: salgeom.hxx:34
Size CalcOutputSize(const Size &rWinSz) const
Definition: window2.cxx:539
tools::Long Left() const
static void Yield()
Process the next event.
Definition: svapp.cxx:530
Creates a hierarchy of vcl::Windows (widgets) from a .ui file for dialogs, sidebar, etc.
Definition: builder.hxx:66
void SetMaximizedHeight(unsigned int nRHeight)
Definition: windowstate.hxx:75
void SetMaximizedX(int nRX)
Definition: windowstate.hxx:69
vcl::Window * nextLogicalChildOfParent(const vcl::Window *pTopLevel, const vcl::Window *pChild)
Definition: dialog.cxx:132
void Hide()
Definition: window.hxx:897
void SetSystemWindow(SystemWindow *pSystemWindow)
tools::Long Bottom() const
IMPL_LINK_NOARG(SystemWindow, ImplHandleLayoutTimerHdl, Timer *, void)
Definition: syswin.cxx:1045
unsigned int GetWidth() const
Definition: windowstate.hxx:64
WindowStateMask
Definition: vclenum.hxx:121
bool IsTopWindow() const
Definition: stacking.cxx:608
void CloseNotebookBar()
Definition: syswin.cxx:935
void SetCloseHdl(const Link< SystemWindow &, void > &rLink)
Definition: syswin.cxx:983
virtual OUString GetText() const
Definition: window.cxx:3044
void SetAccessible(const css::uno::Reference< css::accessibility::XAccessible > &)
Idle maLayoutIdle
Definition: syswin.hxx:110
VclPtr< NotebookBar > const & GetNotebookBar() const
Definition: syswin.cxx:941
Link< SystemWindow &, void > maCloseHdl
Definition: syswin.cxx:58
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:920
tools::Long mnMaximizedX
Definition: salwtype.hxx:241
bool mbAutoAccel
Definition: svdata.hxx:333
constexpr OUStringLiteral aData
void SetDebugName(const char *pDebugName)
Definition: task.hxx:82
vcl::Window * firstLogicalChildOfParent(const vcl::Window *pTopLevel)
Definition: dialog.cxx:188
virtual bool Close()
Definition: syswin.cxx:266
void SetMinOutputSizePixel(const Size &rSize)
Definition: syswin.cxx:369
static OUString GetUIRootDir()
Definition: dialog.cxx:556
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:2530
static tools::Rectangle GetScreenPosSizePixel(unsigned int nScreen)
Get a screen's rectangular area.
Definition: svapp.cxx:1264
virtual bool PreNotify(NotifyEvent &rNEvt) override
Definition: syswin.cxx:202
virtual void doDeferredInit(WinBits nBits)
Definition: syswin.cxx:1108
unsigned int GetScreenNumber() const
Returns the screen number the window is on.
Definition: syswin.cxx:968
Window(WindowType nType)
Definition: window.cxx:92
tools::Long mnWidth
Definition: salwtype.hxx:239
int i
void ToTop(ToTopFlags nFlags=ToTopFlags::NONE)
Definition: stacking.cxx:418
bool IsSystemWindow() const
Definition: window2.cxx:996
int GetMaximizedY() const
Definition: windowstate.hxx:72
void SetMaxOutputSizePixel(const Size &rSize)
Definition: syswin.cxx:382
tools::Long nY
Definition: salgeom.hxx:30
bool SetOutputSizePixel(const Size &rNewSize, bool bErase=true)
Definition: virdev.cxx:396
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1144
tools::Long mnMaximizedWidth
Definition: salwtype.hxx:243
virtual Size GetOptimalSize() const override
Definition: syswin.cxx:1016
int GetMaximizedX() const
Definition: windowstate.hxx:70
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:162
const AllSettings & GetSettings() const
Definition: window3.cxx:129
CommandEventId GetCommand() const
static void ImplHandleControlAccelerator(const vcl::Window *pWindow, bool bShow)
Definition: syswin.cxx:115
bool isCalculatingInitialLayoutSize() const
Definition: syswin.hxx:164
sal_uInt16 mnIcon
Definition: syswin.hxx:108
std::unique_ptr< WindowImpl > mpWindowImpl
Definition: window.hxx:496
Size get_preferred_size() const
Definition: window2.cxx:1660
bool mbIsDeferredInit
Definition: syswin.hxx:113
std::unique_ptr< VclBuilder > m_pUIBuilder
Definition: syswin.hxx:86
void GrabFocusToDocument()
Definition: window.cxx:2975
void SetX(int nX)
Definition: windowstate.hxx:59
tools::ULong nTopDecoration
Definition: salgeom.hxx:34
bool isLayoutEnabled(const vcl::Window *pWindow)
Definition: layout.cxx:2884
MouseNotifyEvent GetType() const
Definition: event.hxx:308
SAL_DLLPRIVATE bool ImplIsRealParentPath(const vcl::Window *pWindow) const
Definition: stacking.cxx:669
OUString maNotebookBarUIFile
Definition: syswin.hxx:111
static unsigned int GetScreenCount()
Get the number of screens available for the display.
Definition: svapp.cxx:1223
Size maMinOutSize
Definition: syswin.hxx:101
void SetShowAccelerator(bool val)
Definition: ctrl.cxx:363
tools::Long Top() const
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:563
bool IsTitleButtonVisible(TitleButton nButton) const
Definition: syswin.cxx:361
vcl::Window * GetParent() const
Definition: window2.cxx:1096
SAL_DLLPRIVATE bool hasPendingLayout() const
Definition: syswin.hxx:242
void SetWindowStateData(const WindowStateData &rData)
Definition: syswin.cxx:618
Point OutputToAbsoluteScreenPixel(const Point &rPos) const
Definition: window.cxx:2841
SAL_DLLPRIVATE vcl::Window * ImplGetWindow() const
Definition: menu.hxx:217
tools::Long mnHeight
Definition: salwtype.hxx:240
tools::Long nX
Definition: salgeom.hxx:30
void setOptimalLayoutSize()
Definition: syswin.cxx:1073
tools::ULong nWidth
Definition: salgeom.hxx:32
vcl::Window * GetWindow(GetWindowType nType) const
Definition: stacking.cxx:1035
void disposeBuilder()
Definition: dialog.cxx:550
void SetMask(WindowStateMask nValidMask)
Definition: windowstate.hxx:56
virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags=PosSizeFlags::All)
Definition: window.cxx:2655
void SetWidth(unsigned int nWidth)
Definition: windowstate.hxx:63
virtual ~SystemWindow() override
Definition: syswin.cxx:96
void GetWindowStateData(WindowStateData &rData) const
Definition: syswin.cxx:757
const vcl::KeyCode & GetKeyCode() const
Definition: event.hxx:57
SAL_DLLPRIVATE bool ImplIsInTaskPaneList(vcl::Window *pWin)
Definition: syswin.cxx:961
void SetMenuBarMode(MenuBarMode nMode)
Definition: syswin.cxx:946
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
bool IsShift() const
Definition: keycod.hxx:56
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout) override
Definition: syswin.cxx:993
SAL_DLLPRIVATE void ImplToBottomChild()
Definition: stacking.cxx:194
void SetY(int nY)
Definition: windowstate.hxx:61
OUString maRepresentedURL
Definition: syswin.cxx:57
void SetMaximizedY(int nRY)
Definition: windowstate.hxx:71
void Stop()
Definition: scheduler.cxx:590
SystemWindow(WindowType nType)
Definition: syswin.cxx:67
WindowType
Definition: ctrl.hxx:33
tools::Rectangle & Union(const tools::Rectangle &rRect)
#define SAL_WARN_IF(condition, area, stream)
MenuBar * GetMenuBar() const
Definition: syswin.hxx:184
constexpr tools::Long Height() const
ImplSVFrameData maFrameData
Definition: svdata.hxx:393
bool mbDockBtn
Definition: syswin.hxx:102
virtual OUString GetText() const override
Definition: syswin.cxx:1063
bool HandleKeyEvent(const KeyEvent &rKeyEvent)
tools::ULong nLeftDecoration
Definition: salgeom.hxx:34
::OutputDevice const * GetOutDev() const
Definition: window.cxx:565
virtual void SetText(const OUString &rStr) override
Definition: syswin.cxx:1057
tools::Long AdjustWidth(tools::Long n)
MenuBarMode mnMenuBarMode
Definition: syswin.hxx:107
bool IsMod1() const
Definition: keycod.hxx:58
virtual void settingOptimalLayoutSize(Window *pBox)
Definition: syswin.cxx:1069
void SetInvokeHandler(const Link< Timer *, void > &rLink)
Definition: timer.hxx:56
tools::ULong nHeight
Definition: salgeom.hxx:32
virtual void DrawOutDev(const Point &rDestPt, const Size &rDestSize, const Point &rSrcPt, const Size &rSrcSize)
Definition: outdev.cxx:360
tools::Long AdjustHeight(tools::Long n)
void SetWindowState(const OString &rStr)
Definition: syswin.cxx:836
Size GetOutputSizePixel() const
Definition: window3.cxx:89
WindowStateMask GetMask() const
Definition: windowstate.hxx:57
VclPtr< vcl::Window > mpDialogParent
Definition: syswin.hxx:114
void setHeight(tools::Long nHeight)
bool mbHideBtn
Definition: syswin.hxx:103
tools::Long mnMaximizedY
Definition: salwtype.hxx:242
virtual void Start(bool bStartTimer=true) override
Schedules the task for execution.
Definition: idle.cxx:34
void SetHeight(unsigned int nHeight)
Definition: windowstate.hxx:65
WindowType GetType() const
Definition: window2.cxx:973
virtual void PostPaint(vcl::RenderContext &rRenderContext) override
Definition: syswin.cxx:1139
VclPtr< vcl::Window > mpFirstFrame
Definition: svdata.hxx:238
tools::Long mnX
Definition: salwtype.hxx:237
#define SAL_WARN(area, stream)
tools::Long mnY
Definition: salwtype.hxx:238
void ImplWindowStateFromStr(WindowStateData &rData, const OString &rStr)
Definition: syswin.cxx:406
virtual void TitleButtonClick(TitleButton nButton)
Definition: syswin.cxx:291
WinBits GetStyle() const
Definition: window2.cxx:952
Definition: timer.hxx:26
TaskPaneList * GetTaskPaneList()
Definition: syswin.cxx:244
void SetPriority(TaskPriority ePriority)
Definition: scheduler.cxx:597
bool mbIsCalculatingInitialLayoutSize
Definition: syswin.hxx:105
WindowStateState
Definition: vclenum.hxx:303
WinBits const WB_CLOSEABLE
bool mbPaintComplete
Definition: syswin.hxx:106
void SetScreenNumber(unsigned int nNewScreen)
Move the Window to a new screen.
Definition: syswin.cxx:973
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
Definition: event.cxx:218
WindowStateMask mnMask
Definition: salwtype.hxx:236
void RegisterMnemonic(const OUString &rKey)
Definition: mnemonic.cxx:81
sal_Int32 nState
void SetApplicationID(const OUString &rApplicationID)
Definition: syswin.cxx:978
bool mbSysChild
Definition: syswin.hxx:104
bool isDisposed() const
virtual void Resize() override
Definition: syswin.cxx:1005
bool isLayoutEnabled() const
Definition: syswin.cxx:1010
void SetMenuBar(MenuBar *pMenuBar)
Definition: syswin.cxx:855
tools::Long Right() const
sal_Int32 get_border_width() const
Definition: window2.cxx:1841
SAL_DLLPRIVATE void DoInitialLayout()
Definition: syswin.cxx:1094
sal_uInt16 GetCurPageId() const
Definition: tabctrl.cxx:1838
Size bestmaxFrameSizeForScreenSize(const Size &rScreenSize)
Definition: dialog.cxx:705
static bool IsQuit()
Has Quit() been called?
Definition: svapp.cxx:580
tools::ULong nBottomDecoration
Definition: salgeom.hxx:34
TitleButton
Definition: syswin.hxx:54
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Definition: window.cxx:2177
static SAL_DLLPRIVATE void ImplDestroy(MenuBar *pMenu, bool bDelete)
Definition: menu.cxx:2517
MenuBarMode
Definition: syswin.hxx:49