diff options
author | Jan Holesovsky <kendy@collabora.com> | 2016-03-29 11:13:57 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2016-03-30 11:01:30 +0200 |
commit | d039c4812db5ba4beed72deb44fe6b04137af6e5 (patch) | |
tree | 4369ed1e5984bbfa7fd7d41ee103624782c79834 /vcl | |
parent | 1fb314832ebd14cde6457feb2bf4f19e1bfcaa82 (diff) |
notebookbar: Rename NotebookBarWindow to NotebookBar, and move accordingly.
Change-Id: If04a8f62aba0bcb712ae6405db318a4bd073fc54
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/Library_vcl.mk | 2 | ||||
-rw-r--r-- | vcl/inc/brdwin.hxx | 7 | ||||
-rw-r--r-- | vcl/source/control/notebookbar.cxx (renamed from vcl/source/window/notebookbarwindow.cxx) | 15 | ||||
-rw-r--r-- | vcl/source/window/brdwin.cxx | 20 | ||||
-rw-r--r-- | vcl/source/window/notebookbarwindow.hxx | 34 | ||||
-rw-r--r-- | vcl/source/window/syswin.cxx | 15 |
6 files changed, 31 insertions, 62 deletions
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/notebookbarwindow.hxx b/vcl/source/window/notebookbarwindow.hxx deleted file mode 100644 index c63296e81444..000000000000 --- a/vcl/source/window/notebookbarwindow.hxx +++ /dev/null @@ -1,34 +0,0 @@ -/* -*- 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 VCL_SOURCE_WINDOW_NOTEBOOKBARWINDOW_HXX -#define VCL_SOURCE_WINDOW_NOTEBOOKBARWINDOW_HXX - -#include "menuwindow.hxx" - -#include <vcl/builder.hxx> -#include <vcl/ctrl.hxx> - -/// This implements Widget Layout-based notebook-like menu bar. -class NotebookBarWindow : public Control, public VclBuilderContainer -{ -public: - NotebookBarWindow(Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame> &rFrame); - virtual ~NotebookBarWindow(); - virtual void dispose() SAL_OVERRIDE; - - virtual Size GetOptimalSize() const SAL_OVERRIDE; - virtual void setPosSizePixel(long nX, long nY, long nWidth, long nHeight, PosSizeFlags nFlags = PosSizeFlags::All) SAL_OVERRIDE; - - virtual void StateChanged(StateChangedType nType) override; -}; - -#endif // VCL_SOURCE_WINDOW_NOTEBOOKBARWINDOW_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ 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 ) |