17#include <officecfg/Office/UI/Infobar.hxx>
22#include <sfx2/sfxsids.hrc>
30#include <bitmaps.hlst>
37using namespace css::frame;
81 aRet =
"vcl/res/infobox.png";
84 aRet =
"vcl/res/successbox.png";
87 aRet =
"vcl/res/warningbox.png";
90 aRet =
"vcl/res/errorbox.png";
105 xDevice->SetOutputSizePixel(aSize);
110 const std::unique_ptr<BaseProcessor2D> pProcessor(
113 const ::tools::Rectangle aRect(aBtnPos, xDevice->PixelToLogic(aSize));
146 pProcessor->process(
aSeq);
193 const OUString& sPrimaryMessage,
194 const OUString& sSecondaryMessage,
InfobarType ibType,
195 bool bShowCloseButton)
199 , m_bLayingOut(false)
200 , m_xImage(m_xBuilder->weld_image(
"image"))
201 , m_xPrimaryMessage(m_xBuilder->weld_label(
"primary"))
202 , m_xSecondaryMessage(m_xBuilder->weld_text_view(
"secondary"))
203 , m_xButtonBox(m_xBuilder->weld_container(
"buttonbox"))
204 , m_xCloseBtn(m_xBuilder->weld_toolbar(
"closebar"))
210 m_xImage->set_from_icon_name(GetInfoBarIconName(ibType));
213 if (!sPrimaryMessage.isEmpty())
224 if (bShowCloseButton)
243 if (m_aMessageSize != rSize)
245 m_aMessageSize = rSize;
272 return aSizeForWidth;
351 , m_pChildWin(pChildWin)
352 , m_aLayoutIdle(
"SfxInfoBarContainerWindow m_aLayoutIdle")
366 infoBar.disposeAndClear();
372 const OUString& sPrimaryMessage,
373 const OUString& sSecondaryMessage,
375 bool bShowCloseButton)
381 ibType, bShowCloseButton);
386 GetInfoBarColors(ibType, aBackgroundColor, aForegroundColor, aMessageColor);
387 pInfoBar->m_aBackgroundColor = aBackgroundColor;
388 pInfoBar->m_aForegroundColor = aForegroundColor;
399 if (infoBar->getId() ==
sId)
416 it->disposeAndClear();
425 if (
sId ==
u"readonly")
426 return officecfg::Office::UI::Infobar::Enabled::Readonly::get();
427 if (
sId ==
u"signature")
428 return officecfg::Office::UI::Infobar::Enabled::Signature::get();
429 if (
sId ==
u"donate")
430 return officecfg::Office::UI::Infobar::Enabled::Donate::get();
431 if (
sId ==
u"getinvolved")
432 return officecfg::Office::UI::Infobar::Enabled::GetInvolved::get();
433 if (
sId ==
u"hyphenationmissing")
434 return officecfg::Office::UI::Infobar::Enabled::HyphenationMissing::get();
435 if (
sId ==
u"whatsnew")
436 return officecfg::Office::UI::Infobar::Enabled::WhatsNew::get();
437 if (
sId ==
u"hiddentrackchanges")
438 return officecfg::Office::UI::Infobar::Enabled::HiddenTrackChanges::get();
440 return officecfg::Office::UI::Infobar::Enabled::MacrosDisabled::get();
454 auto nOrigWidth = rOrigSize.
getWidth();
455 auto nOrigHeight = rOrigSize.
getHeight();
461 Size aOrigSize = rxInfoBar->GetSizePixel();
464 Point aPos(0, nHeight);
466 rxInfoBar->SetPosSizePixel(aPos, aSize);
470 aSize = rxInfoBar->DoLayout();
471 rxInfoBar->SetPosSizePixel(aPos, aSize);
478 if (nOrigHeight != nHeight)
492 , m_pBindings(pBindings)
514 Size aSize(pChild->GetSizePixel());
516 if (aSize == pChild->GetSizePixel())
521 const sal_uInt16
nId = GetChildWindowId();
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
basegfx::BColor getBColor() const
virtual void Start(bool bStartTimer=true) override
Size GetSizePixel() const
virtual void Resize() override
virtual void dispose() override
std::unique_ptr< weld::Container > m_xContainer
void InitControlBase(weld::Widget *pWidget)
SfxDispatcher * GetDispatcher() const
void SetAlignment(SfxChildAlignment eAlign)
vcl::Window * GetWindow() const
virtual SfxChildWinInfo GetInfo() const
void SetWindow(const VclPtr< vcl::Window > &p)
SfxViewFrame * GetFrame() const
Returns a pointer to the <SfxViewFrame> instance, which belongs to this SfxDispatcher.
SfxChildWindow for positioning the InfoBar in the view.
virtual ~SfxInfoBarContainerChild() override
SfxInfoBarContainerChild(vcl::Window *pParent, sal_uInt16 nId, SfxBindings *pBindings, SfxChildWinInfo *pInfo)
SfxBindings * m_pBindings
VclPtr< SfxInfoBarWindow > appendInfoBar(const OUString &sId, const OUString &sPrimaryMessage, const OUString &sSecondaryMessage, InfobarType ibType, bool bShowCloseButton)
std::vector< VclPtr< SfxInfoBarWindow > > m_pInfoBars
void TriggerUpdateLayout()
SfxInfoBarContainerWindow(SfxInfoBarContainerChild *pChildWin)
virtual ~SfxInfoBarContainerWindow() override
SfxInfoBarContainerChild * m_pChildWin
static bool isInfobarEnabled(std::u16string_view sId)
virtual void Resize() override
virtual void dispose() override
bool hasInfoBarWithID(std::u16string_view sId)
void removeInfoBar(VclPtr< SfxInfoBarWindow > const &pInfoBar)
VclPtr< SfxInfoBarWindow > getInfoBar(std::u16string_view sId)
Class representing a single InfoBar to be added in a SfxInfoBarContainerWindow.
std::unique_ptr< weld::Image > m_xImage
virtual void dispose() override
void SetForeAndBackgroundColors(InfobarType eType)
weld::Button & addButton(const OUString *pCommand=nullptr)
Add button to Infobar.
virtual void Layout() override
std::unique_ptr< weld::TextView > m_xSecondaryMessage
void Update(const OUString &sPrimaryMessage, const OUString &sSecondaryMessage, InfobarType eType)
std::unique_ptr< weld::Toolbar > m_xCloseBtn
basegfx::BColor m_aForegroundColor
std::unique_ptr< weld::Label > m_xPrimaryMessage
void SetCloseButtonImage()
virtual ~SfxInfoBarWindow() override
std::vector< std::unique_ptr< ExtraButton > > m_aActionBtns
SfxInfoBarWindow(vcl::Window *parent, OUString sId, const OUString &sPrimaryMessage, const OUString &sSecondaryMessage, InfobarType InfobarType, bool bShowCloseButton)
std::unique_ptr< weld::Container > m_xButtonBox
basegfx::BColor m_aBackgroundColor
vcl::Window & GetWindow() const
void ShowChildWindow(sal_uInt16, bool bVisible=true)
constexpr tools::Long getHeight() const
constexpr tools::Long Height() const
constexpr tools::Long getWidth() const
constexpr tools::Long Width() const
const Color & GetDialogTextColor() const
bool GetHighContrastMode() const
const Color & GetLightColor() const
void SetPriority(TaskPriority ePriority)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
static VclPtr< reference_type > Create(Arg &&... arg)
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
void append(const basegfx::B2DPoint &rPoint, sal_uInt32 nCount)
void setClosed(bool bNew)
void SetStyle(WinBits nStyle)
virtual void SetSizePixel(const Size &rNewSize)
Size get_preferred_size() const
void GrabFocusToDocument()
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
virtual Size GetSizePixel() const
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
void EnableChildTransparentMode(bool bEnable=true)
const EnumerationType m_eType
IMPL_LINK_NOARG(ExtraButton, CommandHdl, weld::Button &, void)
SFX_IMPL_POS_CHILDWINDOW_WITHID(SfxInfoBarContainerChild, SID_INFOBAR, SFX_OBJECTBAR_OBJECT)
IMPL_LINK(SfxInfoBarWindow, SizeAllocHdl, const Size &, rSize, void)
#define LINK(Instance, Class, Member)
Sequence< sal_Int8 > aSeq
bool dispatchCommand(const OUString &rCommand, const uno::Reference< css::frame::XFrame > &rFrame, const css::uno::Sequence< css::beans::PropertyValue > &rArguments, const uno::Reference< css::frame::XDispatchResultListener > &rListener)
std::unique_ptr< BaseProcessor2D > createProcessor2DFromOutputDevice(OutputDevice &rTargetOutDev, const drawinglayer::geometry::ViewInformation2D &rViewInformation2D)
#define SFX_OBJECTBAR_OBJECT
WinBits const WB_DIALOGCONTROL