20#include <config_features.h>
35#if HAVE_FEATURE_AVMEDIA
46#include <com/sun/star/lang/XServiceInfo.hpp>
47#include <com/sun/star/ui/XSidebar.hpp>
48#include <com/sun/star/ui/XUIElementFactory.hpp>
49#include <com/sun/star/uno/XComponentContext.hpp>
52using namespace css::uno;
71 PanelFactory(
const PanelFactory&) =
delete;
72 PanelFactory& operator=(
const PanelFactory&) =
delete;
75 css::uno::Reference<css::ui::XUIElement> SAL_CALL createUIElement (
76 const OUString& rsResourceURL,
77 const ::css::uno::Sequence<css::beans::PropertyValue>& rArguments)
override;
80 {
return "org.apache.openoffice.comp.svx.sidebar.PanelFactory"; }
86 {
return {
"com.sun.star.ui.UIElementFactory"}; }
89PanelFactory::PanelFactory()
93Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
94 const OUString& rsResourceURL,
95 const ::css::uno::Sequence<css::beans::PropertyValue>& rArguments)
97 const ::comphelper::NamedValueCollection
aArguments (rArguments);
98 Reference<frame::XFrame>
xFrame (
aArguments.getOrDefault(
"Frame", Reference<frame::XFrame>()));
99 Reference<awt::XWindow> xParentWindow (
aArguments.getOrDefault(
"ParentWindow", Reference<awt::XWindow>()));
100 Reference<ui::XSidebar> xSidebar (
aArguments.getOrDefault(
"Sidebar", Reference<ui::XSidebar>()));
101 const sal_uInt64 nBindingsValue (
aArguments.getOrDefault(
"SfxBindings", sal_uInt64(0)));
106 pParent = pTunnel->getWidget();
110 "PanelFactory::createUIElement called without ParentWindow",
114 "PanelFactory::createUIElement called without Frame",
116 if (pBindings ==
nullptr)
118 "PanelFactory::createUIElement called without SfxBindings",
121 std::unique_ptr<PanelLayout> xControl;
122 ui::LayoutSize aLayoutSize (-1,-1,-1);
124 if (rsResourceURL.endsWith(
"/TextPropertyPanel"))
128 else if (rsResourceURL.endsWith(
"/StylesPropertyPanel"))
132 else if (rsResourceURL.endsWith(
"/ParaPropertyPanel"))
136 else if (rsResourceURL.endsWith(
"/ListsPropertyPanel"))
140 else if (rsResourceURL.endsWith(
"/AreaPropertyPanel"))
144 else if (rsResourceURL.endsWith(
"/FontworkPropertyPanel"))
148 else if (rsResourceURL.endsWith(
"/ShadowPropertyPanel"))
152 else if (rsResourceURL.endsWith(
"/EffectPropertyPanel"))
156 else if (rsResourceURL.endsWith(
"/GraphicPropertyPanel"))
160 else if (rsResourceURL.endsWith(
"/LinePropertyPanel"))
164 else if (rsResourceURL.endsWith(
"/PosSizePropertyPanel"))
168 else if (rsResourceURL.endsWith(
"/DefaultShapesPanel"))
172#if HAVE_FEATURE_AVMEDIA
173 else if (rsResourceURL.endsWith(
"/MediaPlaybackPanel"))
178 else if (rsResourceURL.endsWith(
"/GalleryPanel"))
180 xControl = std::make_unique<GalleryControl>(pParent);
181 aLayoutSize = ui::LayoutSize(300,-1,400);
183 else if (rsResourceURL.endsWith(
"/StyleListPanel"))
185 xControl = std::make_unique<SfxTemplatePanelControl>(pBindings, pParent);
186 aLayoutSize = ui::LayoutSize(0,-1,-1);
188 else if (rsResourceURL.endsWith(
"/EmptyPanel"))
190 xControl = std::make_unique<EmptyPanel>(pParent);
191 aLayoutSize = ui::LayoutSize(20,-1, 50);
193 else if (rsResourceURL.endsWith(
"/TextColumnsPropertyPanel"))
207 return Reference<ui::XUIElement>();
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 PanelFactory);
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * org_apache_openoffice_comp_svx_sidebar_PanelFactory_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
Sequence< PropertyValue > aArguments
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
void Create(SvxOrientationItem &rItem, SvStream &rStrm, sal_uInt16)
Reference< XFrame > xFrame