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 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
198void* 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
218void 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
239void 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
256HelpTextWindow::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 maShowTimer( "vcl::HelpTextWindow maShowTimer" ),
260 maHideTimer( "vcl::HelpTextWindow maHideTimer" )
261{
264 mnHelpWinStyle = nHelpWinStyle;
265 mnStyle = nStyle;
266
268 {
271 GetOutDev()->SetLayoutMode( nLayoutMode );
272 }
273 SetHelpText( rText );
274 Window::SetHelpText( rText );
275
276 if ( ImplGetSVHelpData().mbSetKeyboardHelp )
278
279
280 maShowTimer.SetInvokeHandler( LINK( this, HelpTextWindow, TimerHdl ) );
281
282 const HelpSettings& rHelpSettings = pParent->GetSettings().GetHelpSettings();
283 maHideTimer.SetTimeout( rHelpSettings.GetTipTimeout() );
284 maHideTimer.SetInvokeHandler( LINK( this, HelpTextWindow, TimerHdl ) );
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 {
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{
320
321 if( this == ImplGetSVHelpData().mpHelpWin )
322 ImplGetSVHelpData().mpHelpWin = nullptr;
324}
325
326void HelpTextWindow::SetHelpText( const OUString& rHelpText )
327{
328 maHelpText = rHelpText;
330 if ( mnHelpWinStyle == HELPWINSTYLE_QUICK && maHelpText.getLength() < HELPTEXTMAXLEN && maHelpText.indexOf('\n') < 0)
331 {
332 Size aSize;
333 aSize.setHeight( GetTextHeight() );
335 aSize.setWidth( GetOutDev()->GetCtrlTextWidth( maHelpText ) );
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(nCharsInLine);
345 comphelper::string::padToLength(aBuf, nCharsInLine, 'x');
346 tools::Long nWidth = GetTextWidth( OUString::unacquired(aBuf) );
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 );
370 if( !xWindow->isDisposed() )
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
387 if (mnHelpWinStyle == HELPWINSTYLE_QUICK && maHelpText.getLength() < HELPTEXTMAXLEN && maHelpText.indexOf('\n') < 0)
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 return;
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
420void HelpTextWindow::ShowHelp(bool bNoDelay)
421{
422 sal_uLong nTimeout = 0;
423 if (!bNoDelay)
424 {
425 // In case of ExtendedHelp display help sooner
426 if ( ImplGetSVHelpData().mbExtHelpMode )
427 nTimeout = 15;
428 else
429 {
431 nTimeout = HelpSettings::GetTipDelay();
432 else
434 }
435 }
436
437 maShowTimer.SetTimeout( nTimeout );
439}
440
441IMPL_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 if ( this == ImplGetSVHelpData().mpHelpWin )
449 maHideTimer.Start();
450 }
451 ImplShow();
452 }
453 else
454 {
455 SAL_WARN_IF( pTimer != &maHideTimer, "vcl", "HelpTextWindow::TimerHdl with bad Timer" );
456 ImplDestroyHelpWindow( true );
457 }
458}
459
461{
462 Size aSz = maTextRect.GetSize();
463 aSz.AdjustWidth(2*maTextRect.Left() );
464 aSz.AdjustHeight(2*maTextRect.Top() );
465 return aSz;
466}
467
469{
470 // Just to assure that Window::RequestHelp() is not called by
471 // ShowQuickHelp/ShowBalloonHelp in the HelpTextWindow.
472}
473
475{
476 return maHelpText;
477}
478
479void ImplShowHelpWindow( vcl::Window* pParent, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle,
480 const OUString& rHelpText,
481 const Point& rScreenPos, const tools::Rectangle& rHelpArea )
482{
483 if (pParent->ImplGetFrame()->ShowTooltip(rHelpText, rHelpArea))
484 {
485 //tooltips are handled natively, return early
486 return;
487 }
488
489 ImplSVHelpData& aHelpData = ImplGetSVHelpData();
490
491 if (rHelpText.isEmpty() && !aHelpData.mbRequestingHelp)
492 return;
493
494 VclPtr<HelpTextWindow> pHelpWin = aHelpData.mpHelpWin;
495 bool bNoDelay = false;
496 if ( pHelpWin )
497 {
498 SAL_WARN_IF( pHelpWin == pParent, "vcl", "HelpInHelp ?!" );
499
500 bool bRemoveHelp = (rHelpText.isEmpty() || (pHelpWin->GetWinStyle() != nHelpWinStyle))
501 && aHelpData.mbRequestingHelp;
502
503 if (!bRemoveHelp && pHelpWin->GetParent() == pParent)
504 {
505 bool const bUpdate = (pHelpWin->GetHelpText() != rHelpText) ||
506 ((pHelpWin->GetHelpArea() != rHelpArea) && aHelpData.mbRequestingHelp);
507 if (bUpdate)
508 {
509 pHelpWin->SetHelpText( rHelpText );
510 // approach mouse position
511 ImplSetHelpWindowPos( pHelpWin, nHelpWinStyle, nStyle, rScreenPos, rHelpArea );
512 if( pHelpWin->IsVisible() )
513 pHelpWin->Invalidate();
514 }
515 }
516 else
517 {
518 // remove help window if no HelpText or
519 // other help mode. but keep it if we are scrolling, ie not requesting help
520 bool bWasVisible = pHelpWin->IsVisible();
521 if ( bWasVisible )
522 bNoDelay = true; // display it quickly if we were already in quick help mode
523 pHelpWin = nullptr;
524 ImplDestroyHelpWindow( bWasVisible );
525 }
526 }
527
528 if (pHelpWin || rHelpText.isEmpty())
529 return;
530
531 sal_uInt64 nCurTime = tools::Time::GetSystemTicks();
532 if ( ( nCurTime - aHelpData.mnLastHelpHideTime ) < o3tl::make_unsigned(HelpSettings::GetTipDelay()) )
533 bNoDelay = true;
534
535 pHelpWin = VclPtr<HelpTextWindow>::Create( pParent, rHelpText, nHelpWinStyle, nStyle );
536 aHelpData.mpHelpWin = pHelpWin;
537 pHelpWin->SetHelpArea( rHelpArea );
538
539 // positioning
540 Size aSz = pHelpWin->CalcOutSize();
541 pHelpWin->SetOutputSizePixel( aSz );
542 ImplSetHelpWindowPos( pHelpWin, nHelpWinStyle, nStyle, rScreenPos, rHelpArea );
543 // if not called from Window::RequestHelp, then without delay...
544 if ( !aHelpData.mbRequestingHelp )
545 bNoDelay = true;
546 pHelpWin->ShowHelp(bNoDelay);
547
548}
549
550void ImplDestroyHelpWindow( bool bUpdateHideTime )
551{
552 ImplDestroyHelpWindow(ImplGetSVHelpData(), bUpdateHideTime);
553}
554
555void ImplDestroyHelpWindow(ImplSVHelpData& rHelpData, bool bUpdateHideTime)
556{
557 VclPtr<HelpTextWindow> pHelpWin = rHelpData.mpHelpWin;
558 if( pHelpWin )
559 {
560 rHelpData.mpHelpWin = nullptr;
561 rHelpData.mbKeyboardHelp = false;
562 pHelpWin->Hide();
563 pHelpWin.disposeAndClear();
564 if( bUpdateHideTime )
566 }
567}
568
569void ImplSetHelpWindowPos( vcl::Window* pHelpWin, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle,
570 const Point& rPos, const tools::Rectangle& rHelpArea )
571{
572 Point aPos = rPos;
573 Size aSz = pHelpWin->GetSizePixel();
574 tools::Rectangle aScreenRect = pHelpWin->ImplGetFrameWindow()->GetDesktopRectPixel();
575 aPos = pHelpWin->GetParent()->ImplGetFrameWindow()->OutputToAbsoluteScreenPixel( aPos );
576 // get mouse screen coords
577 Point aMousePos( pHelpWin->GetParent()->ImplGetFrameWindow()->GetPointerPosPixel() );
578 aMousePos = pHelpWin->GetParent()->ImplGetFrameWindow()->OutputToAbsoluteScreenPixel( aMousePos );
579
580 if ( nHelpWinStyle == HELPWINSTYLE_QUICK )
581 {
582 if ( !(nStyle & QuickHelpFlags::NoAutoPos) )
583 {
584 tools::Long nScreenHeight = aScreenRect.GetHeight();
585 aPos.AdjustX( -4 );
586 if ( aPos.Y() > aScreenRect.Top()+nScreenHeight-(nScreenHeight/4) )
587 aPos.AdjustY( -(aSz.Height()+4) );
588 else
589 aPos.AdjustY(21 );
590 }
591 }
592 else
593 {
594 // If it's the mouse position, move the window slightly
595 // so the mouse pointer does not cover it
596 if ( aPos == aMousePos )
597 {
598 aPos.AdjustX(12 );
599 aPos.AdjustY(16 );
600 }
601 }
602
603 if ( nStyle & QuickHelpFlags::NoAutoPos )
604 {
605 // convert help area to screen coords
606 tools::Rectangle devHelpArea(
609
610 // which position of the rectangle?
611 aPos = devHelpArea.Center();
612
613 if ( nStyle & QuickHelpFlags::Left )
614 aPos.setX( devHelpArea.Left() );
615 else if ( nStyle & QuickHelpFlags::Right )
616 aPos.setX( devHelpArea.Right() );
617
618 if ( nStyle & QuickHelpFlags::Top )
619 aPos.setY( devHelpArea.Top() );
620 else if ( nStyle & QuickHelpFlags::Bottom )
621 aPos.setY( devHelpArea.Bottom() );
622
623 // which direction?
624 if ( nStyle & QuickHelpFlags::Left )
625 ;
626 else if ( nStyle & QuickHelpFlags::Right )
627 aPos.AdjustX( -(aSz.Width()) );
628 else
629 aPos.AdjustX( -(aSz.Width()/2) );
630
631 if ( nStyle & QuickHelpFlags::Top )
632 ;
633 else if ( nStyle & QuickHelpFlags::Bottom )
634 aPos.AdjustY( -(aSz.Height()) );
635 else
636 aPos.AdjustY( -(aSz.Height()/2) );
637 }
638
639 if ( aPos.X() < aScreenRect.Left() )
640 aPos.setX( aScreenRect.Left() );
641 else if ( ( aPos.X() + aSz.Width() ) > aScreenRect.Right() )
642 aPos.setX( aScreenRect.Right() - aSz.Width() );
643 if ( aPos.Y() < aScreenRect.Top() )
644 aPos.setY( aScreenRect.Top() );
645 else if ( ( aPos.Y() + aSz.Height() ) > aScreenRect.Bottom() )
646 aPos.setY( aScreenRect.Bottom() - aSz.Height() );
647
648 if( ! (nStyle & QuickHelpFlags::NoEvadePointer) )
649 {
650 /* the remark below should be obsolete by now as the helpwindow should
651 not be focusable, leaving it as a hint. However it is sensible in most
652 conditions to evade the mouse pointer so the content window is fully visible.
653
654 // the popup must not appear under the mouse
655 // otherwise it would directly be closed due to a focus change...
656 */
657 tools::Rectangle aHelpRect( aPos, aSz );
658 if( aHelpRect.Contains( aMousePos ) )
659 {
660 Point delta(2,2);
661 Point aSize( aSz.Width(), aSz.Height() );
662 Point aTest( aMousePos - aSize - delta );
663 if( aTest.X() > aScreenRect.Left() && aTest.Y() > aScreenRect.Top() )
664 aPos = aTest;
665 else
666 aPos = aMousePos + delta;
667 }
668 }
669
670 vcl::Window* pWindow = pHelpWin->GetParent()->ImplGetFrameWindow();
671 aPos = pWindow->AbsoluteScreenToOutputPixel( aPos );
672 pHelpWin->SetPosPixel( aPos );
673}
674
675/* 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:287
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
const tools::Rectangle & GetHelpArea() const
Definition: helpwin.hxx:71
sal_uInt16 mnHelpWinStyle
Definition: helpwin.hxx:42
void ShowHelp(bool bNoDelay)
Definition: help.cxx:420
virtual ~HelpTextWindow() override
Definition: help.cxx:311
Size CalcOutSize() const
Definition: help.cxx:460
Timer maHideTimer
Definition: helpwin.hxx:40
QuickHelpFlags GetStyle() const
Definition: helpwin.hxx:63
void SetHelpArea(const tools::Rectangle &rRect)
Definition: helpwin.hxx:66
const OUString & GetHelpText() const
Definition: helpwin.hxx:60
QuickHelpFlags mnStyle
Definition: helpwin.hxx:43
void SetHelpText(const OUString &rHelpText)
Definition: help.cxx:326
HelpTextWindow(vcl::Window *pParent, const OUString &rText, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle)
Definition: help.cxx:256
OUString maHelpText
Definition: helpwin.hxx:37
void ImplShow()
Definition: help.cxx:366
virtual void RequestHelp(const HelpEvent &rHEvt) override
Definition: help.cxx:468
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &) override
Definition: help.cxx:374
sal_uInt16 GetWinStyle() const
Definition: helpwin.hxx:62
Timer maShowTimer
Definition: helpwin.hxx:39
virtual OUString GetText() const override
Definition: help.cxx:474
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:191
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:198
static void UpdatePopover(void *nId, vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rText)
Definition: help.cxx:218
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:239
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:171
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:2181
void SetTextAlign(TextAlign eAlign)
Definition: text.cxx:774
void DrawRect(const tools::Rectangle &rRect)
Definition: rect.cxx:51
void SetLineColor()
Definition: line.cxx:37
void SetTextColor(const Color &rColor)
Definition: text.cxx:716
vcl::text::ComplexTextLayoutFlags GetLayoutMode() const
Definition: outdev.hxx:491
void SetFillColor()
Definition: fill.cxx:29
const Color & GetLineColor() const
Definition: outdev.hxx:511
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:289
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
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:590
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:276
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:2867
Point OutputToScreenPixel(const Point &rPos) const
Definition: window.cxx:2808
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:1121
void PaintImmediately()
Definition: paint.cxx:1268
tools::Rectangle GetDesktopRectPixel() const
Definition: window.cxx:2801
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:1298
const AllSettings & GetSettings() const
Definition: window3.cxx:129
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Definition: window.cxx:2189
::OutputDevice const * GetOutDev() const
Definition: window.cxx:567
void Hide()
Definition: window.hxx:885
SalFrame * ImplGetFrame() const
Definition: window2.cxx:867
virtual Size GetSizePixel() const
Definition: window.cxx:2404
Size GetOutputSizePixel() const
Definition: window3.cxx:89
Point GetPointerPosPixel()
Definition: mouse.cxx:564
void SetPointFont(vcl::RenderContext &rRenderContext, const vcl::Font &rFont)
Definition: window.cxx:2175
void SetPaintTransparent(bool bTransparent)
Definition: paint.cxx:1025
bool IsVisible() const
Definition: window2.cxx:1126
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Definition: paint.cxx:1143
virtual void SetPosPixel(const Point &rNewPos)
Definition: window2.cxx:1281
Point OutputToAbsoluteScreenPixel(const Point &rPos) const
Definition: window.cxx:2857
void SetType(WindowType nType)
Definition: window2.cxx:992
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
Definition: window2.cxx:925
void EnableChildTransparentMode(bool bEnable=true)
Definition: window2.cxx:1046
SAL_DLLPRIVATE void ImplSetMouseTransparent(bool bTransparent)
Definition: window2.cxx:955
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:441
#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:569
#define HELPTEXTMARGIN_QUICK
Definition: help.cxx:40
void ImplDestroyHelpWindow(bool bUpdateHideTime)
Definition: help.cxx:550
#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:479
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:402
VclPtr< WorkWindow > mpAppWin
Definition: svdata.hxx:247
bool mbRequestingHelp
Definition: svdata.hxx:306
VclPtr< HelpTextWindow > mpHelpWin
Definition: svdata.hxx:307
sal_uInt64 mnLastHelpHideTime
Definition: svdata.hxx:308
bool mbKeyboardHelp
Definition: svdata.hxx:305
bool mbOldBalloonMode
Definition: svdata.hxx:301
bool mbExtHelpMode
Definition: svdata.hxx:300
bool mbBalloonHelp
Definition: svdata.hxx:302
bool mbQuickHelp
Definition: svdata.hxx:303
bool mbContextHelp
Definition: svdata.hxx:298
bool mbExtHelp
Definition: svdata.hxx:299
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:76
ImplSVHelpData & ImplGetSVHelpData()
Definition: svdata.cxx:479
WinBits const WB_SYSTEMWINDOW
Definition: wintypes.hxx:126
WinBits const WB_TOOLTIPWIN
Definition: wintypes.hxx:172