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
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
53bool Help::Start( const OUString&, const vcl::Window* )
54{
55 return false;
56}
57
58bool Help::Start(const OUString&, weld::Widget*)
59{
60 return false;
61}
62
63void Help::SearchKeyword( const OUString& )
64{
65}
66
67OUString Help::GetHelpText( const OUString&, const vcl::Window* )
68{
69 return OUString();
70}
71
72OUString 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 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{
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 Point aScreenPos = nStyle & QuickHelpFlags::NoAutoPos
187 ? Point()
188 : pParent->OutputToScreenPixel(pParent->GetPointerPosPixel());
189 ImplShowHelpWindow( pParent, nHelpWinStyle, nStyle,
190 rHelpText, aScreenPos, rScreenRect );
191}
192
194{
195 HelpTextWindow const * pHelpWin = ImplGetSVHelpData().mpHelpWin;
196 bool const bIsVisible = ( pHelpWin != nullptr ) && pHelpWin->IsVisible();
197 ImplDestroyHelpWindow( bIsVisible );
198}
199
200void* Help::ShowPopover(vcl::Window* pParent, const tools::Rectangle& rScreenRect,
201 const OUString& rText, QuickHelpFlags nStyle)
202{
203 void* nId = pParent->ImplGetFrame()->ShowPopover(rText, pParent, rScreenRect, nStyle);
204 if (nId)
205 {
206 //popovers are handled natively, return early
207 return nId;
208 }
209
210 sal_uInt16 nHelpWinStyle = ( nStyle & QuickHelpFlags::TipStyleBalloon ) ? HELPWINSTYLE_BALLOON : HELPWINSTYLE_QUICK;
211 VclPtrInstance<HelpTextWindow> pHelpWin( pParent, rText, nHelpWinStyle, nStyle );
212
213 nId = pHelpWin.get();
214 UpdatePopover(nId, pParent, rScreenRect, rText);
215
216 pHelpWin->ShowHelp(true);
217 return nId;
218}
219
220void Help::UpdatePopover(void* nId, vcl::Window* pParent, const tools::Rectangle& rScreenRect,
221 const OUString& rText)
222{
223 if (pParent->ImplGetFrame()->UpdatePopover(nId, rText, pParent, rScreenRect))
224 {
225 //popovers are handled natively, return early
226 return;
227 }
228
229 HelpTextWindow* pHelpWin = static_cast< HelpTextWindow* >( nId );
230 ENSURE_OR_RETURN_VOID( pHelpWin != nullptr, "Help::UpdatePopover: invalid ID!" );
231
232 Size aSz = pHelpWin->CalcOutSize();
233 pHelpWin->SetOutputSizePixel( aSz );
234 ImplSetHelpWindowPos( pHelpWin, pHelpWin->GetWinStyle(), pHelpWin->GetStyle(),
235 pParent->OutputToScreenPixel( pParent->GetPointerPosPixel() ), rScreenRect );
236
237 pHelpWin->SetHelpText( rText );
238 pHelpWin->Invalidate();
239}
240
241void Help::HidePopover(vcl::Window const * pParent, void* nId)
242{
243 if (pParent->ImplGetFrame()->HidePopover(nId))
244 {
245 //popovers are handled natively, return early
246 return;
247 }
248
249 VclPtr<HelpTextWindow> pHelpWin = static_cast<HelpTextWindow*>(nId);
250 vcl::Window* pFrameWindow = pHelpWin->ImplGetFrameWindow();
251 pHelpWin->Hide();
252 // trigger update, so that a Paint is instantly triggered since we do not save the background
253 pFrameWindow->ImplUpdateAll();
254 pHelpWin.disposeAndClear();
256}
257
258HelpTextWindow::HelpTextWindow( vcl::Window* pParent, const OUString& rText, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle ) :
259 FloatingWindow( pParent, WB_SYSTEMWINDOW|WB_TOOLTIPWIN ), // #105827# if we change the parent, mirroring will not work correctly when positioning this window
260 maHelpText( rText ),
261 maShowTimer( "vcl::HelpTextWindow maShowTimer" ),
262 maHideTimer( "vcl::HelpTextWindow maHideTimer" )
263{
266 mnHelpWinStyle = nHelpWinStyle;
267 mnStyle = nStyle;
268
270 {
273 GetOutDev()->SetLayoutMode( nLayoutMode );
274 }
275 SetHelpText( rText );
276 Window::SetHelpText( rText );
277
278 if ( ImplGetSVHelpData().mbSetKeyboardHelp )
280
281
282 maShowTimer.SetInvokeHandler( LINK( this, HelpTextWindow, TimerHdl ) );
283
284 const HelpSettings& rHelpSettings = pParent->GetSettings().GetHelpSettings();
285 maHideTimer.SetTimeout( rHelpSettings.GetTipTimeout() );
286 maHideTimer.SetInvokeHandler( LINK( this, HelpTextWindow, TimerHdl ) );
287}
288
290{
291 const StyleSettings& rStyleSettings = rRenderContext.GetSettings().GetStyleSettings();
292 SetPointFont(rRenderContext, rStyleSettings.GetHelpFont());
293 rRenderContext.SetTextColor(rStyleSettings.GetHelpTextColor());
294 rRenderContext.SetTextAlign(ALIGN_TOP);
295
297 {
301 rRenderContext.SetBackground();
302 }
303 else
304 rRenderContext.SetBackground(Wallpaper(rStyleSettings.GetHelpColor()));
305
306 if (rStyleSettings.GetHelpColor().IsDark())
307 rRenderContext.SetLineColor(COL_WHITE);
308 else
309 rRenderContext.SetLineColor(COL_BLACK);
310 rRenderContext.SetFillColor();
311}
312
314{
315 disposeOnce();
316}
317
319{
322
323 if( this == ImplGetSVHelpData().mpHelpWin )
324 ImplGetSVHelpData().mpHelpWin = nullptr;
326}
327
328void HelpTextWindow::SetHelpText( const OUString& rHelpText )
329{
330 maHelpText = rHelpText;
332 if ( mnHelpWinStyle == HELPWINSTYLE_QUICK && maHelpText.getLength() < HELPTEXTMAXLEN && maHelpText.indexOf('\n') < 0)
333 {
334 Size aSize;
335 aSize.setHeight( GetTextHeight() );
337 aSize.setWidth( GetOutDev()->GetCtrlTextWidth( maHelpText ) );
338 else
339 aSize.setWidth( GetTextWidth( maHelpText ) );
341 }
342 else // HELPWINSTYLE_BALLOON
343 {
344 sal_Int32 nCharsInLine = 35 + ((maHelpText.getLength()/100)*5);
345 // average width to have all windows consistent
346 OUStringBuffer aBuf(nCharsInLine);
347 comphelper::string::padToLength(aBuf, nCharsInLine, 'x');
348 tools::Long nWidth = GetTextWidth( OUString::unacquired(aBuf) );
349 Size aTmpSize( nWidth, 0x7FFFFFFF );
350 tools::Rectangle aTry1( Point(), aTmpSize );
354 nDrawFlags |= DrawTextFlags::Mnemonic;
355 tools::Rectangle aTextRect = GetTextRect( aTry1, maHelpText, nDrawFlags );
356
357 // get a better width later...
358 maTextRect = aTextRect;
359
360 // safety distance...
362 }
363
364 Size aSize( CalcOutSize() );
365 SetOutputSizePixel( aSize );
366 if (IsVisible())
368}
369
371{
372 VclPtr<HelpTextWindow> xWindow( this );
374 if( !xWindow->isDisposed() )
376}
377
379{
380 // paint native background
381 bool bNativeOK = false;
383 {
384 tools::Rectangle aCtrlRegion(Point(0, 0), GetOutputSizePixel());
385 ImplControlValue aControlValue;
386 bNativeOK = rRenderContext.DrawNativeControl(ControlType::Tooltip, ControlPart::Entire, aCtrlRegion,
387 ControlState::NONE, aControlValue, OUString());
388 }
389
390 // paint text
391 if (mnHelpWinStyle == HELPWINSTYLE_QUICK && maHelpText.getLength() < HELPTEXTMAXLEN && maHelpText.indexOf('\n') < 0)
392 {
394 rRenderContext.DrawCtrlText(maTextRect.TopLeft(), maHelpText);
395 else
396 rRenderContext.DrawText(maTextRect.TopLeft(), maHelpText);
397 }
398 else // HELPWINSTYLE_BALLOON
399 {
403 nDrawFlags |= DrawTextFlags::Mnemonic;
404 rRenderContext.DrawText(maTextRect, maHelpText, nDrawFlags);
405 }
406
407 // border
408 if (bNativeOK)
409 return;
410
411 Size aSz = GetOutputSizePixel();
412 rRenderContext.DrawRect(tools::Rectangle(Point(), aSz));
414 {
415 aSz.AdjustWidth( -2 );
416 aSz.AdjustHeight( -2 );
417 Color aColor(rRenderContext.GetLineColor());
418 rRenderContext.SetLineColor(COL_GRAY);
419 rRenderContext.DrawRect(tools::Rectangle(Point(1, 1), aSz));
420 rRenderContext.SetLineColor(aColor);
421 }
422}
423
424void HelpTextWindow::ShowHelp(bool bNoDelay)
425{
426 sal_uLong nTimeout = 0;
427 if (!bNoDelay)
428 {
429 // In case of ExtendedHelp display help sooner
430 if ( ImplGetSVHelpData().mbExtHelpMode )
431 nTimeout = 15;
432 else
433 {
435 nTimeout = HelpSettings::GetTipDelay();
436 else
438 }
439 }
440
441 maShowTimer.SetTimeout( nTimeout );
443}
444
445IMPL_LINK( HelpTextWindow, TimerHdl, Timer*, pTimer, void)
446{
447 if ( pTimer == &maShowTimer )
448 {
449 ResetHideTimer();
450 ImplShow();
451 }
452 else
453 {
454 SAL_WARN_IF( pTimer != &maHideTimer, "vcl", "HelpTextWindow::TimerHdl with bad Timer" );
455 ImplDestroyHelpWindow( true );
456 }
457}
458
460{
461 Size aSz = maTextRect.GetSize();
462 aSz.AdjustWidth(2*maTextRect.Left() );
463 aSz.AdjustHeight(2*maTextRect.Top() );
464 return aSz;
465}
466
468{
469 // Just to assure that Window::RequestHelp() is not called by
470 // ShowQuickHelp/ShowBalloonHelp in the HelpTextWindow.
471}
472
474{
475 return maHelpText;
476}
477
479{
481 {
482 // start auto-hide-timer for non-ShowTip windows
483 if (this == ImplGetSVHelpData().mpHelpWin)
485 }
486}
487
488void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle,
489 const OUString& rHelpText,
490 const Point& rScreenPos, const tools::Rectangle& rHelpArea )
491{
492 if (pParent->ImplGetFrame()->ShowTooltip(rHelpText, rHelpArea))
493 {
494 //tooltips are handled natively, return early
495 return;
496 }
497
498 ImplSVHelpData& aHelpData = ImplGetSVHelpData();
499
500 if (rHelpText.isEmpty() && !aHelpData.mbRequestingHelp)
501 return;
502
503 bool bNoDelay = false;
504 if (VclPtr<HelpTextWindow> pHelpWin = aHelpData.mpHelpWin)
505 {
506 SAL_WARN_IF( pHelpWin == pParent, "vcl", "HelpInHelp ?!" );
507
508 bool bRemoveHelp = (rHelpText.isEmpty() || (pHelpWin->GetWinStyle() != nHelpWinStyle))
509 && aHelpData.mbRequestingHelp;
510
511 if (!bRemoveHelp && pHelpWin->GetParent() == pParent)
512 {
513 bool const bUpdate = (pHelpWin->GetHelpText() != rHelpText) ||
514 ((pHelpWin->GetHelpArea() != rHelpArea) && aHelpData.mbRequestingHelp);
515 if (bUpdate)
516 {
517 pHelpWin->SetHelpText( rHelpText );
518 // approach mouse position
519 ImplSetHelpWindowPos( pHelpWin, nHelpWinStyle, nStyle, rScreenPos, rHelpArea );
520 if( pHelpWin->IsVisible() )
521 pHelpWin->Invalidate();
522 }
523 pHelpWin->ResetHideTimer(); // It is shown anew, so prolongate the hide timeout
524 return;
525 }
526
527 // remove help window if no HelpText or
528 // other help mode. but keep it if we are scrolling, ie not requesting help
529 bool bWasVisible = pHelpWin->IsVisible();
530 if ( bWasVisible )
531 bNoDelay = true; // display it quickly if we were already in quick help mode
532 ImplDestroyHelpWindow( bWasVisible );
533 }
534
535 if (rHelpText.isEmpty())
536 return;
537
538 VclPtr<HelpTextWindow> pHelpWin = VclPtr<HelpTextWindow>::Create( pParent, rHelpText, nHelpWinStyle, nStyle );
539 aHelpData.mpHelpWin = pHelpWin;
540 pHelpWin->SetHelpArea( rHelpArea );
541
542 // positioning
543 Size aSz = pHelpWin->CalcOutSize();
544 pHelpWin->SetOutputSizePixel( aSz );
545 ImplSetHelpWindowPos( pHelpWin, nHelpWinStyle, nStyle, rScreenPos, rHelpArea );
546 // if not called from Window::RequestHelp, then without delay...
547 if (!bNoDelay)
548 {
549 if ( !aHelpData.mbRequestingHelp )
550 {
551 bNoDelay = true;
552 }
553 else
554 {
555 sal_uInt64 nCurTime = tools::Time::GetSystemTicks();
556 if ( ( nCurTime - aHelpData.mnLastHelpHideTime ) < o3tl::make_unsigned(HelpSettings::GetTipDelay()) )
557 bNoDelay = true;
558 }
559 }
560 pHelpWin->ShowHelp(bNoDelay);
561}
562
563void ImplDestroyHelpWindow( bool bUpdateHideTime )
564{
565 ImplDestroyHelpWindow(ImplGetSVHelpData(), bUpdateHideTime);
566}
567
568void ImplDestroyHelpWindow(ImplSVHelpData& rHelpData, bool bUpdateHideTime)
569{
570 VclPtr<HelpTextWindow> pHelpWin = rHelpData.mpHelpWin;
571 if( pHelpWin )
572 {
573 rHelpData.mpHelpWin = nullptr;
574 rHelpData.mbKeyboardHelp = false;
575 pHelpWin->Hide();
576 pHelpWin.disposeAndClear();
577 if( bUpdateHideTime )
579 }
580}
581
582void ImplSetHelpWindowPos( vcl::Window* pHelpWin, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle,
583 const Point& rPos, const tools::Rectangle& rHelpArea )
584{
585 Point aPos;
586 Size aSz = pHelpWin->GetSizePixel();
587 tools::Rectangle aScreenRect = pHelpWin->ImplGetFrameWindow()->GetDesktopRectPixel();
588 vcl::Window* pWindow = pHelpWin->GetParent()->ImplGetFrameWindow();
589 // get mouse screen coords
590 Point aMousePos(pWindow->OutputToAbsoluteScreenPixel(pWindow->GetPointerPosPixel()));
591
592 if ( nStyle & QuickHelpFlags::NoAutoPos )
593 {
594 // convert help area to screen coords
595 tools::Rectangle devHelpArea(
596 pWindow->OutputToAbsoluteScreenPixel( rHelpArea.TopLeft() ),
597 pWindow->OutputToAbsoluteScreenPixel( rHelpArea.BottomRight() ) );
598
599 // which position of the rectangle?
600 aPos = devHelpArea.Center();
601
602 if ( nStyle & QuickHelpFlags::Left )
603 aPos.setX( devHelpArea.Left() );
604 else if ( nStyle & QuickHelpFlags::Right )
605 aPos.setX( devHelpArea.Right() );
606
607 if ( nStyle & QuickHelpFlags::Top )
608 aPos.setY( devHelpArea.Top() );
609 else if ( nStyle & QuickHelpFlags::Bottom )
610 aPos.setY( devHelpArea.Bottom() );
611
612 // which direction?
613 if ( nStyle & QuickHelpFlags::Left )
614 ;
615 else if ( nStyle & QuickHelpFlags::Right )
616 aPos.AdjustX( -(aSz.Width()) );
617 else
618 aPos.AdjustX( -(aSz.Width()/2) );
619
620 if ( nStyle & QuickHelpFlags::Top )
621 ;
622 else if ( nStyle & QuickHelpFlags::Bottom )
623 aPos.AdjustY( -(aSz.Height()) );
624 else
625 aPos.AdjustY( -(aSz.Height()/2) );
626 }
627 else
628 {
629 aPos = pWindow->OutputToAbsoluteScreenPixel(rPos);
630 if ( nHelpWinStyle == HELPWINSTYLE_QUICK )
631 {
632 tools::Long nScreenHeight = aScreenRect.GetHeight();
633 aPos.AdjustX( -4 );
634 if ( aPos.Y() > aScreenRect.Top()+nScreenHeight-(nScreenHeight/4) )
635 aPos.AdjustY( -(aSz.Height()+4) );
636 else
637 aPos.AdjustY(21 );
638 }
639 else
640 {
641 // If it's the mouse position, move the window slightly
642 // so the mouse pointer does not cover it
643 if ( aPos == aMousePos )
644 {
645 aPos.AdjustX(12 );
646 aPos.AdjustY(16 );
647 }
648 }
649 }
650
651 if ( aPos.X() < aScreenRect.Left() )
652 aPos.setX( aScreenRect.Left() );
653 else if ( ( aPos.X() + aSz.Width() ) > aScreenRect.Right() )
654 aPos.setX( aScreenRect.Right() - aSz.Width() );
655 if ( aPos.Y() < aScreenRect.Top() )
656 aPos.setY( aScreenRect.Top() );
657 else if ( ( aPos.Y() + aSz.Height() ) > aScreenRect.Bottom() )
658 aPos.setY( aScreenRect.Bottom() - aSz.Height() );
659
660 if( ! (nStyle & QuickHelpFlags::NoEvadePointer) )
661 {
662 /* the remark below should be obsolete by now as the helpwindow should
663 not be focusable, leaving it as a hint. However it is sensible in most
664 conditions to evade the mouse pointer so the content window is fully visible.
665
666 // the popup must not appear under the mouse
667 // otherwise it would directly be closed due to a focus change...
668 */
669 tools::Rectangle aHelpRect( aPos, aSz );
670 if( aHelpRect.Contains( aMousePos ) )
671 {
672 Point delta(2,2);
673 Point aSize( aSz.Width(), aSz.Height() );
674 Point aTest( aMousePos - aSize - delta );
675 if( aTest.X() > aScreenRect.Left() && aTest.Y() > aScreenRect.Top() )
676 aPos = aTest;
677 else
678 aPos = aMousePos + delta;
679 }
680 }
681
682 aPos = pWindow->AbsoluteScreenToOutputPixel( aPos );
683 pHelpWin->SetPosPixel( aPos );
684}
685
686/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
DrawTextFlags
const HelpSettings & GetHelpSettings() const
const StyleSettings & GetStyleSettings() const
bool IsDark() const
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 sal_Int32 GetBalloonDelay()
sal_Int32 GetTipTimeout() const
static sal_Int32 GetTipDelay()
A tooltip: adds tips to widgets in a floating / popup window.
Definition: helpwin.hxx:31
tools::Rectangle maTextRect
Definition: helpwin.hxx:35
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
Definition: help.cxx:289
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
Definition: help.cxx:318
sal_uInt16 mnHelpWinStyle
Definition: helpwin.hxx:42
void ResetHideTimer()
Definition: help.cxx:478
void ShowHelp(bool bNoDelay)
Definition: help.cxx:424
virtual ~HelpTextWindow() override
Definition: help.cxx:313
Size CalcOutSize() const
Definition: help.cxx:459
Timer maHideTimer
Definition: helpwin.hxx:40
QuickHelpFlags GetStyle() const
Definition: helpwin.hxx:63
void SetHelpArea(const tools::Rectangle &rRect)
Definition: helpwin.hxx:66
QuickHelpFlags mnStyle
Definition: helpwin.hxx:43
void SetHelpText(const OUString &rHelpText)
Definition: help.cxx:328
HelpTextWindow(vcl::Window *pParent, const OUString &rText, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle)
Definition: help.cxx:258
OUString maHelpText
Definition: helpwin.hxx:37
void ImplShow()
Definition: help.cxx:370
virtual void RequestHelp(const HelpEvent &rHEvt) override
Definition: help.cxx:467
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &) override
Definition: help.cxx:378
sal_uInt16 GetWinStyle() const
Definition: helpwin.hxx:62
Timer maShowTimer
Definition: helpwin.hxx:39
virtual OUString GetText() const override
Definition: help.cxx:473
virtual bool Start(const OUString &rHelpId, weld::Widget *pWidget=nullptr)
Definition: help.cxx:58
static bool StartExtHelp()
Definition: help.cxx:107
static void EnableQuickHelp()
Definition: help.cxx:165
virtual ~Help()
Definition: help.cxx:49
static bool IsQuickHelpEnabled()
Definition: help.cxx:175
static void DisableBalloonHelp()
Definition: help.cxx:147
virtual void SearchKeyword(const OUString &rKeyWord)
Definition: help.cxx:63
static void EnableBalloonHelp()
Definition: help.cxx:142
static void HideBalloonAndQuickHelp()
Definition: help.cxx:193
static void DisableExtHelp()
Definition: help.cxx:97
static bool IsContextHelpEnabled()
Definition: help.cxx:87
virtual OUString GetHelpText(const OUString &aHelpURL, const weld::Widget *pWidget)
Definition: help.cxx:72
static bool IsExtHelpEnabled()
Definition: help.cxx:102
static void DisableQuickHelp()
Definition: help.cxx:170
static void EnableContextHelp()
Definition: help.cxx:77
static void EnableExtHelp()
Definition: help.cxx:92
static bool IsBalloonHelpEnabled()
Definition: help.cxx:152
static bool EndExtHelp()
Definition: help.cxx:125
static void * ShowPopover(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rText, QuickHelpFlags nStyle)
Definition: help.cxx:200
static void UpdatePopover(void *nId, vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rText)
Definition: help.cxx:220
static void ShowQuickHelp(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rHelpText, QuickHelpFlags nStyle=QuickHelpFlags::NONE)
Definition: help.cxx:180
Help()
Definition: help.cxx:45
static void HidePopover(vcl::Window const *pParent, void *nId)
Definition: help.cxx:241
static void DisableContextHelp()
Definition: help.cxx:82
static void ShowBalloon(vcl::Window *pParent, const Point &rScreenPos, const tools::Rectangle &, const OUString &rHelpText)
Definition: help.cxx:157
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
Definition: outdev.hxx:170
void DrawCtrlText(const Point &rPos, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, DrawTextFlags nStyle=DrawTextFlags::Mnemonic, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pGlyphs=nullptr)
Definition: text.cxx:2149
void SetTextAlign(TextAlign eAlign)
Definition: text.cxx:774
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:50
void SetLineColor()
Definition: line.cxx:37
void SetTextColor(const Color &rColor)
Definition: text.cxx:716
vcl::text::ComplexTextLayoutFlags GetLayoutMode() const
Definition: outdev.hxx:490
void SetFillColor()
Definition: fill.cxx:29
const Color & GetLineColor() const
Definition: outdev.hxx:510
void SetBackground()
Definition: background.cxx:27
bool DrawNativeControl(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, const OUString &aCaption, const Color &rBackgroundColor=COL_AUTO)
Request rendering of a particular control and/or part.
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
Definition: text.cxx:797
void SetLayoutMode(vcl::text::ComplexTextLayoutFlags nTextLayoutMode)
Definition: text.cxx:60
const AllSettings & GetSettings() const
Definition: outdev.hxx:288
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
virtual bool HidePopover(void *)
Definition: salframe.hxx:285
virtual bool UpdatePopover(void *, const OUString &, vcl::Window *, const tools::Rectangle &)
Definition: salframe.hxx:279
virtual void * ShowPopover(const OUString &, vcl::Window *, const tools::Rectangle &, QuickHelpFlags)
Definition: salframe.hxx:273
virtual bool ShowTooltip(const OUString &, const tools::Rectangle &)
Definition: salframe.hxx:267
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
const vcl::Font & GetHelpFont() const
const Color & GetHelpTextColor() const
const Color & GetHelpColor() const
void Stop()
Definition: scheduler.cxx:599
Definition: timer.hxx:27
void SetTimeout(sal_uInt64 nTimeoutMs)
Definition: timer.cxx:90
void SetInvokeHandler(const Link< Timer *, void > &rLink)
Definition: timer.hxx:56
virtual void Start(bool bStartTimer=true) override
Schedules the task for execution.
Definition: timer.cxx:83
A construction helper for a temporary VclPtr.
Definition: vclptr.hxx:277
void disposeAndClear()
Definition: vclptr.hxx:200
reference_type * get() const
Get the body.
Definition: vclptr.hxx:143
static VclPtr< reference_type > Create(Arg &&... arg)
A construction helper for VclPtr.
Definition: vclptr.hxx:127
bool isDisposed() const
constexpr Point Center() const
bool Contains(const Point &rPOINT) const
constexpr tools::Long Top() const
constexpr Point TopLeft() const
void SetPos(const Point &rPoint)
constexpr Size GetSize() const
constexpr tools::Long Right() const
constexpr Point BottomRight() const
constexpr tools::Long GetHeight() const
constexpr tools::Long Left() const
constexpr tools::Long Bottom() const
static sal_uInt64 GetSystemTicks()
Point AbsoluteScreenToOutputPixel(const Point &rPos) const
Definition: window.cxx:2865
Point OutputToScreenPixel(const Point &rPos) const
Definition: window.cxx:2806
tools::Rectangle GetTextRect(const tools::Rectangle &rRect, const OUString &rStr, DrawTextFlags nStyle=DrawTextFlags::WordBreak, TextRectInfo *pInfo=nullptr, const vcl::ITextLayout *_pTextLayout=nullptr) const
Definition: window3.cxx:201
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
Width of the text.
Definition: window3.cxx:66
SAL_DLLPRIVATE void ImplUpdateAll()
Definition: paint.cxx:988
vcl::Window * GetParent() const
Definition: window2.cxx:1123
void PaintImmediately()
Definition: paint.cxx:1268
tools::Rectangle GetDesktopRectPixel() const
Definition: window.cxx:2799
SAL_DLLPRIVATE void ImplGenerateMouseMove()
Definition: mouse.cxx:157
void SetParentClipMode(ParentClipMode nMode=ParentClipMode::NONE)
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
Definition: window3.cxx:65
virtual void SetOutputSizePixel(const Size &rNewSize)
Definition: window2.cxx:1300
const AllSettings & GetSettings() const
Definition: window3.cxx:129
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Definition: window.cxx:2187
::OutputDevice const * GetOutDev() const
Definition: window.cxx:567
void Hide()
Definition: window.hxx:879
SalFrame * ImplGetFrame() const
Definition: window2.cxx:879
virtual Size GetSizePixel() const
Definition: window.cxx:2402
Size GetOutputSizePixel() const
Definition: window3.cxx:89
Point GetPointerPosPixel()
Definition: mouse.cxx:540
void SetPointFont(vcl::RenderContext &rRenderContext, const vcl::Font &rFont)
Definition: window.cxx:2173
void SetPaintTransparent(bool bTransparent)
Definition: paint.cxx:1025
bool IsVisible() const
Definition: window2.cxx:1128
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1143
virtual void SetPosPixel(const Point &rNewPos)
Definition: window2.cxx:1283
Point OutputToAbsoluteScreenPixel(const Point &rPos) const
Definition: window.cxx:2855
void SetType(WindowType nType)
Definition: window2.cxx:994
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
Definition: window2.cxx:937
void EnableChildTransparentMode(bool bEnable=true)
Definition: window2.cxx:1048
SAL_DLLPRIVATE void ImplSetMouseTransparent(bool bTransparent)
Definition: window2.cxx:967
constexpr ::Color COL_GRAY(0x80, 0x80, 0x80)
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
#define ENSURE_OR_RETURN_VOID(c, m)
ALIGN_TOP
IMPL_LINK(HelpTextWindow, TimerHdl, Timer *, pTimer, void)
Definition: help.cxx:445
#define HELPWINSTYLE_BALLOON
Definition: help.cxx:38
#define HELPTEXTMARGIN_BALLOON
Definition: help.cxx:41
void ImplSetHelpWindowPos(vcl::Window *pHelpWin, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle, const Point &rPos, const tools::Rectangle &rHelpArea)
Definition: help.cxx:582
#define HELPTEXTMARGIN_QUICK
Definition: help.cxx:40
void ImplDestroyHelpWindow(bool bUpdateHideTime)
Definition: help.cxx:563
#define HELPTEXTMAXLEN
Definition: help.cxx:43
#define HELPWINSTYLE_QUICK
Definition: help.cxx:37
void ImplShowHelpWindow(vcl::Window *pParent, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle, const OUString &rHelpText, const Point &rScreenPos, const tools::Rectangle &rHelpArea)
Definition: help.cxx:488
QuickHelpFlags
Definition: help.hxx:33
@ TipStyleBalloon
force balloon-style in ShowPopover and ShowQuickHelp
#define SAL_WARN_IF(condition, area, stream)
aBuf
OStringBuffer & padToLength(OStringBuffer &rBuffer, sal_Int32 nLength, char cFill='\0')
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
long Long
ComplexTextLayoutFlags
Definition: State.hxx:76
sal_Int16 nId
sal_uIntPtr sal_uLong
ImplSVFrameData maFrameData
Definition: svdata.hxx:399
VclPtr< WorkWindow > mpAppWin
Definition: svdata.hxx:243
bool mbRequestingHelp
Definition: svdata.hxx:303
VclPtr< HelpTextWindow > mpHelpWin
Definition: svdata.hxx:304
sal_uInt64 mnLastHelpHideTime
Definition: svdata.hxx:305
bool mbKeyboardHelp
Definition: svdata.hxx:302
bool mbOldBalloonMode
Definition: svdata.hxx:298
bool mbExtHelpMode
Definition: svdata.hxx:297
bool mbBalloonHelp
Definition: svdata.hxx:299
bool mbQuickHelp
Definition: svdata.hxx:300
bool mbContextHelp
Definition: svdata.hxx:295
bool mbExtHelp
Definition: svdata.hxx:296
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:77
ImplSVHelpData & ImplGetSVHelpData()
Definition: svdata.cxx:507
WinBits const WB_SYSTEMWINDOW
Definition: wintypes.hxx:126
WinBits const WB_TOOLTIPWIN
Definition: wintypes.hxx:172