From c434fc0d181f098a179c6dc9d1506fa806d579f1 Mon Sep 17 00:00:00 2001 From: Samuel Mehrbrodt Date: Tue, 19 Nov 2019 09:18:11 +0100 Subject: tdf#128191 Show infobar when hyphenation info for text language is missing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit During doc loading it's too early to add infobars, thus add a mechanism to display infobars once view is ready Change-Id: Ie963a304d2101a5bbdd59130c354d581ff7d2e9b Reviewed-on: https://gerrit.libreoffice.org/84634 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- include/sfx2/infobar.hxx | 10 ++++++++++ include/sfx2/objsh.hxx | 9 +++++++++ 2 files changed, 19 insertions(+) (limited to 'include') diff --git a/include/sfx2/infobar.hxx b/include/sfx2/infobar.hxx index a0dcdbd00f1d..80f4c0a0506c 100644 --- a/include/sfx2/infobar.hxx +++ b/include/sfx2/infobar.hxx @@ -26,6 +26,16 @@ enum class InfobarType { DANGER = 3 }; +class InfobarData +{ + public: + OUString msId; + OUString msPrimaryMessage; + OUString msSecondaryMessage; + InfobarType maInfobarType; + bool mbShowCloseButton; +}; + /** SfxChildWindow for positioning the InfoBar in the view. */ class SFX2_DLLPUBLIC SfxInfoBarContainerChild final : public SfxChildWindow diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index d9d184383430..0352f2f1ac2a 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -62,9 +62,11 @@ class OutputDevice; class Color; class Fraction; class SvGlobalName; +class InfobarData; enum class SfxModelFlags; enum class SfxEventHintId; +enum class InfobarType; // These values presumably must match exactly the corresponding // css::embed::Aspects ones (in offapi/com/sun/star/embed/Aspects.idl) @@ -651,6 +653,13 @@ public: static bool IsOwnStorageFormat(const SfxMedium &); + /** Append Infobar once the frame is ready. + Useful when you want to register an Infobar before the doc/frame is fully loaded. */ + void AppendInfoBarWhenReady(const OUString& sId, const OUString& sPrimaryMessage, + const OUString& sSecondaryMessage, InfobarType aInfobarType, + bool bShowCloseButton = true); + std::vector& getPendingInfobars(); + SAL_DLLPRIVATE std::shared_ptr CreatePreviewMetaFile_Impl(bool bFullContent) const; SAL_DLLPRIVATE static bool IsPackageStorageFormat_Impl(const SfxMedium &); -- cgit v1.2.3