37#define HELPWINSTYLE_QUICK 0
38#define HELPWINSTYLE_BALLOON 1
40#define HELPTEXTMARGIN_QUICK 3
41#define HELPTEXTMARGIN_BALLOON 6
43#define HELPTEXTMAXLEN 150
159 const OUString& rHelpText )
162 rHelpText, rScreenPos, rRect );
182 const OUString& rHelpText,
194 bool const bIsVisible = ( pHelpWin != nullptr ) && pHelpWin->
IsVisible();
214 pHelpWin->ShowHelp(
true);
219 const OUString& rText)
259 maShowTimer(
"vcl::HelpTextWindow maShowTimer" ),
260 maHideTimer(
"vcl::HelpTextWindow maHideTimer" )
274 Window::SetHelpText( rText );
342 sal_Int32 nCharsInLine = 35 + ((
maHelpText.getLength()/100)*5);
344 OUStringBuffer
aBuf(nCharsInLine);
347 Size aTmpSize( nWidth, 0x7FFFFFFF );
377 bool bNativeOK =
false;
443 if ( pTimer == &maShowTimer )
455 SAL_WARN_IF( pTimer != &maHideTimer,
"vcl",
"HelpTextWindow::TimerHdl with bad Timer" );
480 const OUString& rHelpText,
495 bool bNoDelay =
false;
498 SAL_WARN_IF( pHelpWin == pParent,
"vcl",
"HelpInHelp ?!" );
500 bool bRemoveHelp = (rHelpText.isEmpty() || (pHelpWin->
GetWinStyle() != nHelpWinStyle))
503 if (!bRemoveHelp && pHelpWin->
GetParent() == pParent)
505 bool const bUpdate = (pHelpWin->
GetHelpText() != rHelpText) ||
520 bool bWasVisible = pHelpWin->
IsVisible();
528 if (pHelpWin || rHelpText.isEmpty())
564 if( bUpdateHideTime )
586 if ( aPos.Y() > aScreenRect.
Top()+nScreenHeight-(nScreenHeight/4) )
587 aPos.AdjustY( -(aSz.
Height()+4) );
596 if ( aPos == aMousePos )
611 aPos = devHelpArea.
Center();
614 aPos.setX( devHelpArea.
Left() );
616 aPos.setX( devHelpArea.
Right() );
619 aPos.setY( devHelpArea.
Top() );
621 aPos.setY( devHelpArea.
Bottom() );
627 aPos.AdjustX( -(aSz.
Width()) );
629 aPos.AdjustX( -(aSz.
Width()/2) );
634 aPos.AdjustY( -(aSz.
Height()) );
636 aPos.AdjustY( -(aSz.
Height()/2) );
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() )
658 if( aHelpRect.
Contains( aMousePos ) )
662 Point aTest( aMousePos - aSize - delta );
663 if( aTest.X() > aScreenRect.
Left() && aTest.Y() > aScreenRect.
Top() )
666 aPos = aMousePos + delta;
const HelpSettings & GetHelpSettings() const
const StyleSettings & GetStyleSettings() const
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
static sal_Int32 GetBalloonDelay()
sal_Int32 GetTipTimeout() const
static sal_Int32 GetTipDelay()
A tooltip: adds tips to widgets in a floating / popup window.
tools::Rectangle maTextRect
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
const tools::Rectangle & GetHelpArea() const
sal_uInt16 mnHelpWinStyle
void ShowHelp(bool bNoDelay)
virtual ~HelpTextWindow() override
QuickHelpFlags GetStyle() const
void SetHelpArea(const tools::Rectangle &rRect)
const OUString & GetHelpText() const
void SetHelpText(const OUString &rHelpText)
HelpTextWindow(vcl::Window *pParent, const OUString &rText, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle)
virtual void RequestHelp(const HelpEvent &rHEvt) override
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &) override
sal_uInt16 GetWinStyle() const
virtual OUString GetText() const override
virtual bool Start(const OUString &rHelpId, weld::Widget *pWidget=nullptr)
static bool StartExtHelp()
static void EnableQuickHelp()
static bool IsQuickHelpEnabled()
static void DisableBalloonHelp()
virtual void SearchKeyword(const OUString &rKeyWord)
static void EnableBalloonHelp()
static void HideBalloonAndQuickHelp()
static void DisableExtHelp()
static bool IsContextHelpEnabled()
virtual OUString GetHelpText(const OUString &aHelpURL, const weld::Widget *pWidget)
static bool IsExtHelpEnabled()
static void DisableQuickHelp()
static void EnableContextHelp()
static void EnableExtHelp()
static bool IsBalloonHelpEnabled()
static void * ShowPopover(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rText, QuickHelpFlags nStyle)
static void UpdatePopover(void *nId, vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rText)
static void ShowQuickHelp(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rHelpText, QuickHelpFlags nStyle=QuickHelpFlags::NONE)
static void HidePopover(vcl::Window const *pParent, void *nId)
static void DisableContextHelp()
static void ShowBalloon(vcl::Window *pParent, const Point &rScreenPos, const tools::Rectangle &, const OUString &rHelpText)
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
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)
void SetTextAlign(TextAlign eAlign)
void DrawRect(const tools::Rectangle &rRect)
void SetTextColor(const Color &rColor)
vcl::text::ComplexTextLayoutFlags GetLayoutMode() const
const Color & GetLineColor() const
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)
void SetLayoutMode(vcl::text::ComplexTextLayoutFlags nTextLayoutMode)
const AllSettings & GetSettings() const
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
virtual bool HidePopover(void *)
virtual bool UpdatePopover(void *, const OUString &, vcl::Window *, const tools::Rectangle &)
virtual void * ShowPopover(const OUString &, vcl::Window *, const tools::Rectangle &, QuickHelpFlags)
virtual bool ShowTooltip(const OUString &, const tools::Rectangle &)
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 SetTimeout(sal_uInt64 nTimeoutMs)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual void Start(bool bStartTimer=true) override
Schedules the task for execution.
A construction helper for a temporary VclPtr.
reference_type * get() const
Get the body.
static VclPtr< reference_type > Create(Arg &&... arg)
A construction helper for VclPtr.
Point AbsoluteScreenToOutputPixel(const Point &rPos) const
Point OutputToScreenPixel(const Point &rPos) const
tools::Rectangle GetTextRect(const tools::Rectangle &rRect, const OUString &rStr, DrawTextFlags nStyle=DrawTextFlags::WordBreak, TextRectInfo *pInfo=nullptr, const vcl::ITextLayout *_pTextLayout=nullptr) const
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.
SAL_DLLPRIVATE void ImplUpdateAll()
vcl::Window * GetParent() const
tools::Rectangle GetDesktopRectPixel() const
SAL_DLLPRIVATE void ImplGenerateMouseMove()
void SetParentClipMode(ParentClipMode nMode=ParentClipMode::NONE)
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
virtual void SetOutputSizePixel(const Size &rNewSize)
const AllSettings & GetSettings() const
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
::OutputDevice const * GetOutDev() const
SalFrame * ImplGetFrame() const
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
Point GetPointerPosPixel()
void SetPointFont(vcl::RenderContext &rRenderContext, const vcl::Font &rFont)
void SetPaintTransparent(bool bTransparent)
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
virtual void SetPosPixel(const Point &rNewPos)
Point OutputToAbsoluteScreenPixel(const Point &rPos) const
void SetType(WindowType nType)
SAL_DLLPRIVATE vcl::Window * ImplGetFrameWindow() const
void EnableChildTransparentMode(bool bEnable=true)
SAL_DLLPRIVATE void ImplSetMouseTransparent(bool bTransparent)
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)
IMPL_LINK(HelpTextWindow, TimerHdl, Timer *, pTimer, void)
#define HELPWINSTYLE_BALLOON
#define HELPTEXTMARGIN_BALLOON
void ImplSetHelpWindowPos(vcl::Window *pHelpWin, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle, const Point &rPos, const tools::Rectangle &rHelpArea)
#define HELPTEXTMARGIN_QUICK
void ImplDestroyHelpWindow(bool bUpdateHideTime)
#define HELPWINSTYLE_QUICK
void ImplShowHelpWindow(vcl::Window *pParent, sal_uInt16 nHelpWinStyle, QuickHelpFlags nStyle, const OUString &rHelpText, const Point &rScreenPos, const tools::Rectangle &rHelpArea)
@ TipStyleBalloon
force balloon-style in ShowPopover and ShowQuickHelp
#define LINK(Instance, Class, Member)
#define SAL_WARN_IF(condition, area, stream)
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)
ImplSVFrameData maFrameData
VclPtr< WorkWindow > mpAppWin
VclPtr< HelpTextWindow > mpHelpWin
sal_uInt64 mnLastHelpHideTime
ImplSVData * ImplGetSVData()
ImplSVHelpData & ImplGetSVHelpData()
WinBits const WB_SYSTEMWINDOW
WinBits const WB_TOOLTIPWIN