22 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
23 #include <com/sun/star/lang/ServiceNotRegisteredException.hpp>
24 #include <com/sun/star/lang/NoSupportException.hpp>
25 #include <com/sun/star/drawing/XShape.hpp>
55 #include <com/sun/star/text/textfield/Type.hpp>
63 #define QUERYINT( xint ) \
64 if( rType == cppu::UnoType<xint>::get() ) \
65 aAny <<= uno::Reference< xint >(this)
69 class SvxUnoDrawPagesAccess :
public ::cppu::WeakImplHelper< css::drawing::XDrawPages, css::lang::XServiceInfo >
78 virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL
insertNewByIndex( sal_Int32 nIndex )
override;
79 virtual void SAL_CALL
remove(
const css::uno::Reference< css::drawing::XDrawPage >& xPage )
override;
82 virtual sal_Int32 SAL_CALL
getCount()
override ;
100 { SvMacroItemId::OnMouseOver,
"OnMouseOver" },
101 { SvMacroItemId::OnMouseOut,
"OnMouseOut" },
102 { SvMacroItemId::NONE,
nullptr }
105 return aMacroDescriptionsImpl;
118 const SdrPage* pPage =
nullptr;
132 aEvent.EventName =
"PageOrderModified";
136 aEvent.EventName =
"ShapeModified";
140 aEvent.EventName =
"ShapeInserted";
144 aEvent.EventName =
"ShapeRemoved";
155 aEvent.Source =
const_cast<SdrObject*
>(pObj)->getUnoShape();
157 aEvent.Source =
const_cast<SdrPage*
>(pPage)->getUnoPage();
159 aEvent.Source =
const_cast<SdrModel*
>(pDoc)->getUnoModel();
166 css::uno::Reference<css::uno::XInterface>
create(
167 OUString
const & rServiceSpecifier, OUString
const & referer)
169 if( rServiceSpecifier.startsWith(
"com.sun.star.drawing.") )
179 else if (rServiceSpecifier ==
"com.sun.star.document.ImportGraphicStorageHandler")
182 uno::Reference< uno::XInterface> xRet( static_cast< ::cppu::OWeakObject* >( pGraphicHelper.get() ) );
185 else if (rServiceSpecifier ==
"com.sun.star.text.TextColumns")
192 throw lang::ServiceNotRegisteredException(
"unknown service: " + rServiceSpecifier);
201 return create(rServiceSpecifier,
"");
212 if ((ServiceSpecifier ==
"com.sun.star.drawing.GraphicObjectShape"
213 || ServiceSpecifier ==
"com.sun.star.drawing.MediaShape")
214 && Arguments.getLength() == 1 && (Arguments[0] >>= arg))
216 return create(ServiceSpecifier, arg);
218 throw lang::NoSupportException();
228 OSL_ENSURE(
mpDoc,
"No SdrModel in UnoDrawingModel, should not happen");
247 else QUERYINT(lang::XMultiServiceFactory);
248 else QUERYINT(drawing::XDrawPagesSupplier);
249 else QUERYINT(css::ucb::XAnyCompareFactory);
273 return css::uno::Sequence<sal_Int8>();
302 if( !xDrawPages.is() )
313 if( aServiceSpecifier ==
"com.sun.star.drawing.DashTable" )
319 if( aServiceSpecifier ==
"com.sun.star.drawing.GradientTable" )
325 if( aServiceSpecifier ==
"com.sun.star.drawing.HatchTable" )
331 if( aServiceSpecifier ==
"com.sun.star.drawing.BitmapTable" )
337 if( aServiceSpecifier ==
"com.sun.star.drawing.TransparencyGradientTable" )
343 if( aServiceSpecifier ==
"com.sun.star.drawing.MarkerTable" )
349 if( aServiceSpecifier ==
"com.sun.star.text.NumberingRules" )
354 if ( aServiceSpecifier ==
"com.sun.star.image.ImageMapRectangleObject" )
359 if ( aServiceSpecifier ==
"com.sun.star.image.ImageMapCircleObject" )
364 if ( aServiceSpecifier ==
"com.sun.star.image.ImageMapPolygonObject" )
369 if( aServiceSpecifier ==
"com.sun.star.text.TextField.DateTime" )
374 uno::Reference< uno::XInterface > xRet;
376 static const OUStringLiteral aPackagePrefix(
u"com.sun.star.presentation." );
377 if( aServiceSpecifier.startsWith( aPackagePrefix ) )
382 std::u16string_view aTypeName = aServiceSpecifier.subView( aPackagePrefix.getLength() );
446 throw lang::ServiceNotRegisteredException();
451 pShape = xNewShape.get();
457 xRet =
static_cast<uno::XWeak*
>(pShape);
471 uno::Sequence< OUString > aSNS{
472 "com.sun.star.drawing.DashTable",
473 "com.sun.star.drawing.GradientTable",
474 "com.sun.star.drawing.HatchTable",
475 "com.sun.star.drawing.BitmapTable",
476 "com.sun.star.drawing.TransparencyGradientTable",
477 "com.sun.star.drawing.MarkerTable",
478 "com.sun.star.text.NumberingRules",
479 "com.sun.star.image.ImageMapRectangleObject",
480 "com.sun.star.image.ImageMapCircleObject",
481 "com.sun.star.image.ImageMapPolygonObject",
483 "com.sun.star.presentation.TitleTextShape",
484 "com.sun.star.presentation.OutlinerShape",
485 "com.sun.star.presentation.SubtitleShape",
486 "com.sun.star.presentation.GraphicObjectShape",
487 "com.sun.star.presentation.ChartShape",
488 "com.sun.star.presentation.PageShape",
489 "com.sun.star.presentation.OLE2Shape",
490 "com.sun.star.presentation.TableShape",
491 "com.sun.star.presentation.OrgChartShape",
492 "com.sun.star.presentation.NotesShape",
493 "com.sun.star.presentation.HandoutShape"
502 return "SvxUnoDrawingModel";
512 return {
"com.sun.star.drawing.DrawingDocument" };
548 throw lang::IndexOutOfBoundsException();
553 uno::Reference< uno::XInterface > xPage( pPage->
mxUnoPage );
558 xPage = static_cast<drawing::XDrawPage*>(
new SvxFmDrawPage( pPage ));
560 xPage =
static_cast<drawing::XDrawPage*
>(
new SvxDrawPage( pPage ));
590 uno::Reference< drawing::XDrawPage > xDrawPage;
596 if(
auto pFormModel = dynamic_cast<FmFormModel*>(
mrModel.
mpDoc ) )
602 xDrawPage.set( pPage->getUnoPage(), uno::UNO_QUERY );
613 if( nPageCount <= 1 )
617 SvxDrawPage* pSvxPage = comphelper::getFromUnoTunnel<SvxDrawPage>( xPage );
633 return "SvxUnoDrawPagesAccess";
643 return {
"com.sun.star.drawing.DrawPages" };
664 SvxNumRule aTempRule( SvxNumRuleFlags::NONE, 10,
false );
css::uno::Reference< css::uno::XInterface > mxDashTable
virtual OUString SAL_CALL getImplementationName() override
css::uno::WeakReference< css::drawing::XDrawPages > mxDrawPagesAccess
static bool createEvent(const SdrModel *pDoc, const SdrHint *pSdrHint, css::document::EventObject &aEvent)
fills the given EventObject from the given SdrHint.
SdrHintKind GetKind() const
virtual void SAL_CALL lockControllers() override
friend class SvxUnoDrawPagesAccess
const SfxPoolItem * GetPoolDefaultItem(sal_uInt16 nWhich) const
uno::Reference< uno::XInterface > SvxUnoMarkerTable_createInstance(SdrModel *pModel)
Create a hatchtable.
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual void InsertPage(SdrPage *pPage, sal_uInt16 nPos=0xFFFF)
Reference< XInterface > SvUnoImageMapRectangleObject_createInstance(const SvEventDescription *pSupportedMacroItems)
periodic cubic Spline (ni)
Reference< XInterface > SvUnoImageMapCircleObject_createInstance(const SvEventDescription *pSupportedMacroItems)
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments(const OUString &ServiceSpecifier, const css::uno::Sequence< css::uno::Any > &Arguments) override
virtual ~SvxUnoDrawingModel() noexcept override
css::uno::Reference< css::uno::XInterface > SvxXTextColumns_createInstance() noexcept
virtual void SAL_CALL unlockControllers() override
constexpr bool starts_with(std::basic_string_view< charT, traits > sv, std::basic_string_view< charT, traits > x) noexcept
css::uno::Reference< css::container::XIndexReplace > SvxCreateNumRule(SdrModel *pModel)
virtual sal_Int32 SAL_CALL getCount() override
virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override
uno::Reference< uno::XInterface > SvxUnoHatchTable_createInstance(SdrModel *pModel)
Create a hatchtable.
css::uno::Reference< css::uno::XInterface > mxUnoPage
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
constexpr bool IsInventorE3D(SdrObjKind e)
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(const OUString &aServiceSpecifier) override
virtual css::uno::Reference< css::drawing::XDrawPages > SAL_CALL getDrawPages() override
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
Reference< deployment::XPackageRegistry > create(Reference< deployment::XPackageRegistry > const &xRootRegistry, OUString const &context, OUString const &cachePath, Reference< XComponentContext > const &xComponentContext)
css::uno::Sequence< css::uno::Type > maTypeSequence
void SetShapeType(const OUString &ShapeType)
virtual void DeletePage(sal_uInt16 nPgNum)
foreign graphic (StarView Graphic)
virtual void SAL_CALL remove(const css::uno::Reference< css::drawing::XDrawPage > &xPage) override
SdrPage * GetSdrPage() const
css::uno::Reference< css::uno::XInterface > mxMarkerTable
const SvxNumRule & GetNumRule() const
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual css::uno::Reference< css::ucb::XAnyCompare > SAL_CALL createAnyCompareByName(const OUString &PropertyName) override
virtual css::uno::Type SAL_CALL getElementType() override
css::uno::Reference< css::uno::XInterface > mxBitmapTable
const SdrPage * GetPage(sal_uInt16 nPgNum) const
uno::Reference< uno::XInterface > SvxUnoTransGradientTable_createInstance(SdrModel *pModel)
Create a hatchtable.
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
css::uno::Reference< css::uno::XInterface > mxHatchTable
SvxUnoDrawingModel & mrModel
css::uno::Type const & get()
uno::Reference< uno::XInterface > SvxUnoBitmapTable_createInstance(SdrModel *pModel)
Create a bitmaptable.
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
static css::uno::Sequence< OUString > getServiceNames()
css::uno::Sequence< T > concatSequences(const css::uno::Sequence< T > &rS1, const Ss &...rSn)
Polyline represented by SdrPathObj.
virtual ::com::sun::star::uno::Reference<::com::sun::star::uno::XInterface > SAL_CALL createInstance(const OUString &ServiceSpecifier) override
static rtl::Reference< SvxShape > CreateShapeByTypeAndInventor(SdrObjKind nType, SdrInventor nInventor, SdrObject *pObj, SvxDrawPage *pPage=nullptr, OUString const &referer=OUString())
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override
SfxItemPool * GetSecondaryPool() const
static css::uno::Reference< css::uno::XInterface > createTextField(std::u16string_view aServiceSpecifier)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual OUString SAL_CALL getImplementationName() override
static const SvEventDescription * ImplGetSupportedMacroItems()
Reference< XAnyCompare > SvxCreateNumRuleCompare() noexcept
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
uno::Reference< uno::XInterface > SvxUnoDashTable_createInstance(SdrModel *pModel)
Create a gradienttable.
SvxUnoDrawingModel(SdrModel *pDoc) noexcept
css::uno::Reference< css::uno::XInterface > mxTransGradientTable
virtual sal_Bool SAL_CALL hasControllersLocked() override
uno::Reference< uno::XInterface > SvxUnoGradientTable_createInstance(SdrModel *pModel)
Create a gradienttable.
const SfxItemPool & GetItemPool() const
const SdrPage * GetPage() const
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
constexpr TypedWhichId< SvxNumBulletItem > EE_PARA_NUMBULLET(EE_PARA_START+5)
static rtl::Reference< SvXMLGraphicHelper > Create(const css::uno::Reference< css::embed::XStorage > &rXMLStorage, SvXMLGraphicHelperMode eCreateMode)
virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override
static std::optional< SdrObjKind > getId(const OUString &rCompareString)
rtl::Reference< SvxShape > CreateSvxShapeByTypeAndInventor(SdrObjKind nType, SdrInventor nInventor, OUString const &referer)
Creates a StarOffice API wrapper with the given type and inventor Deprecated: This will be replaced w...
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 Index) override
virtual SdrModel & getSdrModelFromUnoModel() const override
abstract SdrModel provider
css::uno::Reference< css::uno::XInterface > mxGradientTable
sal_uInt16 GetPageNum() const
Reference< XInterface > SvUnoImageMapPolygonObject_createInstance(const SvEventDescription *pSupportedMacroItems)
virtual sal_Bool SAL_CALL hasElements() override
SvxUnoDrawPagesAccess(SvxUnoDrawingModel &rMyModel) noexcept
virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL insertNewByIndex(sal_Int32 nIndex) override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
uno::Reference< uno::XInterface > SvxUnoTextCreateTextField(std::u16string_view ServiceSpecifier)
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(const OUString &aServiceSpecifier) override
sal_uInt16 GetPageCount() const
OutlineText, special text object for StarDraw.
const SdrObject * GetObject() const