20 #include <com/sun/star/ui/XUIElementFactory.hpp>
36 #include <com/sun/star/lang/XServiceInfo.hpp>
37 #include <com/sun/star/uno/XComponentContext.hpp>
49 css::ui::XUIElementFactory, css::lang::XServiceInfo
52 class SwPanelFactory final :
public PanelFactoryInterfaceBase
55 SwPanelFactory(SwPanelFactory
const&) =
delete;
56 SwPanelFactory& operator=(SwPanelFactory
const&) =
delete;
62 css::uno::Reference<css::ui::XUIElement> SAL_CALL createUIElement(
63 const OUString& rsResourceURL,
64 const css::uno::Sequence<css::beans::PropertyValue>& rArguments)
override;
67 {
return "org.apache.openoffice.comp.sw.sidebar.SwPanelFactory"; }
73 {
return {
"com.sun.star.ui.UIElementFactory"}; }
76 SwPanelFactory::SwPanelFactory()
80 Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
81 const OUString& rsResourceURL,
82 const css::uno::Sequence<css::beans::PropertyValue>& rArguments)
84 Reference<ui::XUIElement> xElement;
86 const ::comphelper::NamedValueCollection
aArguments (rArguments);
87 Reference<frame::XFrame>
xFrame (
aArguments.getOrDefault(
"Frame", Reference<frame::XFrame>()));
88 Reference<awt::XWindow> xParentWindow (
aArguments.getOrDefault(
"ParentWindow", Reference<awt::XWindow>()));
89 const sal_uInt64 nBindingsValue (
aArguments.getOrDefault(
"SfxBindings", sal_uInt64(0)));
94 pParent = pTunnel->getWidget();
98 "PanelFactory::createUIElement called without ParentWindow",
102 "PanelFactory::createUIElement called without Frame",
104 if (pBindings ==
nullptr)
106 "PanelFactory::createUIElement called without SfxBindings",
109 if(rsResourceURL.endsWith(
"/PageStylesPanel"))
116 ui::LayoutSize(-1,-1,-1));
118 else if(rsResourceURL.endsWith(
"/PageFormatPanel"))
125 ui::LayoutSize(-1,-1,-1));
127 else if(rsResourceURL.endsWith(
"/PageHeaderPanel"))
134 ui::LayoutSize(-1,-1,-1));
136 else if(rsResourceURL.endsWith(
"/PageFooterPanel"))
143 ui::LayoutSize(-1,-1,-1));
145 else if (rsResourceURL.endsWith(
"/WrapPropertyPanel"))
152 ui::LayoutSize(-1,-1,-1));
154 else if (rsResourceURL.endsWith(
"/NavigatorPanel"))
161 ui::LayoutSize(0,-1,-1));
163 else if (rsResourceURL.endsWith(
"/ManageChangesPanel"))
165 auto xPanel = std::make_unique<SwRedlineAcceptPanel>(pParent);
170 ui::LayoutSize(0,-1,-1));
172 else if (rsResourceURL.endsWith(
"/WriterInspectorTextPanel"))
179 ui::LayoutSize(0,-1,-1));
181 else if (rsResourceURL.endsWith(
"/StylePresetsPanel"))
185 rsResourceURL, xFrame, std::move(xPanel), ui::LayoutSize(-1,-1,-1));
187 else if (rsResourceURL.endsWith(
"/ThemePanel"))
191 rsResourceURL, xFrame, std::move(xPanel), ui::LayoutSize(-1,-1,-1));
193 else if (rsResourceURL.endsWith(
"/TableEditPanel"))
197 rsResourceURL, xFrame, std::move(xPanel), ui::LayoutSize(-1,-1,-1));
205 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
207 css::uno::XComponentContext *,
208 css::uno::Sequence<css::uno::Any>
const &)
210 return cppu::acquire(
new SwPanelFactory());
static std::unique_ptr< PanelLayout > Create(weld::Widget *pParent, const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > &rxFrame, SfxBindings *pBindings)
Reference< XFrame > xFrame
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
Sequence< PropertyValue > aArguments
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
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 &)