22#include <rtl/bootstrap.hxx>
23#include <osl/file.hxx>
24#include <config_folders.h>
25#include <com/sun/star/frame/XFrame.hpp>
26#include <com/sun/star/frame/FrameAction.hpp>
27#include <com/sun/star/ui/ContextChangeEventMultiplexer.hpp>
32 OUString sShareLayer(
"${$BRAND_BASE_DIR/" LIBO_ETC_FOLDER
"/" SAL_CONFIGFILE(
33 "bootstrap")
":UserInstallation}/user/config/soffice.cfg/");
34 rtl::Bootstrap::expandMacros(sShareLayer);
38static bool doesFileExist(std::u16string_view sUIDir, std::u16string_view sUIFile)
40 OUString sUri = OUString::Concat(sUIDir) + sUIFile;
42 return( file.open(0) == osl::FileBase::E_None );
52 css::uno::Reference<css::frame::XFrame>
mxFrame;
67 virtual void SAL_CALL
frameAction(
const css::frame::FrameActionEvent& rEvent)
override;
69 virtual void SAL_CALL
disposing(const ::css::lang::EventObject&)
override;
73 const css::uno::Reference<css::frame::XFrame>& rFrame,
77 , m_pViewShell(nullptr)
79 , m_sUIXMLDescription(rUIXMLDescription)
86 if ( doesCustomizedUIExist )
100 new VclBuilder(
this, sUIDir, rUIXMLDescription, rID, rFrame,
true, &aNotebookBarAddonsItem));
105 NotebookbarContextControl* pContextContainer =
nullptr;
109 OUString
aName =
"ContextContainer";
111 aName += OUString::number(
i);
113 pContextContainer =
dynamic_cast<NotebookbarContextControl*
>(m_pUIBuilder->get<
Window>(
aName));
114 if (pContextContainer)
118 while( pContextContainer !=
nullptr );
165 return Window::PreNotify( rNEvt );
178 bool bCanHandleSmallerWidth =
false;
179 bool bCanHandleSmallerHeight =
false;
186 WinBits nStyle = pChild->GetStyle();
188 bCanHandleSmallerWidth =
true;
190 bCanHandleSmallerHeight =
true;
194 if (!bCanHandleSmallerWidth)
195 nWidth = std::max(nWidth, aSize.
Width());
196 if (!bCanHandleSmallerHeight)
197 nHeight = std::max(nHeight, aSize.
Height());
207 if(m_pUIBuilder && m_pUIBuilder->get_widget_root())
248 auto xMultiplexer(css::ui::ContextChangeEventMultiplexer::get(::comphelper::getProcessComponentContext()));
254 xMultiplexer->addContextChangeEventListener(
this,
mxFrame->getController());
256 catch (
const css::uno::Exception&)
261 xMultiplexer->removeAllContextChangeEventListeners(
this);
269 mxFrame->addFrameActionListener(
this);
271 mxFrame->removeFrameActionListener(
this);
279 if (rEvent.Action == css::frame::FrameAction_COMPONENT_REATTACHED)
283 else if (rEvent.Action == css::frame::FrameAction_COMPONENT_DETACHING)
const StyleSettings & GetStyleSettings() const
void SetStyleSettings(const StyleSettings &rSet)
static OUString GetUIRootDir()
virtual void StateChanged(StateChangedType nStateChange) override
virtual void Resize() override
virtual Size GetOptimalSize() const override
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
split from the main class since it needs different ref-counting mana
css::uno::Reference< css::frame::XFrame > mxFrame
virtual void SAL_CALL disposing(const ::css::lang::EventObject &) override
void setupListener(bool bListen)
virtual void SAL_CALL notifyContextChangeEvent(const css::ui::ContextChangeEventObject &rEvent) override
NotebookBarContextChangeEventListener(NotebookBar *p, css::uno::Reference< css::frame::XFrame > xFrame)
void setupFrameListener(bool bListen)
VclPtr< NotebookBar > mpParent
virtual void SAL_CALL frameAction(const css::frame::FrameActionEvent &rEvent) override
This implements Widget Layout-based notebook-like menu bar.
rtl::Reference< NotebookBarContextChangeEventListener > m_pEventListener
virtual void Resize() override
virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags=PosSizeFlags::All) override
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
VclPtr< vcl::Window > m_xVclContentArea
virtual bool PreNotify(NotifyEvent &rNEvt) override
virtual Size GetOptimalSize() const override
const SfxViewShell * m_pViewShell
void SetSystemWindow(SystemWindow *pSystemWindow)
void StateChanged(const StateChangedType nStateChange) override
void UpdatePersonaSettings()
AllSettings PersonaSettings
Link< const SfxViewShell *, void > m_rDisposeLink
NotebookBar(Window *pParent, const OUString &rID, const OUString &rUIXMLDescription, const css::uno::Reference< css::frame::XFrame > &rFrame, const NotebookBarAddonsItem &aNotebookBarAddonsItem)
void SetupListener(bool bListen)
void DataChanged(const DataChangedEvent &rDCEvt) override
VclPtr< SystemWindow > m_pSystemWindow
void SetDisposeCallback(const Link< const SfxViewShell *, void > rDisposeCallback, const SfxViewShell *pViewShell)
AllSettings DefaultSettings
std::vector< NotebookbarContextControl * > m_pContextContainers
virtual ~NotebookBar() override
void UpdateDefaultSettings()
NotifyEventType GetType() const
virtual void SetSettings(const AllSettings &rSettings)
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
constexpr tools::Long Width() const
const std::optional< Color > & GetPersonaMenuBarTextColor() const
void SetGroupTextColor(const Color &rColor)
BitmapEx const & GetPersonaHeader() const
const Color & GetFieldTextColor() const
void SetTabTextColor(const Color &rColor)
void SetRadioCheckTextColor(const Color &rColor)
const Color & GetDialogColor() const
void SetLabelTextColor(const Color &rColor)
void SetButtonTextColor(const Color &rColor)
void SetWindowTextColor(const Color &rColor)
void SetToolTextColor(const Color &rColor)
void SetDialogTextColor(const Color &rColor)
SAL_DLLPRIVATE bool ImplIsInTaskPaneList(vcl::Window *pWin)
virtual bool PreNotify(NotifyEvent &rNEvt) override
TaskPaneList * GetTaskPaneList()
void AddWindow(vcl::Window *pWindow)
void RemoveWindow(vcl::Window *pWindow)
Creates a hierarchy of vcl::Windows (widgets) from a .ui file for dialogs, sidebar,...
static void setLayoutAllocation(vcl::Window &rWindow, const Point &rPos, const Size &rSize)
static Size getLayoutRequisition(const vcl::Window &rWindow)
static VclPtr< reference_type > Create(Arg &&... arg)
A construction helper for VclPtr.
void SetStyle(WallpaperStyle eStyle)
static Context GetContextEnum(const OUString &rsContextName)
void SetStyle(WinBits nStyle)
virtual void SetSizePixel(const Size &rNewSize)
vcl::Window * GetWindow(GetWindowType nType) const
const AllSettings & GetSettings() const
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
::OutputDevice const * GetOutDev() const
virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags=PosSizeFlags::All)
virtual Size GetSizePixel() const
virtual void DataChanged(const DataChangedEvent &rDCEvt)
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
vcl::Window * GetChild(sal_uInt16 nChild) const
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
#define SAL_CONFIGFILE(name)
bool isLayoutEnabled(const vcl::Window *pWindow)
static OUString getCustomizedUIRootDir()
static bool doesFileExist(std::u16string_view sUIDir, std::u16string_view sUIFile)
Reference< XFrame > xFrame
WinBits const WB_DIALOGCONTROL
WinBits const WB_AUTOVSCROLL
WinBits const WB_AUTOHSCROLL