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,
190 rHelpText, aScreenPos, rScreenRect );
196 bool const bIsVisible = ( pHelpWin != nullptr ) && pHelpWin->
IsVisible();
216 pHelpWin->ShowHelp(
true);
221 const OUString& rText)
261 maShowTimer(
"vcl::HelpTextWindow maShowTimer" ),
262 maHideTimer(
"vcl::HelpTextWindow maHideTimer" )
276 Window::SetHelpText( rText );
344 sal_Int32 nCharsInLine = 35 + ((
maHelpText.getLength()/100)*5);
346 OUStringBuffer
aBuf(nCharsInLine);
349 Size aTmpSize( nWidth, 0x7FFFFFFF );
381 bool bNativeOK =
false;
447 if ( pTimer == &maShowTimer )
454 SAL_WARN_IF( pTimer != &maHideTimer,
"vcl",
"HelpTextWindow::TimerHdl with bad Timer" );
489 const OUString& rHelpText,
503 bool bNoDelay =
false;
506 SAL_WARN_IF( pHelpWin == pParent,
"vcl",
"HelpInHelp ?!" );
508 bool bRemoveHelp = (rHelpText.isEmpty() || (pHelpWin->GetWinStyle() != nHelpWinStyle))
511 if (!bRemoveHelp && pHelpWin->GetParent() == pParent)
513 bool const bUpdate = (pHelpWin->GetHelpText() != rHelpText) ||
517 pHelpWin->SetHelpText( rHelpText );
520 if( pHelpWin->IsVisible() )
521 pHelpWin->Invalidate();
523 pHelpWin->ResetHideTimer();
529 bool bWasVisible = pHelpWin->IsVisible();
535 if (rHelpText.isEmpty())
577 if( bUpdateHideTime )
600 aPos = devHelpArea.
Center();
608 aPos.
setY( devHelpArea.
Top() );
634 if ( aPos.
Y() > aScreenRect.
Top()+nScreenHeight-(nScreenHeight/4) )
643 if ( aPos == aMousePos )
651 if ( aPos.
X() < aScreenRect.
Left() )
653 else if ( ( aPos.
X() + aSz.
Width() ) > aScreenRect.
Right() )
655 if ( aPos.
Y() < aScreenRect.
Top() )
656 aPos.
setY( aScreenRect.
Top() );
657 else if ( ( aPos.
Y() + aSz.
Height() ) > aScreenRect.
Bottom() )
670 if( aHelpRect.
Contains( aMousePos ) )
674 Point aTest( aMousePos - aSize - delta );
675 if( aTest.
X() > aScreenRect.
Left() && aTest.
Y() > aScreenRect.
Top() )
678 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.
sal_uInt16 mnHelpWinStyle
void ShowHelp(bool bNoDelay)
virtual ~HelpTextWindow() override
QuickHelpFlags GetStyle() const
void SetHelpArea(const tools::Rectangle &rRect)
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.
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 *)
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)
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