summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Holesovsky <kendy@collabora.com>2016-03-29 11:13:57 +0200
committerJan Holesovsky <kendy@collabora.com>2016-03-30 11:01:30 +0200
commitd039c4812db5ba4beed72deb44fe6b04137af6e5 (patch)
tree4369ed1e5984bbfa7fd7d41ee103624782c79834
parentnotebookbar: Instantiate the notebookbar via sfx2 infrastructure. (diff)
downloadcore-d039c4812db5ba4beed72deb44fe6b04137af6e5.tar.gz
core-d039c4812db5ba4beed72deb44fe6b04137af6e5.zip
notebookbar: Rename NotebookBarWindow to NotebookBar, and move accordingly.
Change-Id: If04a8f62aba0bcb712ae6405db318a4bd073fc54
-rw-r--r--include/vcl/notebookbar.hxx (renamed from vcl/source/window/notebookbarwindow.hxx)14
-rw-r--r--include/vcl/syswin.hxx8
-rw-r--r--sfx2/source/notebookbar/NotebookBarChildWindow.cxx5
-rw-r--r--vcl/Library_vcl.mk2
-rw-r--r--vcl/inc/brdwin.hxx7
-rw-r--r--vcl/source/control/notebookbar.cxx (renamed from vcl/source/window/notebookbarwindow.cxx)15
-rw-r--r--vcl/source/window/brdwin.cxx20
-rw-r--r--vcl/source/window/syswin.cxx15
8 files changed, 45 insertions, 41 deletions
diff --git a/vcl/source/window/notebookbarwindow.hxx b/include/vcl/notebookbar.hxx
index c63296e81444..9dd7e9f5b708 100644
--- a/vcl/source/window/notebookbarwindow.hxx
+++ b/include/vcl/notebookbar.hxx
@@ -7,20 +7,18 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#ifndef VCL_SOURCE_WINDOW_NOTEBOOKBARWINDOW_HXX
-#define VCL_SOURCE_WINDOW_NOTEBOOKBARWINDOW_HXX
-
-#include "menuwindow.hxx"
+#ifndef INCLUDED_VCL_NOTEBOOKBAR_HXX
+#define INCLUDED_VCL_NOTEBOOKBAR_HXX
#include <vcl/builder.hxx>
#include <vcl/ctrl.hxx>
/// This implements Widget Layout-based notebook-like menu bar.
-class NotebookBarWindow : public Control, public VclBuilderContainer
+class NotebookBar : public Control, public VclBuilderContainer
{
public:
- NotebookBarWindow(Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame);
- virtual ~NotebookBarWindow();
+ NotebookBar(Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame);
+ virtual ~NotebookBar();
virtual void dispose() SAL_OVERRIDE;
virtual Size GetOptimalSize() const SAL_OVERRIDE;
@@ -29,6 +27,6 @@ public:
virtual void StateChanged(StateChangedType nType) override;
};
-#endif // VCL_SOURCE_WINDOW_NOTEBOOKBARWINDOW_HXX
+#endif // INCLUDED_VCL_NOTEBOOKBAR_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx
index 09ed113a7375..e6b637b28589 100644
--- a/include/vcl/syswin.hxx
+++ b/include/vcl/syswin.hxx
@@ -23,12 +23,12 @@
#include <tools/solar.h>
#include <vcl/dllapi.h>
#include <vcl/builder.hxx>
-#include <vcl/window.hxx>
#include <vcl/idle.hxx>
+#include <vcl/notebookbar.hxx>
+#include <vcl/window.hxx>
class ModalDialog;
class MenuBar;
-class NotebookBarWindow;
class TaskPaneList;
class VclContainer;
@@ -153,6 +153,7 @@ private:
sal_uInt16 mnIcon;
ImplData* mpImplData;
Idle maLayoutIdle;
+ OUString maNotebookBarUIFile;
protected:
bool mbIsDefferedInit;
VclPtr<vcl::Window> mpDialogParent;
@@ -227,7 +228,8 @@ public:
MenuBar* GetMenuBar() const { return mpMenuBar; }
void SetMenuBarMode( MenuBarMode nMode );
- VclPtr<vcl::Window> CreateNotebookBar(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame);
+ void SetNotebookBar(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame);
+ VclPtr<NotebookBar> GetNotebookBar() const;
TaskPaneList* GetTaskPaneList();
void GetWindowStateData( WindowStateData& rData ) const;
diff --git a/sfx2/source/notebookbar/NotebookBarChildWindow.cxx b/sfx2/source/notebookbar/NotebookBarChildWindow.cxx
index 7c5609bea793..365d6ef8c546 100644
--- a/sfx2/source/notebookbar/NotebookBarChildWindow.cxx
+++ b/sfx2/source/notebookbar/NotebookBarChildWindow.cxx
@@ -23,9 +23,10 @@ NotebookBarChildWindow::NotebookBarChildWindow (vcl::Window* pParentWindow, sal_
: SfxChildWindow(pParentWindow, nId)
{
SfxFrame& rFrame = pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame();
- VclPtr<vcl::Window> pNotebookBarWindow = rFrame.GetSystemWindow()->CreateNotebookBar("vcl/ui/notebookbar.ui", rFrame.GetFrameInterface());
+ rFrame.GetSystemWindow()->SetNotebookBar("vcl/ui/notebookbar.ui", rFrame.GetFrameInterface());
- pNotebookBarWindow->SetHelpId(HID_NOTEBOOKBAR_WINDOW);
+ VclPtr<NotebookBar> pNotebookBar(rFrame.GetSystemWindow()->GetNotebookBar());
+ pNotebookBar->SetHelpId(HID_NOTEBOOKBAR_WINDOW);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 1d4cf3707114..657388c0dba6 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -170,7 +170,6 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/source/window/mouse \
vcl/source/window/mouseevent \
vcl/source/window/msgbox \
- vcl/source/window/notebookbarwindow \
vcl/source/window/popupmenuwindow \
vcl/source/window/printdlg \
vcl/source/window/scrwnd \
@@ -205,6 +204,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\
vcl/source/control/listbox \
vcl/source/control/menubtn \
vcl/source/control/morebtn \
+ vcl/source/control/notebookbar \
vcl/source/control/quickselectionengine \
vcl/source/control/prgsbar \
vcl/source/control/scrbar \
diff --git a/vcl/inc/brdwin.hxx b/vcl/inc/brdwin.hxx
index 93bee37bef86..b4a60b2dc3fe 100644
--- a/vcl/inc/brdwin.hxx
+++ b/vcl/inc/brdwin.hxx
@@ -20,13 +20,13 @@
#ifndef INCLUDED_VCL_INC_BRDWIN_HXX
#define INCLUDED_VCL_INC_BRDWIN_HXX
+#include <vcl/notebookbar.hxx>
#include <vcl/window.hxx>
#include <com/sun/star/frame/XFrame.hpp>
class ImplBorderWindowView;
enum class DrawButtonFlags;
-class NotebookBarWindow;
#define BORDERWINDOW_STYLE_OVERLAP ((sal_uInt16)0x0001)
#define BORDERWINDOW_STYLE_BORDER ((sal_uInt16)0x0002)
@@ -88,7 +88,7 @@ class ImplBorderWindow : public vcl::Window
private:
ImplBorderWindowView* mpBorderView;
VclPtr<vcl::Window> mpMenuBarWindow;
- VclPtr<NotebookBarWindow> mpNotebookBarWindow;
+ VclPtr<NotebookBar> mpNotebookBar;
long mnMinWidth;
long mnMinHeight;
long mnMaxWidth;
@@ -162,7 +162,8 @@ public:
void SetMenuBarWindow( vcl::Window* pWindow );
void SetMenuBarMode( bool bHide );
- VclPtr<vcl::Window> CreateNotebookBarWindow(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame);
+ void SetNotebookBar(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame);
+ VclPtr<NotebookBar> GetNotebookBar() const { return mpNotebookBar; }
void SetMinOutputSize( long nWidth, long nHeight )
{ mnMinWidth = nWidth; mnMinHeight = nHeight; }
diff --git a/vcl/source/window/notebookbarwindow.cxx b/vcl/source/control/notebookbar.cxx
index 6945d11fa1b0..a037eb7fa18e 100644
--- a/vcl/source/window/notebookbarwindow.cxx
+++ b/vcl/source/control/notebookbar.cxx
@@ -7,29 +7,28 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#include "notebookbarwindow.hxx"
-
#include <vcl/layout.hxx>
+#include <vcl/notebookbar.hxx>
-NotebookBarWindow::NotebookBarWindow(Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame)
+NotebookBar::NotebookBar(Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame)
: Control(pParent)
{
SetStyle(GetStyle() | WB_DIALOGCONTROL);
m_pUIBuilder = new VclBuilder(this, getUIRootDir(), rUIXMLDescription, rID, rFrame);
}
-NotebookBarWindow::~NotebookBarWindow()
+NotebookBar::~NotebookBar()
{
disposeOnce();
}
-void NotebookBarWindow::dispose()
+void NotebookBar::dispose()
{
disposeBuilder();
Control::dispose();
}
-Size NotebookBarWindow::GetOptimalSize() const
+Size NotebookBar::GetOptimalSize() const
{
if (isLayoutEnabled(this))
return VclContainer::getLayoutRequisition(*GetWindow(GetWindowType::FirstChild));
@@ -37,7 +36,7 @@ Size NotebookBarWindow::GetOptimalSize() const
return Control::GetOptimalSize();
}
-void NotebookBarWindow::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags)
+void NotebookBar::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags)
{
bool bCanHandleSmallerWidth = false;
bool bCanHandleSmallerHeight = false;
@@ -66,7 +65,7 @@ void NotebookBarWindow::setPosSizePixel(long nX, long nY, long nWidth, long nHei
VclContainer::setLayoutAllocation(*pChild, Point(0, 0), Size(nWidth, nHeight));
}
-void NotebookBarWindow::StateChanged(StateChangedType nType)
+void NotebookBar::StateChanged(StateChangedType nType)
{
if (nType == StateChangedType::Visible)
{
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 31b968fa9f4c..6dee935bc2f5 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -37,8 +37,6 @@
#include <vcl/metric.hxx>
#include <vcl/settings.hxx>
-#include "notebookbarwindow.hxx"
-
using namespace ::com::sun::star::uno;
// useful caption height for title bar buttons
@@ -1834,7 +1832,7 @@ void ImplBorderWindow::dispose()
delete mpBorderView;
mpBorderView = nullptr;
mpMenuBarWindow.clear();
- mpNotebookBarWindow.disposeAndClear();
+ mpNotebookBar.disposeAndClear();
vcl::Window::dispose();
}
@@ -1944,10 +1942,10 @@ void ImplBorderWindow::Resize()
nTopBorder += nMenuHeight;
}
- if (mpNotebookBarWindow)
+ if (mpNotebookBar)
{
- long nNotebookBarHeight = mpNotebookBarWindow->GetSizePixel().Height();
- mpNotebookBarWindow->setPosSizePixel(
+ long nNotebookBarHeight = mpNotebookBar->GetSizePixel().Height();
+ mpNotebookBar->setPosSizePixel(
nLeftBorder, nTopBorder,
aSize.Width() - nLeftBorder - nRightBorder,
nNotebookBarHeight);
@@ -2177,12 +2175,10 @@ void ImplBorderWindow::SetMenuBarMode( bool bHide )
UpdateMenuHeight();
}
-VclPtr<vcl::Window> ImplBorderWindow::CreateNotebookBarWindow(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame)
+void ImplBorderWindow::SetNotebookBar(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame)
{
- mpNotebookBarWindow = VclPtr<NotebookBarWindow>::Create(this, "NotebookBar", rUIXMLDescription, rFrame);
+ mpNotebookBar = VclPtr<NotebookBar>::Create(this, "NotebookBar", rUIXMLDescription, rFrame);
Resize();
-
- return mpNotebookBarWindow;
}
void ImplBorderWindow::GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
@@ -2193,8 +2189,8 @@ void ImplBorderWindow::GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
if (mpMenuBarWindow && !mbMenuHide)
rTopBorder += mpMenuBarWindow->GetSizePixel().Height();
- if (mpNotebookBarWindow && mpNotebookBarWindow->IsVisible())
- rTopBorder += mpNotebookBarWindow->GetSizePixel().Height();
+ if (mpNotebookBar && mpNotebookBar->IsVisible())
+ rTopBorder += mpNotebookBar->GetSizePixel().Height();
}
long ImplBorderWindow::CalcTitleWidth() const
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index 86c0a8b9dbd8..02b15dac35ce 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -39,8 +39,6 @@
#include <brdwin.hxx>
#include <window.h>
-#include "notebookbarwindow.hxx"
-
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
@@ -940,9 +938,18 @@ void SystemWindow::SetMenuBar(MenuBar* pMenuBar)
}
}
-VclPtr<vcl::Window> SystemWindow::CreateNotebookBar(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame)
+void SystemWindow::SetNotebookBar(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame)
+{
+ if (rUIXMLDescription != maNotebookBarUIFile)
+ {
+ static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetNotebookBar(rUIXMLDescription, rFrame);
+ maNotebookBarUIFile = rUIXMLDescription;
+ }
+}
+
+VclPtr<NotebookBar> SystemWindow::GetNotebookBar() const
{
- return static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->CreateNotebookBarWindow(rUIXMLDescription, rFrame);
+ return static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->GetNotebookBar();
}
void SystemWindow::SetMenuBarMode( MenuBarMode nMode )