20#include <com/sun/star/ui/XUIElementFactory.hpp>
37#include <com/sun/star/lang/XServiceInfo.hpp>
38#include <com/sun/star/uno/XComponentContext.hpp>
45using namespace css::uno;
50 css::ui::XUIElementFactory, css::lang::XServiceInfo
56 SwPanelFactory(SwPanelFactory
const&) =
delete;
57 SwPanelFactory& operator=(SwPanelFactory
const&) =
delete;
63 css::uno::Reference<css::ui::XUIElement> SAL_CALL createUIElement(
64 const OUString& rsResourceURL,
65 const css::uno::Sequence<css::beans::PropertyValue>& rArguments)
override;
68 {
return "org.apache.openoffice.comp.sw.sidebar.SwPanelFactory"; }
74 {
return {
"com.sun.star.ui.UIElementFactory"}; }
77SwPanelFactory::SwPanelFactory()
81Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
82 const OUString& rsResourceURL,
83 const css::uno::Sequence<css::beans::PropertyValue>& rArguments)
85 Reference<ui::XUIElement> xElement;
87 const ::comphelper::NamedValueCollection
aArguments (rArguments);
88 Reference<frame::XFrame>
xFrame (
aArguments.getOrDefault(
"Frame", Reference<frame::XFrame>()));
89 Reference<awt::XWindow> xParentWindow (
aArguments.getOrDefault(
"ParentWindow", Reference<awt::XWindow>()));
90 const sal_uInt64 nBindingsValue (
aArguments.getOrDefault(
"SfxBindings", sal_uInt64(0)));
95 pParent = pTunnel->getWidget();
99 "PanelFactory::createUIElement called without ParentWindow",
103 "PanelFactory::createUIElement called without Frame",
105 if (pBindings ==
nullptr)
107 "PanelFactory::createUIElement called without SfxBindings",
110 if(rsResourceURL.endsWith(
"/PageStylesPanel"))
117 ui::LayoutSize(-1,-1,-1));
119 else if(rsResourceURL.endsWith(
"/PageFormatPanel"))
126 ui::LayoutSize(-1,-1,-1));
128 else if(rsResourceURL.endsWith(
"/PageHeaderPanel"))
135 ui::LayoutSize(-1,-1,-1));
137 else if(rsResourceURL.endsWith(
"/PageFooterPanel"))
144 ui::LayoutSize(-1,-1,-1));
146 else if (rsResourceURL.endsWith(
"/WrapPropertyPanel"))
153 ui::LayoutSize(-1,-1,-1));
155 else if (rsResourceURL.endsWith(
"/NavigatorPanel"))
162 ui::LayoutSize(0,-1,-1));
164 else if (rsResourceURL.endsWith(
"/ManageChangesPanel"))
166 auto xPanel = std::make_unique<SwRedlineAcceptPanel>(pParent);
171 ui::LayoutSize(0,-1,-1));
173 else if (rsResourceURL.endsWith(
"/WriterInspectorTextPanel"))
180 ui::LayoutSize(0,-1,-1));
182 else if (rsResourceURL.endsWith(
"/StylePresetsPanel"))
186 rsResourceURL, xFrame, std::move(xPanel), ui::LayoutSize(-1,-1,-1));
188 else if (rsResourceURL.endsWith(
"/ThemePanel"))
192 rsResourceURL, xFrame, std::move(xPanel), ui::LayoutSize(-1,-1,-1));
194 else if (rsResourceURL.endsWith(
"/TableEditPanel"))
198 rsResourceURL, xFrame, std::move(xPanel), ui::LayoutSize(-1,-1,-1));
200 else if (rsResourceURL.endsWith(
"/A11yCheckIssuesPanel"))
204 rsResourceURL, xFrame, std::move(xPanel), ui::LayoutSize(-1,-1,-1));
212extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
214 css::uno::XComponentContext *,
215 css::uno::Sequence<css::uno::Any>
const &)
217 return cppu::acquire(
new SwPanelFactory());
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * org_apache_openoffice_comp_sw_sidebar_SwPanelFactory_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
static std::unique_ptr< PanelLayout > Create(weld::Widget *pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > &rxFrame, SfxBindings *pBindings)
Sequence< PropertyValue > aArguments
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
Reference< XFrame > xFrame