notebookbar: Rename NotebookBarWindow to NotebookBar, and move accordingly.

Change-Id: If04a8f62aba0bcb712ae6405db318a4bd073fc54
This commit is contained in:
Jan Holesovsky 2016-03-29 11:13:57 +02:00
parent 1fb314832e
commit d039c4812d
8 changed files with 45 additions and 41 deletions

View file

@ -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: */

View file

@ -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;

View file

@ -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: */

View file

@ -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 \

View file

@ -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; }

View file

@ -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)
{

View file

@ -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

View file

@ -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)
{
return static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->CreateNotebookBarWindow(rUIXMLDescription, 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())->GetNotebookBar();
}
void SystemWindow::SetMenuBarMode( MenuBarMode nMode )