LibreOffice Module vcl (master)  1
help.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 <comphelper/string.hxx>
21 #include <sal/log.hxx>
22 
23 #include <tools/diagnose_ex.h>
24 #include <tools/time.hxx>
25 
26 #include <vcl/window.hxx>
27 #include <vcl/event.hxx>
28 #include <vcl/svapp.hxx>
29 #include <vcl/wrkwin.hxx>
30 #include <vcl/help.hxx>
31 #include <vcl/settings.hxx>
32 
33 #include <helpwin.hxx>
34 #include <salframe.hxx>
35 #include <svdata.hxx>
36 
37 #define HELPWINSTYLE_QUICK 0
38 #define HELPWINSTYLE_BALLOON 1
39 
40 #define HELPTEXTMARGIN_QUICK 3
41 #define HELPTEXTMARGIN_BALLOON 6
42 
43 #define HELPTEXTMAXLEN 150
44 
46 {
47 }
48 
50 {
51 }
52 
53 bool Help::Start( const OUString&, const vcl::Window* )
54 {
55  return false;
56 }
57 
58 bool Help::Start(const OUString&, weld::Widget*)
59 {
60  return false;
61 }
62 
63 void Help::SearchKeyword( const OUString& )
64 {
65 }
66 
67 OUString Help::GetHelpText( const OUString&, const vcl::Window* )
68 {
69  return OUString();
70 }
71 
72 OUString Help::GetHelpText( const OUString&, const weld::Widget* )
73 {
74  return OUString();
75 }
76 
78 {
80 }
81 
83 {
85 }
86 
88 {
90 }
91 
93 {
95 }
96 
98 {
99  ImplGetSVHelpData().mbExtHelp = false;
100 }
101 
103 {
104  return ImplGetSVHelpData().mbExtHelp;
105 }
106 
108 {
109  ImplSVData* pSVData = ImplGetSVData();
110  ImplSVHelpData& aHelpData = ImplGetSVHelpData();
111 
112  if ( aHelpData.mbExtHelp && !aHelpData.mbExtHelpMode )
113  {
114  aHelpData.mbExtHelpMode = true;
115  aHelpData.mbOldBalloonMode = aHelpData.mbBalloonHelp;
116  aHelpData.mbBalloonHelp = true;
117  if (pSVData->maFrameData.mpAppWin)
119  return true;
120  }
121 
122  return false;
123 }
124 
126 {
127  ImplSVData* pSVData = ImplGetSVData();
128  ImplSVHelpData& aHelpData = ImplGetSVHelpData();
129 
130  if ( aHelpData.mbExtHelp && aHelpData.mbExtHelpMode )
131  {
132  aHelpData.mbExtHelpMode = false;
133  aHelpData.mbBalloonHelp = aHelpData.mbOldBalloonMode;
134  if (pSVData->maFrameData.mpAppWin)
136  return true;
137  }
138 
139  return false;
140 }
141 
143 {
145 }
146 
148 {
150 }
151 
153 {
155 }
156 
158  const Point& rScreenPos, const tools::Rectangle& rRect,
159  const OUString& rHelpText )
160 {
162  rHelpText, rScreenPos, rRect );
163 }
164 
166 {
168 }
169 
171 {
172  ImplGetSVHelpData().mbQuickHelp = false;
173 }
174 
176 {
178 }
179 
181  const tools::Rectangle& rScreenRect,
182  const OUString& rHelpText,
183  QuickHelpFlags nStyle )
184 {
185  sal_uInt16 nHelpWinStyle = ( nStyle & QuickHelpFlags::TipStyleBalloon ) ? HELPWINSTYLE_BALLOON : HELPWINSTYLE_QUICK;
186  ImplShowHelpWindow( pParent, nHelpWinStyle, nStyle,
187  rHelpText,
188  pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), rScreenRect );
189 }
190 
192 {
193  HelpTextWindow const * pHelpWin = ImplGetSVHelpData().mpHelpWin;
194  bool const bIsVisible = ( pHelpWin != nullptr ) && pHelpWin->IsVisible();
195  ImplDestroyHelpWindow( bIsVisible );
196 }
197 
198 void* Help::ShowPopover(vcl::Window* pParent, const tools::Rectangle& rScreenRect,
199  const OUString& rText, QuickHelpFlags nStyle)
200 {
201  void* nId = pParent->ImplGetFrame()->ShowPopover(rText, pParent, rScreenRect, nStyle);
202  if (nId)
203  {
204  //popovers are handled natively, return early
205  return nId;
206  }
207 
208  sal_uInt16 nHelpWinStyle = ( nStyle & QuickHelpFlags::TipStyleBalloon ) ? HELPWINSTYLE_BALLOON : HELPWINSTYLE_QUICK;
209  VclPtrInstance<HelpTextWindow> pHelpWin( pParent, rText, nHelpWinStyle, nStyle );
210 
211  nId = pHelpWin.get();
212  UpdatePopover(nId, pParent, rScreenRect, rText);
213 
214  pHelpWin->ShowHelp(true);
215  return nId;
216 }
217 
218 void Help::UpdatePopover(void* nId, vcl::Window* pParent, const tools::Rectangle& rScreenRect,
219  const OUString& rText)
220 {
221  if (pParent->ImplGetFrame()->UpdatePopover(nId, rText, pParent, rScreenRect))
222  {
223  //popovers are handled natively, return early
224  return;
225  }
226 
227  HelpTextWindow* pHelpWin = static_cast< HelpTextWindow* >( nId );
228  ENSURE_OR_RETURN_VOID( pHelpWin != nullptr, "Help::UpdatePopover: invalid ID!" );
229 
230  Size aSz = pHelpWin->CalcOutSize();
231  pHelpWin->SetOutputSizePixel( aSz );
232  ImplSetHelpWindowPos( pHelpWin, pHelpWin->GetWinStyle(), pHelpWin->GetStyle(),
233  pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), rScreenRect );
234 
235  pHelpWin->SetHelpText( rText );
236  pHelpWin->Invalidate();
237 }
238 
239 void Help::HidePopover(vcl::Window const * pParent, void* nId)
240 {
241  if (pParent->ImplGetFrame()->HidePopover(nId))
242  {
243  //popovers are handled natively, return early
244  return;
245  }
246 
247  VclPtr<HelpTextWindow> pHelpWin = static_cast<HelpTextWindow*>(nId);
248  vcl::Window* pFrameWindow = pHelpWin->ImplGetFrameWindow();
249  pHelpWin->Hide();
250  // trigger update, so that a Paint is instantly triggered since we do not save the background
251  pFrameWindow->ImplUpdateAll();
252  pHelpWin.disposeAndClear();
254 }
255 
256 HelpTextWindow::HelpTextWindow( vcl::Window* pParent, const OUString& rText, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle ) :
257  FloatingWindow( pParent, WB_SYSTEMWINDOW|WB_TOOLTIPWIN ), // #105827# if we change the parent, mirroring will not work correctly when positioning this window
258  maHelpText( rText )
259 {
260  SetType( WindowType::HELPTEXTWINDOW );
261  ImplSetMouseTransparent( true );
262  mnHelpWinStyle = nHelpWinStyle;
263  mnStyle = nStyle;
264 
266  {
267  ComplexTextLayoutFlags nLayoutMode = GetLayoutMode();
269  SetLayoutMode( nLayoutMode );
270  }
271  SetHelpText( rText );
272  Window::SetHelpText( rText );
273 
274  if ( ImplGetSVHelpData().mbSetKeyboardHelp )
276 
277 
278  maShowTimer.SetInvokeHandler( LINK( this, HelpTextWindow, TimerHdl ) );
279  maShowTimer.SetDebugName( "vcl::HelpTextWindow maShowTimer" );
280 
281  const HelpSettings& rHelpSettings = pParent->GetSettings().GetHelpSettings();
282  maHideTimer.SetTimeout( rHelpSettings.GetTipTimeout() );
283  maHideTimer.SetInvokeHandler( LINK( this, HelpTextWindow, TimerHdl ) );
284  maHideTimer.SetDebugName( "vcl::HelpTextWindow maHideTimer" );
285 }
286 
288 {
289  const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
290  SetPointFont(rRenderContext, rStyleSettings.GetHelpFont());
291  rRenderContext.SetTextColor(rStyleSettings.GetHelpTextColor());
292  rRenderContext.SetTextAlign(ALIGN_TOP);
293 
295  {
298  SetPaintTransparent(true);
299  rRenderContext.SetBackground();
300  }
301  else
302  rRenderContext.SetBackground(Wallpaper(rStyleSettings.GetHelpColor()));
303 
304  if (rStyleSettings.GetHelpColor().IsDark())
305  rRenderContext.SetLineColor(COL_WHITE);
306  else
307  rRenderContext.SetLineColor(COL_BLACK);
308  rRenderContext.SetFillColor();
309 }
310 
312 {
313  disposeOnce();
314 }
315 
317 {
318  maShowTimer.Stop();
319  maHideTimer.Stop();
320 
321  if( this == ImplGetSVHelpData().mpHelpWin )
322  ImplGetSVHelpData().mpHelpWin = nullptr;
324 }
325 
326 void HelpTextWindow::SetHelpText( const OUString& rHelpText )
327 {
328  maHelpText = rHelpText;
329  ApplySettings(*this);
330  if ( mnHelpWinStyle == HELPWINSTYLE_QUICK && maHelpText.getLength() < HELPTEXTMAXLEN && maHelpText.indexOf('\n') < 0)
331  {
332  Size aSize;
333  aSize.setHeight( GetTextHeight() );
336  else
337  aSize.setWidth( GetTextWidth( maHelpText ) );
339  }
340  else // HELPWINSTYLE_BALLOON
341  {
342  sal_Int32 nCharsInLine = 35 + ((maHelpText.getLength()/100)*5);
343  // average width to have all windows consistent
344  OUStringBuffer aBuf;
345  comphelper::string::padToLength(aBuf, nCharsInLine, 'x');
346  OUString aXXX = aBuf.makeStringAndClear();
347  long nWidth = GetTextWidth( aXXX );
348  Size aTmpSize( nWidth, 0x7FFFFFFF );
349  tools::Rectangle aTry1( Point(), aTmpSize );
353  nDrawFlags |= DrawTextFlags::Mnemonic;
354  tools::Rectangle aTextRect = GetTextRect( aTry1, maHelpText, nDrawFlags );
355 
356  // get a better width later...
357  maTextRect = aTextRect;
358 
359  // safety distance...
361  }
362 
363  Size aSize( CalcOutSize() );
364  SetOutputSizePixel( aSize );
365 }
366 
368 {
369  VclPtr<HelpTextWindow> xWindow( this );
370  Show( true, ShowFlags::NoActivate );
371  if( !xWindow->IsDisposed() )
372  Update();
373 }
374 
376 {
377  // paint native background
378  bool bNativeOK = false;
380  {
381  tools::Rectangle aCtrlRegion(Point(0, 0), GetOutputSizePixel());
382  ImplControlValue aControlValue;
383  bNativeOK = rRenderContext.DrawNativeControl(ControlType::Tooltip, ControlPart::Entire, aCtrlRegion,
384  ControlState::NONE, aControlValue, OUString());
385  }
386 
387  // paint text
388  if (mnHelpWinStyle == HELPWINSTYLE_QUICK && maHelpText.getLength() < HELPTEXTMAXLEN && maHelpText.indexOf('\n') < 0)
389  {
391  rRenderContext.DrawCtrlText(maTextRect.TopLeft(), maHelpText);
392  else
393  rRenderContext.DrawText(maTextRect.TopLeft(), maHelpText);
394  }
395  else // HELPWINSTYLE_BALLOON
396  {
400  nDrawFlags |= DrawTextFlags::Mnemonic;
401  rRenderContext.DrawText(maTextRect, maHelpText, nDrawFlags);
402  }
403 
404  // border
405  if (!bNativeOK)
406  {
407  Size aSz = GetOutputSizePixel();
408  rRenderContext.DrawRect(tools::Rectangle(Point(), aSz));
410  {
411  aSz.AdjustWidth( -2 );
412  aSz.AdjustHeight( -2 );
413  Color aColor(rRenderContext.GetLineColor());
414  rRenderContext.SetLineColor(COL_GRAY);
415  rRenderContext.DrawRect(tools::Rectangle(Point(1, 1), aSz));
416  rRenderContext.SetLineColor(aColor);
417  }
418  }
419 }
420 
421 void HelpTextWindow::ShowHelp(bool bNoDelay)
422 {
423  sal_uLong nTimeout = 0;
424  if (!bNoDelay)
425  {
426  // In case of ExtendedHelp display help sooner
427  if ( ImplGetSVHelpData().mbExtHelpMode )
428  nTimeout = 15;
429  else
430  {
432  nTimeout = HelpSettings::GetTipDelay();
433  else
434  nTimeout = HelpSettings::GetBalloonDelay();
435  }
436  }
437 
438  maShowTimer.SetTimeout( nTimeout );
439  maShowTimer.Start();
440 }
441 
442 IMPL_LINK( HelpTextWindow, TimerHdl, Timer*, pTimer, void)
443 {
444  if ( pTimer == &maShowTimer )
445  {
446  if ( mnHelpWinStyle == HELPWINSTYLE_QUICK )
447  {
448  // start auto-hide-timer for non-ShowTip windows
449  if ( this == ImplGetSVHelpData().mpHelpWin )
450  maHideTimer.Start();
451  }
452  ImplShow();
453  }
454  else
455  {
456  SAL_WARN_IF( pTimer != &maHideTimer, "vcl", "HelpTextWindow::TimerHdl with bad Timer" );
457  ImplDestroyHelpWindow( true );
458  }
459 }
460 
462 {
463  Size aSz = maTextRect.GetSize();
464  aSz.AdjustWidth(2*maTextRect.Left() );
465  aSz.AdjustHeight(2*maTextRect.Top() );
466  return aSz;
467 }
468 
469 void HelpTextWindow::RequestHelp( const HelpEvent& /*rHEvt*/ )
470 {
471  // Just to assure that Window::RequestHelp() is not called by
472  // ShowQuickHelp/ShowBalloonHelp in the HelpTextWindow.
473 }
474 
475 OUString HelpTextWindow::GetText() const
476 {
477  return maHelpText;
478 }
479 
480 void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle,
481  const OUString& rHelpText,
482  const Point& rScreenPos, const tools::Rectangle& rHelpArea )
483 {
484  if (pParent->ImplGetFrame()->ShowTooltip(rHelpText, rHelpArea))
485  {
486  //tooltips are handled natively, return early
487  return;
488  }
489 
490  ImplSVHelpData& aHelpData = ImplGetSVHelpData();
491 
492  if (rHelpText.isEmpty() && !aHelpData.mbRequestingHelp)
493  return;
494 
495  VclPtr<HelpTextWindow> pHelpWin = aHelpData.mpHelpWin;
496  bool bNoDelay = false;
497  if ( pHelpWin )
498  {
499  SAL_WARN_IF( pHelpWin == pParent, "vcl", "HelpInHelp ?!" );
500 
501  if ( ( rHelpText.isEmpty()
502  || ( pHelpWin->GetWinStyle() != nHelpWinStyle )
503  )
504  && aHelpData.mbRequestingHelp
505  )
506  {
507  // remove help window if no HelpText or
508  // other help mode. but keep it if we are scrolling, ie not requesting help
509  bool bWasVisible = pHelpWin->IsVisible();
510  if ( bWasVisible )
511  bNoDelay = true; // display it quickly if we were already in quick help mode
512  pHelpWin = nullptr;
513  ImplDestroyHelpWindow( bWasVisible );
514  }
515  else
516  {
517  bool const bUpdate = (pHelpWin->GetHelpText() != rHelpText) ||
518  ((pHelpWin->GetHelpArea() != rHelpArea) && aHelpData.mbRequestingHelp);
519  if (bUpdate)
520  {
521  vcl::Window * pWindow = pHelpWin->GetParent()->ImplGetFrameWindow();
522  tools::Rectangle aInvRect( pHelpWin->GetWindowExtentsRelative( pWindow ) );
523  if( pHelpWin->IsVisible() )
524  pWindow->Invalidate( aInvRect );
525 
526  pHelpWin->SetHelpText( rHelpText );
527  // approach mouse position
528  ImplSetHelpWindowPos( pHelpWin, nHelpWinStyle, nStyle, rScreenPos, rHelpArea );
529  if( pHelpWin->IsVisible() )
530  pHelpWin->Invalidate();
531  }
532  }
533  }
534 
535  if (pHelpWin || rHelpText.isEmpty())
536  return;
537 
538  sal_uInt64 nCurTime = tools::Time::GetSystemTicks();
539  if ( ( nCurTime - aHelpData.mnLastHelpHideTime ) < HelpSettings::GetTipDelay() )
540  bNoDelay = true;
541 
542  pHelpWin = VclPtr<HelpTextWindow>::Create( pParent, rHelpText, nHelpWinStyle, nStyle );
543  aHelpData.mpHelpWin = pHelpWin;
544  pHelpWin->SetHelpArea( rHelpArea );
545 
546  // positioning
547  Size aSz = pHelpWin->CalcOutSize();
548  pHelpWin->SetOutputSizePixel( aSz );
549  ImplSetHelpWindowPos( pHelpWin, nHelpWinStyle, nStyle, rScreenPos, rHelpArea );
550  // if not called from Window::RequestHelp, then without delay...
551  if ( !aHelpData.mbRequestingHelp )
552  bNoDelay = true;
553  pHelpWin->ShowHelp(bNoDelay);
554 
555 }
556 
557 void ImplDestroyHelpWindow( bool bUpdateHideTime )
558 {
559  ImplDestroyHelpWindow(ImplGetSVHelpData(), bUpdateHideTime);
560 }
561 
562 void ImplDestroyHelpWindow(ImplSVHelpData& rHelpData, bool bUpdateHideTime)
563 {
564  VclPtr<HelpTextWindow> pHelpWin = rHelpData.mpHelpWin;
565  if( pHelpWin )
566  {
567  vcl::Window * pParent = pHelpWin->GetParent();
568  if( pParent )
569  {
570  VclPtr<vcl::Window> pWindow( pParent->ImplGetFrameWindow() );
571  if( pWindow )
572  {
573  // find out screen area covered by system help window
574  tools::Rectangle aInvRect( pHelpWin->GetWindowExtentsRelative( pWindow ) );
575  if( pHelpWin->IsVisible() )
576  pWindow->Invalidate( aInvRect );
577  }
578  }
579  rHelpData.mpHelpWin = nullptr;
580  rHelpData.mbKeyboardHelp = false;
581  pHelpWin->Hide();
582  pHelpWin.disposeAndClear();
583  if( bUpdateHideTime )
585  }
586 }
587 
588 void ImplSetHelpWindowPos( vcl::Window* pHelpWin, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle,
589  const Point& rPos, const tools::Rectangle& rHelpArea )
590 {
591  Point aPos = rPos;
592  Size aSz = pHelpWin->GetSizePixel();
593  tools::Rectangle aScreenRect = pHelpWin->ImplGetFrameWindow()->GetDesktopRectPixel();
594  aPos = pHelpWin->GetParent()->ImplGetFrameWindow()->OutputToAbsoluteScreenPixel( aPos );
595  // get mouse screen coords
596  Point aMousePos( pHelpWin->GetParent()->ImplGetFrameWindow()->GetPointerPosPixel() );
597  aMousePos = pHelpWin->GetParent()->ImplGetFrameWindow()->OutputToAbsoluteScreenPixel( aMousePos );
598 
599  if ( nHelpWinStyle == HELPWINSTYLE_QUICK )
600  {
601  if ( !(nStyle & QuickHelpFlags::NoAutoPos) )
602  {
603  long nScreenHeight = aScreenRect.GetHeight();
604  aPos.AdjustX( -4 );
605  if ( aPos.Y() > aScreenRect.Top()+nScreenHeight-(nScreenHeight/4) )
606  aPos.AdjustY( -(aSz.Height()+4) );
607  else
608  aPos.AdjustY(21 );
609  }
610  }
611  else
612  {
613  // If it's the mouse position, move the window slightly
614  // so the mouse pointer does not cover it
615  if ( aPos == aMousePos )
616  {
617  aPos.AdjustX(12 );
618  aPos.AdjustY(16 );
619  }
620  }
621 
622  if ( nStyle & QuickHelpFlags::NoAutoPos )
623  {
624  // convert help area to screen coords
625  tools::Rectangle devHelpArea(
626  pHelpWin->GetParent()->ImplGetFrameWindow()->OutputToAbsoluteScreenPixel( rHelpArea.TopLeft() ),
627  pHelpWin->GetParent()->ImplGetFrameWindow()->OutputToAbsoluteScreenPixel( rHelpArea.BottomRight() ) );
628 
629  // which position of the rectangle?
630  aPos = devHelpArea.Center();
631 
632  if ( nStyle & QuickHelpFlags::Left )
633  aPos.setX( devHelpArea.Left() );
634  else if ( nStyle & QuickHelpFlags::Right )
635  aPos.setX( devHelpArea.Right() );
636 
637  if ( nStyle & QuickHelpFlags::Top )
638  aPos.setY( devHelpArea.Top() );
639  else if ( nStyle & QuickHelpFlags::Bottom )
640  aPos.setY( devHelpArea.Bottom() );
641 
642  // which direction?
643  if ( nStyle & QuickHelpFlags::Left )
644  ;
645  else if ( nStyle & QuickHelpFlags::Right )
646  aPos.AdjustX( -(aSz.Width()) );
647  else
648  aPos.AdjustX( -(aSz.Width()/2) );
649 
650  if ( nStyle & QuickHelpFlags::Top )
651  ;
652  else if ( nStyle & QuickHelpFlags::Bottom )
653  aPos.AdjustY( -(aSz.Height()) );
654  else
655  aPos.AdjustY( -(aSz.Height()/2) );
656  }
657 
658  if ( aPos.X() < aScreenRect.Left() )
659  aPos.setX( aScreenRect.Left() );
660  else if ( ( aPos.X() + aSz.Width() ) > aScreenRect.Right() )
661  aPos.setX( aScreenRect.Right() - aSz.Width() );
662  if ( aPos.Y() < aScreenRect.Top() )
663  aPos.setY( aScreenRect.Top() );
664  else if ( ( aPos.Y() + aSz.Height() ) > aScreenRect.Bottom() )
665  aPos.setY( aScreenRect.Bottom() - aSz.Height() );
666 
667  if( ! (nStyle & QuickHelpFlags::NoEvadePointer) )
668  {
669  /* the remark below should be obsolete by now as the helpwindow should
670  not be focusable, leaving it as a hint. However it is sensible in most
671  conditions to evade the mouse pointer so the content window is fully visible.
672 
673  // the popup must not appear under the mouse
674  // otherwise it would directly be closed due to a focus change...
675  */
676  tools::Rectangle aHelpRect( aPos, aSz );
677  if( aHelpRect.IsInside( aMousePos ) )
678  {
679  Point delta(2,2);
680  Point aSize( aSz.Width(), aSz.Height() );
681  Point aTest( aMousePos - aSize - delta );
682  if( aTest.X() > aScreenRect.Left() && aTest.Y() > aScreenRect.Top() )
683  aPos = aTest;
684  else
685  aPos = aMousePos + delta;
686  }
687  }
688 
689  vcl::Window* pWindow = pHelpWin->GetParent()->ImplGetFrameWindow();
690  aPos = pWindow->AbsoluteScreenToOutputPixel( aPos );
691  pHelpWin->SetPosPixel( aPos );
692 }
693 
694 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ImplSVHelpData & ImplGetSVHelpData()
Definition: svdata.cxx:471
Point TopLeft() const
long Width() const
#define ENSURE_OR_RETURN_VOID(c, m)
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, MetricVector *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
Definition: text.cxx:781
void SetPos(const Point &rPoint)
VclPtr< HelpTextWindow > mpHelpWin
Definition: svdata.hxx:300
Point GetPointerPosPixel()
Definition: mouse.cxx:550
static void EnableContextHelp()
Definition: help.cxx:77
static void DisableBalloonHelp()
Definition: help.cxx:147
#define HELPTEXTMAXLEN
Definition: help.cxx:43
WinBits const WB_SYSTEMWINDOW
long GetHeight() const
constexpr::Color COL_BLACK(0x00, 0x00, 0x00)
HelpTextWindow(vcl::Window *pParent, const OUString &rText, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle)
Definition: help.cxx:256
tools::Rectangle maTextRect
Definition: helpwin.hxx:34
bool DrawNativeControl(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, const OUString &aCaption)
Request rendering of a particular control and/or part.
static bool IsExtHelpEnabled()
Definition: help.cxx:102
long AdjustWidth(long n)
void ImplShow()
Definition: help.cxx:367
long Height() const
Help()
Definition: help.cxx:45
void DrawCtrlText(const Point &rPos, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, DrawTextFlags nStyle=DrawTextFlags::Mnemonic, MetricVector *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pGlyphs=nullptr)
Definition: text.cxx:2057
sal_uInt16 mnHelpWinStyle
Definition: helpwin.hxx:41
Point AbsoluteScreenToOutputPixel(const Point &rPos) const
Definition: window.cxx:2928
sal_uInt16 GetWinStyle() const
Definition: helpwin.hxx:61
static bool StartExtHelp()
Definition: help.cxx:107
sal_uIntPtr sal_uLong
void disposeAndClear()
Definition: vclptr.hxx:200
#define HELPTEXTMARGIN_BALLOON
Definition: help.cxx:41
const StyleSettings & GetStyleSettings() const
virtual Size GetSizePixel() const
Definition: window.cxx:2415
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
Definition: window2.cxx:901
aBuf
sal_Int16 nId
ComplexTextLayoutFlags GetLayoutMode() const
Definition: outdev.hxx:604
const tools::Rectangle & GetHelpArea() const
Definition: helpwin.hxx:70
constexpr::Color COL_GRAY(0x80, 0x80, 0x80)
void SetParentClipMode(ParentClipMode nMode=ParentClipMode::NONE)
bool mbRequestingHelp
Definition: svdata.hxx:299
void SetLayoutMode(ComplexTextLayoutFlags nTextLayoutMode)
void SetHelpText(const OUString &rHelpText)
Definition: help.cxx:326
tools::Rectangle GetDesktopRectPixel() const
Definition: window.cxx:2862
Timer maHideTimer
Definition: helpwin.hxx:39
SAL_DLLPRIVATE void ImplUpdateAll()
Definition: paint.cxx:985
void SetType(WindowType nType)
Definition: window2.cxx:968
const Color & GetHelpTextColor() const
long AdjustHeight(long n)
#define HELPTEXTMARGIN_QUICK
Definition: help.cxx:40
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
static sal_uLong GetTipDelay()
bool mbExtHelpMode
Definition: svdata.hxx:293
QuickHelpFlags mnStyle
Definition: helpwin.hxx:42
virtual OUString GetText() const override
Definition: help.cxx:475
tools::Rectangle GetTextRect(const tools::Rectangle &rRect, const OUString &rStr, DrawTextFlags nStyle=DrawTextFlags::WordBreak, TextRectInfo *pInfo=nullptr, const vcl::ITextLayout *_pTextLayout=nullptr) const
Definition: text.cxx:1796
static void DisableContextHelp()
Definition: help.cxx:82
void SetBackground()
static void EnableBalloonHelp()
Definition: help.cxx:142
long Right() const
sal_uInt64 mnLastHelpHideTime
Definition: svdata.hxx:301
static void DisableQuickHelp()
Definition: help.cxx:170
void Hide()
Definition: window.hxx:936
static void * ShowPopover(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rText, QuickHelpFlags nStyle)
Definition: help.cxx:198
virtual void SetOutputSizePixel(const Size &rNewSize)
Definition: window2.cxx:1274
long Top() const
force balloon-style in ShowPopover and ShowQuickHelp
QuickHelpFlags GetStyle() const
Definition: helpwin.hxx:62
const HelpSettings & GetHelpSettings() const
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:32
SAL_DLLPRIVATE void ImplSetMouseTransparent(bool bTransparent)
Definition: window2.cxx:931
void Update()
Definition: paint.cxx:1284
void SetDebugName(const char *pDebugName)
Definition: task.hxx:81
static void DisableExtHelp()
Definition: help.cxx:97
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &) override
Definition: help.cxx:375
Point BottomRight() const
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:75
void SetLineColor()
virtual OUString GetHelpText(const OUString &aHelpURL, const vcl::Window *pWindow)
Definition: help.cxx:67
static void HidePopover(vcl::Window const *pParent, void *nId)
Definition: help.cxx:239
OUString maHelpText
Definition: helpwin.hxx:36
virtual ~HelpTextWindow() override
Definition: help.cxx:311
bool IsDark() const
bool mbQuickHelp
Definition: svdata.hxx:296
bool mbExtHelp
Definition: svdata.hxx:292
ComplexTextLayoutFlags
Definition: outdevstate.hxx:66
static bool IsQuickHelpEnabled()
Definition: help.cxx:175
VclPtr< WorkWindow > mpAppWin
Definition: svdata.hxx:240
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1160
QuickHelpFlags
Definition: help.hxx:32
virtual bool Start(const OUString &rHelpId, const vcl::Window *pWindow)
Definition: help.cxx:53
#define HELPWINSTYLE_BALLOON
Definition: help.cxx:38
void SetFillColor()
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:304
const Color & GetLineColor() const
Definition: outdev.hxx:624
SAL_DLLPRIVATE void ImplGenerateMouseMove()
Definition: mouse.cxx:157
sal_uLong GetTipTimeout() const
void SetTextColor(const Color &rColor)
Definition: text.cxx:664
const vcl::Font & GetHelpFont() const
long Bottom() const
virtual void SearchKeyword(const OUString &rKeyWord)
Definition: help.cxx:63
virtual void Start() override
Activates the timer task.
Definition: timer.cxx:83
static bool EndExtHelp()
Definition: help.cxx:125
WinBits const WB_TOOLTIPWIN
bool IsInside(const Point &rPOINT) const
const AllSettings & GetSettings() const
Definition: outdev.hxx:420
void SetPaintTransparent(bool bTransparent)
Definition: paint.cxx:1022
Size GetOutputSizePixel() const
Definition: outdev.hxx:441
DrawTextFlags
Definition: outdev.hxx:144
Size CalcOutSize() const
Definition: help.cxx:461
bool mbContextHelp
Definition: svdata.hxx:291
void SetTimeout(sal_uInt64 nTimeoutMs)
Definition: timer.cxx:89
long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
Definition: text.cxx:890
static void ShowQuickHelp(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rHelpText, QuickHelpFlags nStyle=QuickHelpFlags::NONE)
Definition: help.cxx:180
vcl::Window * GetParent() const
Definition: window2.cxx:1097
void ImplShowHelpWindow(vcl::Window *pParent, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle, const OUString &rHelpText, const Point &rScreenPos, const tools::Rectangle &rHelpArea)
Definition: help.cxx:480
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
Definition: help.cxx:287
static bool IsBalloonHelpEnabled()
Definition: help.cxx:152
Point OutputToAbsoluteScreenPixel(const Point &rPos) const
Definition: window.cxx:2918
Size GetSize() const
static void UpdatePopover(void *nId, vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rText)
Definition: help.cxx:218
void SetPointFont(vcl::RenderContext &rRenderContext, const vcl::Font &rFont)
Definition: window.cxx:2187
IMPL_LINK(HelpTextWindow, TimerHdl, Timer *, pTimer, void)
Definition: help.cxx:442
virtual void RequestHelp(const HelpEvent &rHEvt) override
Definition: help.cxx:469
long GetCtrlTextWidth(const OUString &rStr, const SalLayoutGlyphs *pLayoutCache=nullptr) const
Definition: text.cxx:2200
#define HELPWINSTYLE_QUICK
Definition: help.cxx:37
A construction helper for a temporary VclPtr.
Definition: vclptr.hxx:275
static bool IsContextHelpEnabled()
Definition: help.cxx:87
SalFrame * ImplGetFrame() const
Definition: window2.cxx:848
ALIGN_TOP
virtual bool UpdatePopover(void *, const OUString &, vcl::Window *, const tools::Rectangle &)
Definition: salframe.hxx:279
Timer maShowTimer
Definition: helpwin.hxx:38
void Stop()
Definition: scheduler.cxx:593
bool mbBalloonHelp
Definition: svdata.hxx:295
bool mbOldBalloonMode
Definition: svdata.hxx:294
#define SAL_WARN_IF(condition, area, stream)
virtual bool HidePopover(void *)
Definition: salframe.hxx:285
const OUString & GetHelpText() const
Definition: helpwin.hxx:59
void ShowHelp(bool bNoDelay)
Definition: help.cxx:421
ImplSVFrameData maFrameData
Definition: svdata.hxx:395
bool IsVisible() const
Definition: window2.cxx:1102
void EnableChildTransparentMode(bool bEnable=true)
Definition: window2.cxx:1022
static VclPtr< reference_type > Create(Arg &&...arg)
A construction helper for VclPtr.
Definition: vclptr.hxx:127
const Color & GetHelpColor() const
void SetInvokeHandler(const Link< Timer *, void > &rLink)
Definition: timer.hxx:56
constexpr::Color COL_WHITE(0xFF, 0xFF, 0xFF)
static sal_uInt64 GetSystemTicks()
long Left() const
static sal_uLong GetBalloonDelay()
static void EnableQuickHelp()
Definition: help.cxx:165
long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
Width of the text.
Definition: text.cxx:879
bool IsDisposed() const
Definition: window.cxx:136
virtual bool ShowTooltip(const OUString &, const tools::Rectangle &)
Definition: salframe.hxx:267
reference_type * get() const
Get the body.
Definition: vclptr.hxx:143
Definition: timer.hxx:26
Point OutputToScreenPixel(const Point &rPos) const
Definition: window.cxx:2869
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition: help.cxx:316
virtual void * ShowPopover(const OUString &, vcl::Window *, const tools::Rectangle &, QuickHelpFlags)
Definition: salframe.hxx:273
static void EnableExtHelp()
Definition: help.cxx:92
void SetHelpArea(const tools::Rectangle &rRect)
Definition: helpwin.hxx:65
void ImplSetHelpWindowPos(vcl::Window *pHelpWin, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle, const Point &rPos, const tools::Rectangle &rHelpArea)
Definition: help.cxx:588
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition: floatwin.cxx:203
static void HideBalloonAndQuickHelp()
Definition: help.cxx:191
void setWidth(long nWidth)
virtual void SetPosPixel(const Point &rNewPos)
Definition: window2.cxx:1257
bool mbKeyboardHelp
Definition: svdata.hxx:298
tools::Rectangle GetWindowExtentsRelative(vcl::Window *pRelativeWindow) const
Definition: window.cxx:2955
virtual ~Help()
Definition: help.cxx:49
void SetTextAlign(TextAlign eAlign)
Definition: text.cxx:765
Point Center() const
void ImplDestroyHelpWindow(bool bUpdateHideTime)
Definition: help.cxx:557
static void ShowBalloon(vcl::Window *pParent, const Point &rScreenPos, const tools::Rectangle &, const OUString &rHelpText)
Definition: help.cxx:157
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Definition: window.cxx:2201
void setHeight(long nHeight)
OStringBuffer & padToLength(OStringBuffer &rBuffer, sal_Int32 nLength, char cFill= '\0')