diff options
Diffstat (limited to 'include/sfx2')
-rw-r--r-- | include/sfx2/classificationhelper.hxx | 2 | ||||
-rw-r--r-- | include/sfx2/infobar.hxx | 38 | ||||
-rw-r--r-- | include/sfx2/sfxbasecontroller.hxx | 13 | ||||
-rw-r--r-- | include/sfx2/viewfrm.hxx | 13 |
4 files changed, 44 insertions, 22 deletions
diff --git a/include/sfx2/classificationhelper.hxx b/include/sfx2/classificationhelper.hxx index b372c8df20fd..ed55fe9c04ca 100644 --- a/include/sfx2/classificationhelper.hxx +++ b/include/sfx2/classificationhelper.hxx @@ -73,7 +73,7 @@ public: OUString GetHigherClass(const OUString& first, const OUString& second); /// If GetImpactScale() and GetImpactLevel*() will return something meaningful. bool HasImpactLevel(); - InfoBarType GetImpactLevelType(); + InfobarType GetImpactLevelType(); /// Larger value means more confidential. sal_Int32 GetImpactLevel(); /// Comparing the GetImpactLevel() result is only meaningful when the impact scale is the same. diff --git a/include/sfx2/infobar.hxx b/include/sfx2/infobar.hxx index 4543189c0373..a0dcdbd00f1d 100644 --- a/include/sfx2/infobar.hxx +++ b/include/sfx2/infobar.hxx @@ -18,11 +18,12 @@ #include <sfx2/dllapi.h> #include <sfx2/childwin.hxx> -enum class InfoBarType { - Info, - Success, - Warning, - Danger +// These must match the values in offapi/com/sun/star/frame/InfobarType.idl +enum class InfobarType { + INFO = 0, + SUCCESS = 1, + WARNING = 2, + DANGER = 3 }; /** SfxChildWindow for positioning the InfoBar in the view. @@ -50,27 +51,30 @@ class SFX2_DLLPUBLIC SfxInfoBarWindow final : public vcl::Window { private: OUString const m_sId; - InfoBarType m_eType; + InfobarType m_eType; VclPtr<FixedImage> m_pImage; - VclPtr<FixedText> m_pMessage; + VclPtr<FixedText> m_pPrimaryMessage; + VclPtr<FixedText> m_pSecondaryMessage; VclPtr<Button> m_pCloseBtn; std::vector< VclPtr<PushButton> > m_aActionBtns; - void SetForeAndBackgroundColors( InfoBarType eType ); + void SetForeAndBackgroundColors( InfobarType eType ); public: SfxInfoBarWindow( vcl::Window* parent, const OUString& sId, - const OUString& sMessage, - InfoBarType infoBarType, - WinBits nMessageStyle); + const OUString& sPrimaryMessage, + const OUString& sSecondaryMessage, + InfobarType InfobarType, + bool bShowCloseButton, WinBits nMessageStyle); virtual ~SfxInfoBarWindow( ) override; virtual void dispose() override; const OUString& getId() const { return m_sId; } virtual void Paint( vcl::RenderContext& rRenderContext, const tools::Rectangle& ) override; virtual void Resize( ) override; - void Update( const OUString& sNewMessage, InfoBarType eType ); - basegfx::BColor m_aBackgroundColor; + void Update(const OUString& sPrimaryMessage, const OUString& sSecondaryMessage, + InfobarType eType); + basegfx::BColor m_aBackgroundColor; basegfx::BColor m_aForegroundColor; /** Add button to Infobar. @@ -95,9 +99,11 @@ class SfxInfoBarContainerWindow final : public vcl::Window virtual void dispose() override; VclPtr<SfxInfoBarWindow> appendInfoBar(const OUString& sId, - const OUString& sMessage, - InfoBarType ibType, - WinBits nMessageStyle); + const OUString& sPrimaryMessage, + const OUString& sSecondaryMessage, + InfobarType ibType, + WinBits nMessageStyle, + bool bShowCloseButton); VclPtr<SfxInfoBarWindow> getInfoBar(const OUString& sId); bool hasInfoBarWithID(const OUString& sId); void removeInfoBar(VclPtr<SfxInfoBarWindow> const & pInfoBar); diff --git a/include/sfx2/sfxbasecontroller.hxx b/include/sfx2/sfxbasecontroller.hxx index 4b7237fd4386..95a082cdae32 100644 --- a/include/sfx2/sfxbasecontroller.hxx +++ b/include/sfx2/sfxbasecontroller.hxx @@ -28,6 +28,7 @@ #include <com/sun/star/frame/XDispatchInformationProvider.hpp> #include <com/sun/star/frame/XController2.hpp> #include <com/sun/star/frame/XControllerBorder.hpp> +#include <com/sun/star/frame/XInfobarProvider.hpp> #include <com/sun/star/frame/XTitle.hpp> #include <com/sun/star/frame/XTitleChangeBroadcaster.hpp> #include <com/sun/star/lang/XInitialization.hpp> @@ -70,6 +71,7 @@ typedef ::cppu::WeakImplHelper < css::frame::XController2 , css::ui::XContextMenuInterception , css::awt::XUserInputInterception , css::frame::XDispatchInformationProvider + , css::frame::XInfobarProvider , css::frame::XTitle , css::frame::XTitleChangeBroadcaster , css::lang::XInitialization @@ -175,6 +177,17 @@ public: // css::lang::XInitialization virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override; + // XInfobarProvider + virtual void SAL_CALL + appendInfobar(const OUString& sId, const OUString& sPrimaryMessage, + const OUString& sSecondaryMessage, sal_Int32 aInfobarType, + const css::uno::Sequence<css::beans::StringPair>& actionButtons, + sal_Bool bShowCloseButton) override; + virtual void SAL_CALL updateInfobar(const OUString& sId, const OUString& sPrimaryMessage, + const OUString& sSecondaryMessage, + sal_Int32 aInfobarType) override; + virtual void SAL_CALL removeInfobar(const OUString& sId) override; + // FIXME: TL needs this in sw/source/ui/uno/unotxdoc.cxx now; // either the _Impl name should vanish or there should be an "official" API SfxViewShell* GetViewShell_Impl() const; diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx index 0b65d90857fd..fe336ba5f091 100644 --- a/include/sfx2/viewfrm.hxx +++ b/include/sfx2/viewfrm.hxx @@ -39,7 +39,7 @@ class Point; class Size; class SfxChildWindow; class SfxInfoBarWindow; -enum class InfoBarType; +enum class InfobarType; class SFX2_DLLPUBLIC SfxViewFrame: public SfxShell, public SfxListener { @@ -153,11 +153,14 @@ public: and position of each button will be changed: only the width will remain unchanged. */ VclPtr<SfxInfoBarWindow> AppendInfoBar(const OUString& sId, - const OUString& sMessage, - InfoBarType aInfoBarType); + const OUString& sPrimaryMessage, + const OUString& sSecondaryMessage, + InfobarType aInfobarType, + bool bShowCloseButton=true); void RemoveInfoBar(const OUString& sId); - void UpdateInfoBar(const OUString& sId, - const OUString& sMessage, InfoBarType eType); + void UpdateInfoBar(const OUString& sId, const OUString& sPrimaryMessage, + const OUString& sSecondaryMessage, + InfobarType eType); bool HasInfoBarWithID(const OUString& sId); SAL_DLLPRIVATE void GetDocNumber_Impl(); |