diff options
author | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-10-05 15:37:26 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat@free.fr> | 2012-10-11 17:31:17 +0200 |
commit | 97aa108f2b595145d63b00d515489030a849957e (patch) | |
tree | a7c0354f5699e9e059ae1baf9eb157ab143d71a4 /sfx2/inc | |
parent | b66a72cba2f38c3ddc9e7c91a1afd5d8a2279ed8 (diff) |
InfoBars: first implementation
Change-Id: I4b18f19f5cf13d648a8d10cc31c63bb330a86b6f
Diffstat (limited to 'sfx2/inc')
-rw-r--r-- | sfx2/inc/sfx2/infobar.hxx | 77 | ||||
-rw-r--r-- | sfx2/inc/sfx2/sfxsids.hrc | 1 | ||||
-rw-r--r-- | sfx2/inc/sfx2/viewfrm.hxx | 8 |
3 files changed, 86 insertions, 0 deletions
diff --git a/sfx2/inc/sfx2/infobar.hxx b/sfx2/inc/sfx2/infobar.hxx new file mode 100644 index 000000000000..00d521f7749b --- /dev/null +++ b/sfx2/inc/sfx2/infobar.hxx @@ -0,0 +1,77 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ +#ifndef _SFX2_MESSAGEBAR_HXX_ +#define _SFX2_MESSAGEBAR_HXX_ + +#include <vector> + +#include <vcl/button.hxx> +#include <vcl/fixed.hxx> + +#include <sfx2/dllapi.h> +#include <sfx2/childwin.hxx> + +/** SfxChildWindow for positioning the InfoBar in the view. + */ +class SFX2_DLLPUBLIC SfxInfoBarContainerChild : public SfxChildWindow +{ + private: + SfxBindings* m_pBindings; + + public: + SfxInfoBarContainerChild( Window* pParent, + sal_uInt16 nId, + SfxBindings* pBindings, + SfxChildWinInfo* pInfo ); + virtual ~SfxInfoBarContainerChild(); + + SFX_DECL_CHILDWINDOW_WITHID( SfxInfoBarContainerChild ); + + void Update( ); +}; + +/** Class representing a single InfoBar to be added in a SfxInfoBarContainerWindow. + */ +class SfxInfoBarWindow : public Window +{ + private: + FixedText* m_pMessage; + Button* m_pCloseBtn; + std::vector< PushButton* > m_aActionBtns; + + public: + SfxInfoBarWindow( Window* parent, + const rtl::OUString& sMessage, + std::vector< PushButton* > aButtons ); + ~SfxInfoBarWindow( ); + + virtual void Paint( const Rectangle& ); + + private: + DECL_LINK( CloseHandler, void* ); +}; + +class SfxInfoBarContainerWindow : public Window +{ + private: + SfxInfoBarContainerChild* m_pChildWin; + std::vector< SfxInfoBarWindow* > m_pInfoBars; + + public: + SfxInfoBarContainerWindow( SfxInfoBarContainerChild* pChildWin ); + ~SfxInfoBarContainerWindow( ); + + void appendInfoBar( const rtl::OUString& sMessage, std::vector< PushButton* > aButtons ); + void removeInfoBar( SfxInfoBarWindow* pInfoBar ); +}; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sfx2/inc/sfx2/sfxsids.hrc b/sfx2/inc/sfx2/sfxsids.hrc index 549ac0ee4139..0d3522bd7b14 100644 --- a/sfx2/inc/sfx2/sfxsids.hrc +++ b/sfx2/inc/sfx2/sfxsids.hrc @@ -592,6 +592,7 @@ #define SID_HYPERLINK_GETLINK (SID_SVX_START + 361) #define SID_HYPERLINK_SETLINK (SID_SVX_START + 362) #define SID_NAVIGATOR (SID_SVX_START + 366) +#define SID_INFOBARCONTAINER (SID_SVX_START + 367) #define SID_TASKPANE (SID_SVX_START + 370) #define SID_ZOOM_NEXT (SID_SVX_START + 402) #define SID_ZOOM_PREV (SID_SVX_START + 403) diff --git a/sfx2/inc/sfx2/viewfrm.hxx b/sfx2/inc/sfx2/viewfrm.hxx index ce8622e0d6a8..26b5e47ca584 100644 --- a/sfx2/inc/sfx2/viewfrm.hxx +++ b/sfx2/inc/sfx2/viewfrm.hxx @@ -28,6 +28,7 @@ #include <sfx2/shell.hxx> #include <sfx2/sfxsids.hrc> #include <svl/poolitem.hxx> +#include <vcl/button.hxx> #include <com/sun/star/frame/status/Verb.hpp> #include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/frame/XController2.hpp> @@ -184,6 +185,13 @@ public: void ChildWindowExecute(SfxRequest&); void ChildWindowState(SfxItemSet&); + /** Append a new InfoBar (see https://wiki.documentfoundation.org/Design/Whiteboards/Infobar). + + The buttons will be added from Right to Left at the right of the info bar. The parent, size + and position of each button will be changed: only the width will remain unchanged. + */ + void AppendInfoBar( const rtl::OUString& sMessage, std::vector< PushButton* > aButtons ); + SAL_DLLPRIVATE void SetDowning_Impl(); SAL_DLLPRIVATE void GetDocNumber_Impl(); SAL_DLLPRIVATE sal_Bool IsDowning_Impl() const; |