Kaydet (Commit) 1fb31483 authored tarafından Szymon Kłos's avatar Szymon Kłos Kaydeden (comit) Jan Holesovsky

notebookbar: Instantiate the notebookbar via sfx2 infrastructure.

Change-Id: Iaed4596246245560e646d9086e717d5fb516897e
üst 2c29716d
......@@ -1528,11 +1528,6 @@ throw (RuntimeException, std::exception)
}
}
}
if (getenv("LO_USE_NOTEBOOKBAR"))
{
pSysWindow->CreateNotebookBar("vcl/ui/notebookbar.ui", m_xFrame);
pSysWindow->SetMenuBarMode(MenuBarMode::Hide);
}
}
}
}
......
/* -*- 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 INCLUDED_SFX2_NOTEBOOKBAR_NOTEBOOKBARCHILDWINDOW_HXX
#define INCLUDED_SFX2_NOTEBOOKBAR_NOTEBOOKBARCHILDWINDOW_HXX
#include <sfx2/childwin.hxx>
namespace sfx2 {
/** Outer container of the notebookbar window.
Has to be registered for every application via the
RegisterChildWindow() method from the RegisterControllers() method
of the applications DLL.
*/
class SFX2_DLLPUBLIC NotebookBarChildWindow : public SfxChildWindow
{
public:
NotebookBarChildWindow(vcl::Window* pParent, sal_uInt16 nId, SfxBindings* pBindings, SfxChildWinInfo* pInfo);
SFX_DECL_CHILDWINDOW_WITHID(NotebookBarChildWindow);
};
} // namespace sfx2
#endif // INCLUDED_SFX2_NOTEBOOKBAR_NOTEBOOKBARCHILDWINDOW_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -570,6 +570,7 @@
#define SID_ZOOM (SID_SVX_START + 289)
#define SID_SEARCH_ITEM (SID_SVX_START + 291)
#define SID_SIDEBAR (SID_SVX_START + 336)
#define SID_NOTEBOOKBAR (SID_SVX_START + 338)
#define SID_HYPERLINK_GETLINK (SID_SVX_START + 361)
#define SID_HYPERLINK_SETLINK (SID_SVX_START + 362)
#define SID_INFOBAR (SID_SVX_START + 365)
......
......@@ -227,7 +227,7 @@ public:
MenuBar* GetMenuBar() const { return mpMenuBar; }
void SetMenuBarMode( MenuBarMode nMode );
void CreateNotebookBar(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame);
VclPtr<vcl::Window> CreateNotebookBar(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame);
TaskPaneList* GetTaskPaneList();
void GetWindowStateData( WindowStateData& rData ) const;
......
......@@ -3877,6 +3877,11 @@
<value>9</value>
</prop>
</node>
<node oor:name=".uno:Notebookbar" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Notebookbar</value>
</prop>
</node>
<node oor:name=".uno:Sidebar" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Sidebar</value>
......
......@@ -237,6 +237,7 @@ $(eval $(call gb_Library_add_exception_objects,sfx,\
sfx2/source/doc/templatedlg \
sfx2/source/explorer/nochaos \
sfx2/source/inet/inettbc \
sfx2/source/notebookbar/NotebookBarChildWindow \
sfx2/source/notify/eventsupplier \
sfx2/source/notify/globalevents \
sfx2/source/notify/hintpost \
......
......@@ -43,6 +43,11 @@ interface Window
ExecMethod = ChildWindowExecute ;
StateMethod = ChildWindowState ;
]
SID_NOTEBOOKBAR // status(final|play)
[
ExecMethod = ChildWindowExecute ;
StateMethod = ChildWindowState ;
]
SID_SHOW_BROWSER // ole(no) api(final/play/rec)
[
ExecMethod = ChildWindowExecute ;
......
......@@ -2606,6 +2606,24 @@ SfxBoolItem Sidebar SID_SIDEBAR
]
SfxBoolItem Notebookbar SID_NOTEBOOKBAR
[
AutoUpdate = TRUE,
FastCall = FALSE,
ReadOnlyDoc = TRUE,
Toggle = FALSE,
Container = FALSE,
RecordAbsolute = FALSE,
RecordPerSet;
Asynchron;
AccelConfig = TRUE,
MenuConfig = TRUE,
ToolBoxConfig = TRUE,
GroupId = GID_VIEW;
]
SfxVoidItem RestoreEditingView SID_RESTORE_EDITING_VIEW
[
......
......@@ -98,6 +98,11 @@ String SID_SIDEBAR
Text [ en-US ] = "Sidebar";
};
String SID_NOTEBOOKBAR
{
Text [ en-US ] = "Notebookbar";
};
String STR_ERROR_WRONG_CONFIRM
{
Text [ en-US ] = "Faulty password confirmation";
......
......@@ -61,6 +61,7 @@
#define HID_TASKPANE_VIEW_MENU "SFX2_HID_TASKPANE_VIEW_MENU"
#define HID_SIDEBAR_WINDOW "SFX2_HID_SIDEBAR_WINDOW"
#define HID_NOTEBOOKBAR_WINDOW "SFX2_HID_NOTEBOOKBAR_WINDOW"
#endif // #ifndef _SFX_HELPID_HRC
......
/* -*- 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/.
*/
#include <sfx2/bindings.hxx>
#include <sfx2/notebookbar/NotebookBarChildWindow.hxx>
#include <sfx2/sfxsids.hrc>
#include "helpid.hrc"
#include <sfx2/dockwin.hxx>
#include <sfx2/dispatch.hxx>
using namespace sfx2;
SFX_IMPL_DOCKINGWINDOW_WITHID(NotebookBarChildWindow, SID_NOTEBOOKBAR);
NotebookBarChildWindow::NotebookBarChildWindow (vcl::Window* pParentWindow, sal_uInt16 nId,
SfxBindings* pBindings, SfxChildWinInfo*)
: SfxChildWindow(pParentWindow, nId)
{
SfxFrame& rFrame = pBindings->GetDispatcher_Impl()->GetFrame()->GetFrame();
VclPtr<vcl::Window> pNotebookBarWindow = rFrame.GetSystemWindow()->CreateNotebookBar("vcl/ui/notebookbar.ui", rFrame.GetFrameInterface());
pNotebookBarWindow->SetHelpId(HID_NOTEBOOKBAR_WINDOW);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -98,6 +98,7 @@
#include <modcfg.hxx>
#include <fontcfg.hxx>
#include <sfx2/sidebar/SidebarChildWindow.hxx>
#include <sfx2/notebookbar/NotebookBarChildWindow.hxx>
#include <sfx2/evntconf.hxx>
#include <swatrset.hxx>
#include <idxmrk.hxx>
......@@ -367,6 +368,11 @@ void SwDLL::RegisterControls()
::avmedia::MediaPlayer::RegisterChildWindow(false, pMod);
::sfx2::sidebar::SidebarChildWindow::RegisterChildWindow(false, pMod);
::sfx2::NotebookBarChildWindow::RegisterChildWindow(false, pMod);
//SfxFrame& rFrame = GetActiveView()->GetViewFrame()->GetFrame();
//rFrame.GetSystemWindow()->SetNotebookBar("vcl/ui/notebookbar.ui", rFrame.GetFrameInterface());
SwJumpToSpecificPageControl::RegisterControl(SID_JUMP_TO_SPECIFIC_PAGE, pMod);
}
......
......@@ -37,6 +37,7 @@
#include <sfx2/viewfrm.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/sidebar/SidebarChildWindow.hxx>
#include <sfx2/notebookbar/NotebookBarChildWindow.hxx>
#include <uivwimp.hxx>
#include <avmedia/mediaplayer.hxx>
#include <swmodule.hxx>
......@@ -98,6 +99,8 @@ void SwView::InitInterface_Impl()
GetStaticInterface()->RegisterChildWindow(SID_NAVIGATOR, true);
GetStaticInterface()->RegisterChildWindow(::sfx2::sidebar::SidebarChildWindow::GetChildWindowId());
GetStaticInterface()->RegisterChildWindow(::sfx2::NotebookBarChildWindow::GetChildWindowId());
GetStaticInterface()->RegisterChildWindow(SfxInfoBarContainerChild::GetChildWindowId());
GetStaticInterface()->RegisterChildWindow(SvxSearchDialogWrapper::GetChildWindowId());
GetStaticInterface()->RegisterChildWindow(SwSpellDialogChildWindow::GetChildWindowId());
......
......@@ -162,7 +162,7 @@ public:
void SetMenuBarWindow( vcl::Window* pWindow );
void SetMenuBarMode( bool bHide );
void SetNotebookBarWindow(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame);
VclPtr<vcl::Window> CreateNotebookBarWindow(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame);
void SetMinOutputSize( long nWidth, long nHeight )
{ mnMinWidth = nWidth; mnMinHeight = nHeight; }
......
......@@ -2177,11 +2177,12 @@ void ImplBorderWindow::SetMenuBarMode( bool bHide )
UpdateMenuHeight();
}
void ImplBorderWindow::SetNotebookBarWindow(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame)
VclPtr<vcl::Window> ImplBorderWindow::CreateNotebookBarWindow(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame)
{
mpNotebookBarWindow = VclPtr<NotebookBarWindow>::Create(this, "NotebookBar", rUIXMLDescription, rFrame);
Resize();
mpNotebookBarWindow->Show();
return mpNotebookBarWindow;
}
void ImplBorderWindow::GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
......@@ -2192,7 +2193,7 @@ void ImplBorderWindow::GetBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder,
if (mpMenuBarWindow && !mbMenuHide)
rTopBorder += mpMenuBarWindow->GetSizePixel().Height();
if (mpNotebookBarWindow)
if (mpNotebookBarWindow && mpNotebookBarWindow->IsVisible())
rTopBorder += mpNotebookBarWindow->GetSizePixel().Height();
}
......
......@@ -66,4 +66,15 @@ 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)
{
if (nType == StateChangedType::Visible)
{
// visibility changed, update the container
GetParent()->Resize();
}
Control::StateChanged(nType);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -25,6 +25,8 @@ public:
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
......
......@@ -940,9 +940,9 @@ void SystemWindow::SetMenuBar(MenuBar* pMenuBar)
}
}
void SystemWindow::CreateNotebookBar(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame)
VclPtr<vcl::Window> SystemWindow::CreateNotebookBar(const OUString& rUIXMLDescription, const css::uno::Reference<css::frame::XFrame>& rFrame)
{
static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetNotebookBarWindow(rUIXMLDescription, rFrame);
return static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->CreateNotebookBarWindow(rUIXMLDescription, rFrame);
}
void SystemWindow::SetMenuBarMode( MenuBarMode nMode )
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment