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() )
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  pHelpWin->SetHelpText( rHelpText );
522  // approach mouse position
523  ImplSetHelpWindowPos( pHelpWin, nHelpWinStyle, nStyle, rScreenPos, rHelpArea );
524  if( pHelpWin->IsVisible() )
525  pHelpWin->Invalidate();
526  }
527  }
528  }
529 
530  if (pHelpWin || rHelpText.isEmpty())
531  return;
532 
533  sal_uInt64 nCurTime = tools::Time::GetSystemTicks();
534  if ( ( nCurTime - aHelpData.mnLastHelpHideTime ) < HelpSettings::GetTipDelay() )
535  bNoDelay = true;
536 
537  pHelpWin = VclPtr<HelpTextWindow>::Create( pParent, rHelpText, nHelpWinStyle, nStyle );
538  aHelpData.mpHelpWin = pHelpWin;
539  pHelpWin->SetHelpArea( rHelpArea );
540 
541  // positioning
542  Size aSz = pHelpWin->CalcOutSize();
543  pHelpWin->SetOutputSizePixel( aSz );
544  ImplSetHelpWindowPos( pHelpWin, nHelpWinStyle, nStyle, rScreenPos, rHelpArea );
545  // if not called from Window::RequestHelp, then without delay...
546  if ( !aHelpData.mbRequestingHelp )
547  bNoDelay = true;
548  pHelpWin->ShowHelp(bNoDelay);
549 
550 }
551 
552 void ImplDestroyHelpWindow( bool bUpdateHideTime )
553 {
554  ImplDestroyHelpWindow(ImplGetSVHelpData(), bUpdateHideTime);
555 }
556 
557 void ImplDestroyHelpWindow(ImplSVHelpData& rHelpData, bool bUpdateHideTime)
558 {
559  VclPtr<HelpTextWindow> pHelpWin = rHelpData.mpHelpWin;
560  if( pHelpWin )
561  {
562  rHelpData.mpHelpWin = nullptr;
563  rHelpData.mbKeyboardHelp = false;
564  pHelpWin->Hide();
565  pHelpWin.disposeAndClear();
566  if( bUpdateHideTime )
568  }
569 }
570 
571 void ImplSetHelpWindowPos( vcl::Window* pHelpWin, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle,
572  const Point& rPos, const tools::Rectangle& rHelpArea )
573 {
574  Point aPos = rPos;
575  Size aSz = pHelpWin->GetSizePixel();
576  tools::Rectangle aScreenRect = pHelpWin->ImplGetFrameWindow()->GetDesktopRectPixel();
577  aPos = pHelpWin->GetParent()->ImplGetFrameWindow()->OutputToAbsoluteScreenPixel( aPos );
578  // get mouse screen coords
579  Point aMousePos( pHelpWin->GetParent()->ImplGetFrameWindow()->GetPointerPosPixel() );
580  aMousePos = pHelpWin->GetParent()->ImplGetFrameWindow()->OutputToAbsoluteScreenPixel( aMousePos );
581 
582  if ( nHelpWinStyle == HELPWINSTYLE_QUICK )
583  {
584  if ( !(nStyle & QuickHelpFlags::NoAutoPos) )
585  {
586  long nScreenHeight = aScreenRect.GetHeight();
587  aPos.AdjustX( -4 );
588  if ( aPos.Y() > aScreenRect.Top()+nScreenHeight-(nScreenHeight/4) )
589  aPos.AdjustY( -(aSz.Height()+4) );
590  else
591  aPos.AdjustY(21 );
592  }
593  }
594  else
595  {
596  // If it's the mouse position, move the window slightly
597  // so the mouse pointer does not cover it
598  if ( aPos == aMousePos )
599  {
600  aPos.AdjustX(12 );
601  aPos.AdjustY(16 );
602  }
603  }
604 
605  if ( nStyle & QuickHelpFlags::NoAutoPos )
606  {
607  // convert help area to screen coords
608  tools::Rectangle devHelpArea(
609  pHelpWin->GetParent()->ImplGetFrameWindow()->OutputToAbsoluteScreenPixel( rHelpArea.TopLeft() ),
610  pHelpWin->GetParent()->ImplGetFrameWindow()->OutputToAbsoluteScreenPixel( rHelpArea.BottomRight() ) );
611 
612  // which position of the rectangle?
613  aPos = devHelpArea.Center();
614 
615  if ( nStyle & QuickHelpFlags::Left )
616  aPos.setX( devHelpArea.Left() );
617  else if ( nStyle & QuickHelpFlags::Right )
618  aPos.setX( devHelpArea.Right() );
619 
620  if ( nStyle & QuickHelpFlags::Top )
621  aPos.setY( devHelpArea.Top() );
622  else if ( nStyle & QuickHelpFlags::Bottom )
623  aPos.setY( devHelpArea.Bottom() );
624 
625  // which direction?
626  if ( nStyle & QuickHelpFlags::Left )
627  ;
628  else if ( nStyle & QuickHelpFlags::Right )
629  aPos.AdjustX( -(aSz.Width()) );
630  else
631  aPos.AdjustX( -(aSz.Width()/2) );
632 
633  if ( nStyle & QuickHelpFlags::Top )
634  ;
635  else if ( nStyle & QuickHelpFlags::Bottom )
636  aPos.AdjustY( -(aSz.Height()) );
637  else
638  aPos.AdjustY( -(aSz.Height()/2) );
639  }
640 
641  if ( aPos.X() < aScreenRect.Left() )
642  aPos.setX( aScreenRect.Left() );
643  else if ( ( aPos.X() + aSz.Width() ) > aScreenRect.Right() )
644  aPos.setX( aScreenRect.Right() - aSz.Width() );
645  if ( aPos.Y() < aScreenRect.Top() )
646  aPos.setY( aScreenRect.Top() );
647  else if ( ( aPos.Y() + aSz.Height() ) > aScreenRect.Bottom() )
648  aPos.setY( aScreenRect.Bottom() - aSz.Height() );
649 
650  if( ! (nStyle & QuickHelpFlags::NoEvadePointer) )
651  {
652  /* the remark below should be obsolete by now as the helpwindow should
653  not be focusable, leaving it as a hint. However it is sensible in most
654  conditions to evade the mouse pointer so the content window is fully visible.
655 
656  // the popup must not appear under the mouse
657  // otherwise it would directly be closed due to a focus change...
658  */
659  tools::Rectangle aHelpRect( aPos, aSz );
660  if( aHelpRect.IsInside( aMousePos ) )
661  {
662  Point delta(2,2);
663  Point aSize( aSz.Width(), aSz.Height() );
664  Point aTest( aMousePos - aSize - delta );
665  if( aTest.X() > aScreenRect.Left() && aTest.Y() > aScreenRect.Top() )
666  aPos = aTest;
667  else
668  aPos = aMousePos + delta;
669  }
670  }
671 
672  vcl::Window* pWindow = pHelpWin->GetParent()->ImplGetFrameWindow();
673  aPos = pWindow->AbsoluteScreenToOutputPixel( aPos );
674  pHelpWin->SetPosPixel( aPos );
675 }
676 
677 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ImplSVHelpData & ImplGetSVHelpData()
Definition: svdata.cxx:472
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:787
void SetPos(const Point &rPoint)
VclPtr< HelpTextWindow > mpHelpWin
Definition: svdata.hxx:299
Point GetPointerPosPixel()
Definition: mouse.cxx:549
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)
A tooltip: adds tips to widgets in a floating / popup window.
Definition: helpwin.hxx:30
HelpTextWindow(vcl::Window *pParent, const OUString &rText, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle)
Definition: help.cxx:256
tools::Rectangle maTextRect
Definition: helpwin.hxx:35
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:2062
sal_uInt16 mnHelpWinStyle
Definition: helpwin.hxx:42
Point AbsoluteScreenToOutputPixel(const Point &rPos) const
Definition: window.cxx:2909
sal_uInt16 GetWinStyle() const
Definition: helpwin.hxx:62
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:2396
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
Definition: window2.cxx:901
aBuf
sal_Int16 nId
ComplexTextLayoutFlags GetLayoutMode() const
Definition: outdev.hxx:610
const tools::Rectangle & GetHelpArea() const
Definition: helpwin.hxx:71
constexpr::Color COL_GRAY(0x80, 0x80, 0x80)
void SetParentClipMode(ParentClipMode nMode=ParentClipMode::NONE)
bool mbRequestingHelp
Definition: svdata.hxx:298
void SetLayoutMode(ComplexTextLayoutFlags nTextLayoutMode)
void SetHelpText(const OUString &rHelpText)
Definition: help.cxx:326
tools::Rectangle GetDesktopRectPixel() const
Definition: window.cxx:2843
Timer maHideTimer
Definition: helpwin.hxx:40
SAL_DLLPRIVATE void ImplUpdateAll()
Definition: paint.cxx:987
void SetType(WindowType nType)
Definition: window2.cxx:968
const Color & GetHelpTextColor() const
void PaintImmediately()
Definition: paint.cxx:1286
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:292
QuickHelpFlags mnStyle
Definition: helpwin.hxx:43
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:1801
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:300
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:63
const HelpSettings & GetHelpSettings() const
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:51
SAL_DLLPRIVATE void ImplSetMouseTransparent(bool bTransparent)
Definition: window2.cxx:931
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:76
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:37
virtual ~HelpTextWindow() override
Definition: help.cxx:311
bool IsDark() const
bool mbQuickHelp
Definition: svdata.hxx:295
bool mbExtHelp
Definition: svdata.hxx:291
ComplexTextLayoutFlags
Definition: outdevstate.hxx:66
static bool IsQuickHelpEnabled()
Definition: help.cxx:175
VclPtr< WorkWindow > mpAppWin
Definition: svdata.hxx:239
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1162
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:302
const Color & GetLineColor() const
Definition: outdev.hxx:630
SAL_DLLPRIVATE void ImplGenerateMouseMove()
Definition: mouse.cxx:157
sal_uLong GetTipTimeout() const
void SetTextColor(const Color &rColor)
Definition: text.cxx:665
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:418
void SetPaintTransparent(bool bTransparent)
Definition: paint.cxx:1024
Size GetOutputSizePixel() const
Definition: outdev.hxx:441
DrawTextFlags
Definition: outdev.hxx:142
Size CalcOutSize() const
Definition: help.cxx:461
bool mbContextHelp
Definition: svdata.hxx:290
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:895
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:2899
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:2168
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:2205
#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:275
Timer maShowTimer
Definition: helpwin.hxx:39
void Stop()
Definition: scheduler.cxx:593
bool mbBalloonHelp
Definition: svdata.hxx:294
bool mbOldBalloonMode
Definition: svdata.hxx:293
#define SAL_WARN_IF(condition, area, stream)
virtual bool HidePopover(void *)
Definition: salframe.hxx:281
const OUString & GetHelpText() const
Definition: helpwin.hxx:60
void ShowHelp(bool bNoDelay)
Definition: help.cxx:421
ImplSVFrameData maFrameData
Definition: svdata.hxx:394
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:884
bool IsDisposed() const
Definition: window.cxx:140
virtual bool ShowTooltip(const OUString &, const tools::Rectangle &)
Definition: salframe.hxx:263
reference_type * get() const
Get the body.
Definition: vclptr.hxx:143
Definition: timer.hxx:26
Point OutputToScreenPixel(const Point &rPos) const
Definition: window.cxx:2850
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:269
static void EnableExtHelp()
Definition: help.cxx:92
void SetHelpArea(const tools::Rectangle &rRect)
Definition: helpwin.hxx:66
void ImplSetHelpWindowPos(vcl::Window *pHelpWin, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle, const Point &rPos, const tools::Rectangle &rHelpArea)
Definition: help.cxx:571
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition: floatwin.cxx:204
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:297
virtual ~Help()
Definition: help.cxx:49
void SetTextAlign(TextAlign eAlign)
Definition: text.cxx:766
Point Center() const
void ImplDestroyHelpWindow(bool bUpdateHideTime)
Definition: help.cxx:552
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:2182
void setHeight(long nHeight)
OStringBuffer & padToLength(OStringBuffer &rBuffer, sal_Int32 nLength, char cFill= '\0')