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