20#include <rtl/ustrbuf.hxx>
28#include <bitmaps.hlst>
32#define TIP_RIGHT_OFFSET 18
33#define BUBBLE_BORDER 10
34#define TEXT_MAX_WIDTH 300
35#define TEXT_MAX_HEIGHT 200
38 OUString aText,
Image aImage )
43 , maBubbleTitle(
std::move( aTitle ))
44 , maBubbleText(
std::move( aText ))
45 , maBubbleImage(
std::move( aImage ))
58 if ( ( aSize.
Height() < 20 ) || ( aSize.
Width() < 60 ) )
68 aPointArr[1] =
Point( nTipOffset, 0 );
74 aRegion.
Union( aTriRegion);
81 const OUString& rText,
167 if ( aScreenPos.
X() < 0 )
180 bool bFinished =
false;
219 : maTimeoutTimer(
"MenuBarUpdateIconManager")
220 , maWaitIdle(
"vcl MenuBarUpdateIconManager maWaitIdle")
221 , mbShowMenuIcon(false)
222 , mbShowBubble(false)
223 , mbBubbleChanged( false )
269 pBubbleWin->SetTipPosPixel( aWinPos );
276 RemoveBubbleWindow();
285 if (mpActiveSysWin == rEvent.GetWindow())
287 RemoveBubbleWindow();
288 mpActiveSysWin =
nullptr;
289 mpActiveMBar =
nullptr;
299 AddMenuBarIcon(*pSysWin,
false);
307 if (pMBar == mpActiveMBar)
309 RemoveBubbleWindow();
310 mpActiveMBar =
nullptr;
312 RemoveMenuBarIcon(pMBar);
318 if ( mpActiveSysWin == rEvent.GetWindow() &&
319 mpBubbleWin && mpActiveMBar )
321 tools::Rectangle aIconRect = mpActiveMBar->GetMenuBarButtonRectPixel(GetIconID(mpActiveMBar));
323 mpBubbleWin->SetTipPosPixel( aWinPos );
324 if ( mpBubbleWin->IsVisible() )
332 switch (rEvent.GetId())
344 AddMenuBarIcon(*pSysWin,
true);
360 pBubbleWin = mpBubbleWin;
362 if ( pActiveWin && ( pActiveWin != pBubbleWin ) && pActiveWin->
IsTopWindow() )
365 if ( pActiveWin == pBubbleWin )
366 pActiveSysWin =
nullptr;
368 while ( !pActiveSysWin && pTopWin )
370 if ( ( pTopWin != pBubbleWin ) && pTopWin->
IsTopWindow() )
372 if ( !pActiveSysWin )
377 AddMenuBarIcon(*pActiveSysWin,
true);
384 mpBubbleWin->Show(
false );
386 maClickHdl.Call(
nullptr);
393 if ( rData.bHighlight )
396 RemoveBubbleWindow();
403 mpBubbleWin = GetBubbleWindow();
485 sal_uInt32 nMBarHeight = 20;
490 if (nMBarHeight >= 35)
491 sResID = RID_UPDATE_AVAILABLE_26;
493 sResID = RID_UPDATE_AVAILABLE_16;
519 aBuf.append(
"\n\n" );
523 Image aImage = GetMenuBarIcon( pActiveMBar );
526 aBuf.makeStringAndClear() );
IMPL_LINK_NOARG(MenuBarUpdateIconManager, TimeOutHdl, Timer *, void)
IMPL_LINK(MenuBarUpdateIconManager, WindowEventHdl, VclWindowEvent &, rEvent, void)
static void AddEventListener(const Link< VclSimpleEvent &, void > &rEventListener)
Add a VCL event listener to the application.
static vcl::Window * GetNextTopLevelWindow(vcl::Window const *pWindow)
Get the next top level window.
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
Post a user event to the default window.
static void RemoveEventListener(const Link< VclSimpleEvent &, void > &rEventListener)
Remove a VCL event listener from the application.
static vcl::Window * GetActiveTopWindow()
Get the "active" top window.
static vcl::Window * GetFirstTopLevelWindow()
Get the first top-level window of the application.
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
void Show(bool bVisible=true)
BubbleWindow(vcl::Window *pParent, OUString aTitle, OUString aText, Image aImage)
tools::Rectangle maTextRect
void SetTitleAndText(const OUString &rTitle, const OUString &rText, const Image &rImage)
tools::Rectangle maTitleRect
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
tools::Polygon maRectPoly
Size GetSizePixel() const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
void DrawPolyLine(const tools::Polygon &rPoly)
Render the given polygon as a line stroke.
void DrawLine(const Point &rStartPt, const Point &rEndPt)
void DrawImage(const Point &rPos, const Image &rImage, DrawImageFlags nStyle=DrawImageFlags::NONE)
This is an overloaded member function, provided for convenience. It differs from the above function o...
const Color & GetLineColor() const
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)
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
constexpr tools::Long getHeight() const
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
MenuBar * GetMenuBar() const
virtual void Resize() override
void SetPriority(TaskPriority ePriority)
void SetTimeout(sal_uInt64 nTimeoutMs)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
virtual void Start(bool bStartTimer=true) override
Schedules the task for execution.
static VclPtr< reference_type > Create(Arg &&... arg)
A construction helper for VclPtr.
tools::Long GetFontHeight() const
void SetWeight(FontWeight)
void Union(const tools::Rectangle &rRegion)
tools::Rectangle GetTextRect(const tools::Rectangle &rRect, const OUString &rStr, DrawTextFlags nStyle=DrawTextFlags::WordBreak, TextRectInfo *pInfo=nullptr, const vcl::ITextLayout *_pTextLayout=nullptr) const
void SetFont(const vcl::Font &rNewFont)
vcl::Window * GetParent() const
vcl::Window * GetWindow(GetWindowType nType) const
const AllSettings & GetSettings() const
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
const vcl::Font & GetFont() const
SystemWindow * GetSystemWindow() const
void AddEventListener(const Link< VclWindowEvent &, void > &rEventListener)
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
void SetWindowRegionPixel()
Point OutputToAbsoluteScreenPixel(const Point &rPos) const
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
#define LINK(Instance, Class, Member)
@ LOWEST
Low, very idle cleanup tasks.
WinBits const WB_OWNERDRAWDECORATION
WinBits const WB_SYSTEMWINDOW
WinBits const WB_NOBORDER