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 {
100 }
101 
103 {
105 }
106 
108 {
109  ImplSVData* pSVData = ImplGetSVData();
110 
111  if ( pSVData->maHelpData.mbExtHelp && !pSVData->maHelpData.mbExtHelpMode )
112  {
113  pSVData->maHelpData.mbExtHelpMode = true;
115  pSVData->maHelpData.mbBalloonHelp = true;
116  if ( pSVData->maWinData.mpAppWin )
118  return true;
119  }
120 
121  return false;
122 }
123 
125 {
126  ImplSVData* pSVData = ImplGetSVData();
127 
128  if ( pSVData->maHelpData.mbExtHelp && pSVData->maHelpData.mbExtHelpMode )
129  {
130  pSVData->maHelpData.mbExtHelpMode = false;
132  if ( pSVData->maWinData.mpAppWin )
134  return true;
135  }
136 
137  return false;
138 }
139 
141 {
143 }
144 
146 {
148 }
149 
151 {
153 }
154 
156  const Point& rScreenPos, const tools::Rectangle& rRect,
157  const OUString& rHelpText )
158 {
160  rHelpText, rScreenPos, rRect );
161 }
162 
164 {
166 }
167 
169 {
171 }
172 
174 {
176 }
177 
179  const tools::Rectangle& rScreenRect,
180  const OUString& rHelpText,
181  QuickHelpFlags nStyle )
182 {
183  sal_uInt16 nHelpWinStyle = ( nStyle & QuickHelpFlags::TipStyleBalloon ) ? HELPWINSTYLE_BALLOON : HELPWINSTYLE_QUICK;
184  ImplShowHelpWindow( pParent, nHelpWinStyle, nStyle,
185  rHelpText,
186  pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), rScreenRect );
187 }
188 
190 {
191  HelpTextWindow const * pHelpWin = ImplGetSVData()->maHelpData.mpHelpWin;
192  bool const bIsVisible = ( pHelpWin != nullptr ) && pHelpWin->IsVisible();
193  ImplDestroyHelpWindow( bIsVisible );
194 }
195 
196 void* Help::ShowPopover(vcl::Window* pParent, const tools::Rectangle& rScreenRect,
197  const OUString& rText, QuickHelpFlags nStyle)
198 {
199  void* nId = pParent->ImplGetFrame()->ShowPopover(rText, pParent, rScreenRect, nStyle);
200  if (nId)
201  {
202  //popovers are handled natively, return early
203  return nId;
204  }
205 
206  sal_uInt16 nHelpWinStyle = ( nStyle & QuickHelpFlags::TipStyleBalloon ) ? HELPWINSTYLE_BALLOON : HELPWINSTYLE_QUICK;
207  VclPtrInstance<HelpTextWindow> pHelpWin( pParent, rText, nHelpWinStyle, nStyle );
208 
209  nId = pHelpWin.get();
210  UpdatePopover(nId, pParent, rScreenRect, rText);
211 
212  pHelpWin->ShowHelp(true);
213  return nId;
214 }
215 
216 void Help::UpdatePopover(void* nId, vcl::Window* pParent, const tools::Rectangle& rScreenRect,
217  const OUString& rText)
218 {
219  if (pParent->ImplGetFrame()->UpdatePopover(nId, rText, pParent, rScreenRect))
220  {
221  //popovers are handled natively, return early
222  return;
223  }
224 
225  HelpTextWindow* pHelpWin = static_cast< HelpTextWindow* >( nId );
226  ENSURE_OR_RETURN_VOID( pHelpWin != nullptr, "Help::UpdatePopover: invalid ID!" );
227 
228  Size aSz = pHelpWin->CalcOutSize();
229  pHelpWin->SetOutputSizePixel( aSz );
230  ImplSetHelpWindowPos( pHelpWin, pHelpWin->GetWinStyle(), pHelpWin->GetStyle(),
231  pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), rScreenRect );
232 
233  pHelpWin->SetHelpText( rText );
234  pHelpWin->Invalidate();
235 }
236 
237 void Help::HidePopover(vcl::Window const * pParent, void* nId)
238 {
239  if (pParent->ImplGetFrame()->HidePopover(nId))
240  {
241  //popovers are handled natively, return early
242  return;
243  }
244 
245  VclPtr<HelpTextWindow> pHelpWin = static_cast<HelpTextWindow*>(nId);
246  vcl::Window* pFrameWindow = pHelpWin->ImplGetFrameWindow();
247  pHelpWin->Hide();
248  // trigger update, so that a Paint is instantly triggered since we do not save the background
249  pFrameWindow->ImplUpdateAll();
250  pHelpWin.disposeAndClear();
252 }
253 
254 HelpTextWindow::HelpTextWindow( vcl::Window* pParent, const OUString& rText, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle ) :
255  FloatingWindow( pParent, WB_SYSTEMWINDOW|WB_TOOLTIPWIN ), // #105827# if we change the parent, mirroring will not work correctly when positioning this window
256  maHelpText( rText )
257 {
258  SetType( WindowType::HELPTEXTWINDOW );
259  ImplSetMouseTransparent( true );
260  mnHelpWinStyle = nHelpWinStyle;
261  mnStyle = nStyle;
262 
264  {
265  ComplexTextLayoutFlags nLayoutMode = GetLayoutMode();
267  SetLayoutMode( nLayoutMode );
268  }
269  SetHelpText( rText );
270  Window::SetHelpText( rText );
271 
272  ImplSVData* pSVData = ImplGetSVData();
273  if ( pSVData->maHelpData.mbSetKeyboardHelp )
274  pSVData->maHelpData.mbKeyboardHelp = true;
275 
276 
277  maShowTimer.SetInvokeHandler( LINK( this, HelpTextWindow, TimerHdl ) );
278  maShowTimer.SetDebugName( "vcl::HelpTextWindow maShowTimer" );
279 
280  const HelpSettings& rHelpSettings = pParent->GetSettings().GetHelpSettings();
281  maHideTimer.SetTimeout( rHelpSettings.GetTipTimeout() );
282  maHideTimer.SetInvokeHandler( LINK( this, HelpTextWindow, TimerHdl ) );
283  maHideTimer.SetDebugName( "vcl::HelpTextWindow maHideTimer" );
284 }
285 
287 {
288  const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
289  SetPointFont(rRenderContext, rStyleSettings.GetHelpFont());
290  rRenderContext.SetTextColor(rStyleSettings.GetHelpTextColor());
291  rRenderContext.SetTextAlign(ALIGN_TOP);
292 
294  {
297  SetPaintTransparent(true);
298  rRenderContext.SetBackground();
299  }
300  else
301  rRenderContext.SetBackground(Wallpaper(rStyleSettings.GetHelpColor()));
302 
303  if (rStyleSettings.GetHelpColor().IsDark())
304  rRenderContext.SetLineColor(COL_WHITE);
305  else
306  rRenderContext.SetLineColor(COL_BLACK);
307  rRenderContext.SetFillColor();
308 }
309 
311 {
312  disposeOnce();
313 }
314 
316 {
317  maShowTimer.Stop();
318  maHideTimer.Stop();
319 
320  if( this == ImplGetSVData()->maHelpData.mpHelpWin )
321  ImplGetSVData()->maHelpData.mpHelpWin = nullptr;
323 }
324 
325 void HelpTextWindow::SetHelpText( const OUString& rHelpText )
326 {
327  maHelpText = rHelpText;
328  ApplySettings(*this);
330  {
331  Size aSize;
332  aSize.setHeight( GetTextHeight() );
335  else
336  aSize.setWidth( GetTextWidth( maHelpText ) );
338  }
339  else // HELPWINSTYLE_BALLOON
340  {
341  sal_Int32 nCharsInLine = 35 + ((maHelpText.getLength()/100)*5);
342  // average width to have all windows consistent
343  OUStringBuffer aBuf;
344  comphelper::string::padToLength(aBuf, nCharsInLine, 'x');
345  OUString aXXX = aBuf.makeStringAndClear();
346  long nWidth = GetTextWidth( aXXX );
347  Size aTmpSize( nWidth, 0x7FFFFFFF );
348  tools::Rectangle aTry1( Point(), aTmpSize );
352  nDrawFlags |= DrawTextFlags::Mnemonic;
353  tools::Rectangle aTextRect = GetTextRect( aTry1, maHelpText, nDrawFlags );
354 
355  // get a better width later...
356  maTextRect = aTextRect;
357 
358  // safety distance...
360  }
361 
362  Size aSize( CalcOutSize() );
363  SetOutputSizePixel( aSize );
364 }
365 
367 {
368  VclPtr<HelpTextWindow> xWindow( this );
369  Show( true, ShowFlags::NoActivate );
370  if( !xWindow->IsDisposed() )
371  Update();
372 }
373 
375 {
376  // paint native background
377  bool bNativeOK = false;
379  {
380  tools::Rectangle aCtrlRegion(Point(0, 0), GetOutputSizePixel());
381  ImplControlValue aControlValue;
382  bNativeOK = rRenderContext.DrawNativeControl(ControlType::Tooltip, ControlPart::Entire, aCtrlRegion,
383  ControlState::NONE, aControlValue, OUString());
384  }
385 
386  // paint text
388  {
390  rRenderContext.DrawCtrlText(maTextRect.TopLeft(), maHelpText);
391  else
392  rRenderContext.DrawText(maTextRect.TopLeft(), maHelpText);
393  }
394  else // HELPWINSTYLE_BALLOON
395  {
399  nDrawFlags |= DrawTextFlags::Mnemonic;
400  rRenderContext.DrawText(maTextRect, maHelpText, nDrawFlags);
401  }
402 
403  // border
404  if (!bNativeOK)
405  {
406  Size aSz = GetOutputSizePixel();
407  rRenderContext.DrawRect(tools::Rectangle(Point(), aSz));
409  {
410  aSz.AdjustWidth( -2 );
411  aSz.AdjustHeight( -2 );
412  Color aColor(rRenderContext.GetLineColor());
413  rRenderContext.SetLineColor(COL_GRAY);
414  rRenderContext.DrawRect(tools::Rectangle(Point(1, 1), aSz));
415  rRenderContext.SetLineColor(aColor);
416  }
417  }
418 }
419 
420 void HelpTextWindow::ShowHelp(bool bNoDelay)
421 {
422  sal_uLong nTimeout = 0;
423  if (!bNoDelay)
424  {
425  // In case of ExtendedHelp display help sooner
426  if ( ImplGetSVData()->maHelpData.mbExtHelpMode )
427  nTimeout = 15;
428  else
429  {
431  nTimeout = HelpSettings::GetTipDelay();
432  else
433  nTimeout = HelpSettings::GetBalloonDelay();
434  }
435  }
436 
437  maShowTimer.SetTimeout( nTimeout );
438  maShowTimer.Start();
439 }
440 
441 IMPL_LINK( HelpTextWindow, TimerHdl, Timer*, pTimer, void)
442 {
443  if ( pTimer == &maShowTimer )
444  {
445  if ( mnHelpWinStyle == HELPWINSTYLE_QUICK )
446  {
447  // start auto-hide-timer for non-ShowTip windows
448  ImplSVData* pSVData = ImplGetSVData();
449  if ( this == pSVData->maHelpData.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  ImplSVData* pSVData = ImplGetSVData();
491 
492  if (rHelpText.isEmpty() && !pSVData->maHelpData.mbRequestingHelp)
493  return;
494 
495  VclPtr<HelpTextWindow> pHelpWin = pSVData->maHelpData.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  && pSVData->maHelpData.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) && pSVData->maHelpData.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 - pSVData->maHelpData.mnLastHelpHideTime ) < HelpSettings::GetTipDelay() )
540  bNoDelay = true;
541 
542  pHelpWin = VclPtr<HelpTextWindow>::Create( pParent, rHelpText, nHelpWinStyle, nStyle );
543  pSVData->maHelpData.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 ( !pSVData->maHelpData.mbRequestingHelp )
552  bNoDelay = true;
553  pHelpWin->ShowHelp(bNoDelay);
554 
555 }
556 
557 void ImplDestroyHelpWindow( bool bUpdateHideTime )
558 {
559  ImplSVData* pSVData = ImplGetSVData();
560  VclPtr<HelpTextWindow> pHelpWin = pSVData->maHelpData.mpHelpWin;
561  if ( pHelpWin )
562  {
563  vcl::Window * pWindow = pHelpWin->GetParent()->ImplGetFrameWindow();
564  // find out screen area covered by system help window
565  tools::Rectangle aInvRect( pHelpWin->GetWindowExtentsRelative( pWindow ) );
566  if( pHelpWin->IsVisible() )
567  pWindow->Invalidate( aInvRect );
568  pSVData->maHelpData.mpHelpWin = nullptr;
569  pSVData->maHelpData.mbKeyboardHelp = false;
570  pHelpWin->Hide();
571  pHelpWin.disposeAndClear();
572  if( bUpdateHideTime )
574  }
575 }
576 
577 void ImplSetHelpWindowPos( vcl::Window* pHelpWin, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle,
578  const Point& rPos, const tools::Rectangle& rHelpArea )
579 {
580  Point aPos = rPos;
581  Size aSz = pHelpWin->GetSizePixel();
582  tools::Rectangle aScreenRect = pHelpWin->ImplGetFrameWindow()->GetDesktopRectPixel();
583  aPos = pHelpWin->GetParent()->ImplGetFrameWindow()->OutputToAbsoluteScreenPixel( aPos );
584  // get mouse screen coords
585  Point aMousePos( pHelpWin->GetParent()->ImplGetFrameWindow()->GetPointerPosPixel() );
586  aMousePos = pHelpWin->GetParent()->ImplGetFrameWindow()->OutputToAbsoluteScreenPixel( aMousePos );
587 
588  if ( nHelpWinStyle == HELPWINSTYLE_QUICK )
589  {
590  if ( !(nStyle & QuickHelpFlags::NoAutoPos) )
591  {
592  long nScreenHeight = aScreenRect.GetHeight();
593  aPos.AdjustX( -4 );
594  if ( aPos.Y() > aScreenRect.Top()+nScreenHeight-(nScreenHeight/4) )
595  aPos.AdjustY( -(aSz.Height()+4) );
596  else
597  aPos.AdjustY(21 );
598  }
599  }
600  else
601  {
602  // If it's the mouse position, move the window slightly
603  // so the mouse pointer does not cover it
604  if ( aPos == aMousePos )
605  {
606  aPos.AdjustX(12 );
607  aPos.AdjustY(16 );
608  }
609  }
610 
611  if ( nStyle & QuickHelpFlags::NoAutoPos )
612  {
613  // convert help area to screen coords
614  tools::Rectangle devHelpArea(
615  pHelpWin->GetParent()->ImplGetFrameWindow()->OutputToAbsoluteScreenPixel( rHelpArea.TopLeft() ),
616  pHelpWin->GetParent()->ImplGetFrameWindow()->OutputToAbsoluteScreenPixel( rHelpArea.BottomRight() ) );
617 
618  // which position of the rectangle?
619  aPos = devHelpArea.Center();
620 
621  if ( nStyle & QuickHelpFlags::Left )
622  aPos.setX( devHelpArea.Left() );
623  else if ( nStyle & QuickHelpFlags::Right )
624  aPos.setX( devHelpArea.Right() );
625 
626  if ( nStyle & QuickHelpFlags::Top )
627  aPos.setY( devHelpArea.Top() );
628  else if ( nStyle & QuickHelpFlags::Bottom )
629  aPos.setY( devHelpArea.Bottom() );
630 
631  // which direction?
632  if ( nStyle & QuickHelpFlags::Left )
633  ;
634  else if ( nStyle & QuickHelpFlags::Right )
635  aPos.AdjustX( -(aSz.Width()) );
636  else
637  aPos.AdjustX( -(aSz.Width()/2) );
638 
639  if ( nStyle & QuickHelpFlags::Top )
640  ;
641  else if ( nStyle & QuickHelpFlags::Bottom )
642  aPos.AdjustY( -(aSz.Height()) );
643  else
644  aPos.AdjustY( -(aSz.Height()/2) );
645  }
646 
647  if ( aPos.X() < aScreenRect.Left() )
648  aPos.setX( aScreenRect.Left() );
649  else if ( ( aPos.X() + aSz.Width() ) > aScreenRect.Right() )
650  aPos.setX( aScreenRect.Right() - aSz.Width() );
651  if ( aPos.Y() < aScreenRect.Top() )
652  aPos.setY( aScreenRect.Top() );
653  else if ( ( aPos.Y() + aSz.Height() ) > aScreenRect.Bottom() )
654  aPos.setY( aScreenRect.Bottom() - aSz.Height() );
655 
656  if( ! (nStyle & QuickHelpFlags::NoEvadePointer) )
657  {
658  /* the remark below should be obsolete by now as the helpwindow should
659  not be focusable, leaving it as a hint. However it is sensible in most
660  conditions to evade the mouse pointer so the content window is fully visible.
661 
662  // the popup must not appear under the mouse
663  // otherwise it would directly be closed due to a focus change...
664  */
665  tools::Rectangle aHelpRect( aPos, aSz );
666  if( aHelpRect.IsInside( aMousePos ) )
667  {
668  Point delta(2,2);
669  Point aSize( aSz.Width(), aSz.Height() );
670  Point aTest( aMousePos - aSize - delta );
671  if( aTest.X() > aScreenRect.Left() && aTest.Y() > aScreenRect.Top() )
672  aPos = aTest;
673  else
674  aPos = aMousePos + delta;
675  }
676  }
677 
678  vcl::Window* pWindow = pHelpWin->GetParent()->ImplGetFrameWindow();
679  aPos = pWindow->AbsoluteScreenToOutputPixel( aPos );
680  pHelpWin->SetPosPixel( aPos );
681 }
682 
683 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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:779
void SetPos(const Point &rPoint)
VclPtr< HelpTextWindow > mpHelpWin
Definition: svdata.hxx:255
Point GetPointerPosPixel()
Definition: mouse.cxx:548
static void EnableContextHelp()
Definition: help.cxx:77
static void DisableBalloonHelp()
Definition: help.cxx:145
#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:254
tools::Rectangle maTextRect
Definition: helpwin.hxx:33
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:366
long AdjustX(long nHorzMove)
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:2052
sal_uInt16 mnHelpWinStyle
Definition: helpwin.hxx:40
Point AbsoluteScreenToOutputPixel(const Point &rPos) const
Definition: window.cxx:2877
sal_uInt16 GetWinStyle() const
Definition: helpwin.hxx:60
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:2364
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
Definition: window2.cxx:895
aBuf
sal_Int16 nId
ComplexTextLayoutFlags GetLayoutMode() const
Definition: outdev.hxx:598
const tools::Rectangle & GetHelpArea() const
Definition: helpwin.hxx:69
constexpr::Color COL_GRAY(0x80, 0x80, 0x80)
void SetParentClipMode(ParentClipMode nMode=ParentClipMode::NONE)
bool mbRequestingHelp
Definition: svdata.hxx:254
void SetLayoutMode(ComplexTextLayoutFlags nTextLayoutMode)
void SetHelpText(const OUString &rHelpText)
Definition: help.cxx:325
tools::Rectangle GetDesktopRectPixel() const
Definition: window.cxx:2811
Timer maHideTimer
Definition: helpwin.hxx:38
SAL_DLLPRIVATE void ImplUpdateAll()
Definition: paint.cxx:978
void SetType(WindowType nType)
Definition: window2.cxx:962
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:248
QuickHelpFlags mnStyle
Definition: helpwin.hxx:41
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:1789
static void DisableContextHelp()
Definition: help.cxx:82
void SetBackground()
static void EnableBalloonHelp()
Definition: help.cxx:140
long Right() const
sal_uInt64 mnLastHelpHideTime
Definition: svdata.hxx:256
static void DisableQuickHelp()
Definition: help.cxx:168
void setX(long nX)
bool mbSetKeyboardHelp
Definition: svdata.hxx:252
void Hide()
Definition: window.hxx:930
static void * ShowPopover(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rText, QuickHelpFlags nStyle)
Definition: help.cxx:196
VclPtr< WorkWindow > mpAppWin
Definition: svdata.hxx:199
virtual void SetOutputSizePixel(const Size &rNewSize)
Definition: window2.cxx:1268
long Top() const
force balloon-style in ShowPopover and ShowQuickHelp
void setY(long nY)
QuickHelpFlags GetStyle() const
Definition: helpwin.hxx:61
const HelpSettings & GetHelpSettings() const
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:32
SAL_DLLPRIVATE void ImplSetMouseTransparent(bool bTransparent)
Definition: window2.cxx:925
void Update()
Definition: paint.cxx:1273
static void DisableExtHelp()
Definition: help.cxx:97
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &) override
Definition: help.cxx:374
Point BottomRight() const
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:67
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:237
long AdjustY(long nVertMove)
OUString maHelpText
Definition: helpwin.hxx:35
virtual ~HelpTextWindow() override
Definition: help.cxx:310
bool IsDark() const
bool mbQuickHelp
Definition: svdata.hxx:251
bool mbExtHelp
Definition: svdata.hxx:247
ComplexTextLayoutFlags
Definition: outdevstate.hxx:66
static bool IsQuickHelpEnabled()
Definition: help.cxx:173
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1153
QuickHelpFlags
Definition: help.hxx:32
OStringBuffer & padToLength(OStringBuffer &rBuffer, sal_Int32 nLength, sal_Char cFill= '\0')
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:618
SAL_DLLPRIVATE void ImplGenerateMouseMove()
Definition: mouse.cxx:156
sal_uLong GetTipTimeout() const
void SetTextColor(const Color &rColor)
Definition: text.cxx:662
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
ImplSVHelpData maHelpData
Definition: svdata.hxx:356
static bool EndExtHelp()
Definition: help.cxx:124
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:1015
Size GetOutputSizePixel() const
Definition: outdev.hxx:441
DrawTextFlags
Definition: outdev.hxx:144
Size CalcOutSize() const
Definition: help.cxx:461
bool mbContextHelp
Definition: svdata.hxx:246
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:888
static void ShowQuickHelp(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rHelpText, QuickHelpFlags nStyle=QuickHelpFlags::NONE)
Definition: help.cxx:178
vcl::Window * GetParent() const
Definition: window2.cxx:1091
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:286
long X() const
static bool IsBalloonHelpEnabled()
Definition: help.cxx:150
Point OutputToAbsoluteScreenPixel(const Point &rPos) const
Definition: window.cxx:2867
Size GetSize() const
static void UpdatePopover(void *nId, vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rText)
Definition: help.cxx:216
void SetPointFont(vcl::RenderContext &rRenderContext, const vcl::Font &rFont)
Definition: window.cxx:2136
IMPL_LINK(HelpTextWindow, TimerHdl, Timer *, pTimer, void)
Definition: help.cxx:441
ImplSVWinData maWinData
Definition: svdata.hxx:354
virtual void RequestHelp(const HelpEvent &rHEvt) override
Definition: help.cxx:469
long GetCtrlTextWidth(const OUString &rStr, const SalLayoutGlyphs *pLayoutCache=nullptr) const
Definition: text.cxx:2196
#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:853
ALIGN_TOP
virtual bool UpdatePopover(void *, const OUString &, vcl::Window *, const tools::Rectangle &)
Definition: salframe.hxx:272
Timer maShowTimer
Definition: helpwin.hxx:37
void Stop()
Definition: scheduler.cxx:594
bool mbBalloonHelp
Definition: svdata.hxx:250
bool mbOldBalloonMode
Definition: svdata.hxx:249
#define SAL_WARN_IF(condition, area, stream)
virtual bool HidePopover(void *)
Definition: salframe.hxx:278
const OUString & GetHelpText() const
Definition: helpwin.hxx:58
void ShowHelp(bool bNoDelay)
Definition: help.cxx:420
bool IsVisible() const
Definition: window2.cxx:1096
void EnableChildTransparentMode(bool bEnable=true)
Definition: window2.cxx:1016
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:57
constexpr::Color COL_WHITE(0xFF, 0xFF, 0xFF)
static sal_uInt64 GetSystemTicks()
long Left() const
static sal_uLong GetBalloonDelay()
static void EnableQuickHelp()
Definition: help.cxx:163
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:877
bool IsDisposed() const
Definition: window.cxx:135
virtual bool ShowTooltip(const OUString &, const tools::Rectangle &)
Definition: salframe.hxx:260
reference_type * get() const
Get the body.
Definition: vclptr.hxx:143
Definition: timer.hxx:26
Point OutputToScreenPixel(const Point &rPos) const
Definition: window.cxx:2818
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
Definition: help.cxx:315
virtual void * ShowPopover(const OUString &, vcl::Window *, const tools::Rectangle &, QuickHelpFlags)
Definition: salframe.hxx:266
static void EnableExtHelp()
Definition: help.cxx:92
void SetHelpArea(const tools::Rectangle &rRect)
Definition: helpwin.hxx:64
void ImplSetHelpWindowPos(vcl::Window *pHelpWin, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle, const Point &rPos, const tools::Rectangle &rHelpArea)
Definition: help.cxx:577
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:189
void setWidth(long nWidth)
virtual void SetPosPixel(const Point &rNewPos)
Definition: window2.cxx:1251
bool mbKeyboardHelp
Definition: svdata.hxx:253
tools::Rectangle GetWindowExtentsRelative(vcl::Window *pRelativeWindow) const
Definition: window.cxx:2904
virtual ~Help()
Definition: help.cxx:49
void SetTextAlign(TextAlign eAlign)
Definition: text.cxx:763
Point Center() const
long Y() 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:155
void SetDebugName(const sal_Char *pDebugName)
Definition: task.hxx:82
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Definition: window.cxx:2150
void setHeight(long nHeight)