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>
54 #include <com/sun/star/text/textfield/Type.hpp>
62 #define QUERYINT( xint ) \
63 if( rType == cppu::UnoType<xint>::get() ) \
64 aAny <<= uno::Reference< xint >(this)
68 class SvxUnoDrawPagesAccess :
public ::cppu::WeakImplHelper< css::drawing::XDrawPages, css::lang::XServiceInfo >
77 virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL
insertNewByIndex( sal_Int32 nIndex )
override;
78 virtual void SAL_CALL
remove(
const css::uno::Reference< css::drawing::XDrawPage >& xPage )
override;
81 virtual sal_Int32 SAL_CALL
getCount()
override ;
99 { SvMacroItemId::OnMouseOver,
"OnMouseOver" },
100 { SvMacroItemId::OnMouseOut,
"OnMouseOut" },
101 { SvMacroItemId::NONE,
nullptr }
104 return aMacroDescriptionsImpl;
117 const SdrPage* pPage =
nullptr;
131 aEvent.EventName =
"PageOrderModified";
135 aEvent.EventName =
"ShapeModified";
139 aEvent.EventName =
"ShapeInserted";
143 aEvent.EventName =
"ShapeRemoved";
154 aEvent.Source =
const_cast<SdrObject*
>(pObj)->getUnoShape();
156 aEvent.Source =
const_cast<SdrPage*
>(pPage)->getUnoPage();
158 aEvent.Source =
const_cast<SdrModel*
>(pDoc)->getUnoModel();
165 css::uno::Reference<css::uno::XInterface>
create(
166 OUString
const & rServiceSpecifier, OUString
const & referer)
168 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() ) );
188 throw lang::ServiceNotRegisteredException(
"unknown service: " + rServiceSpecifier);
197 return create(rServiceSpecifier,
"");
208 if ((ServiceSpecifier ==
"com.sun.star.drawing.GraphicObjectShape"
209 || ServiceSpecifier ==
"com.sun.star.drawing.MediaShape")
210 && Arguments.getLength() == 1 && (Arguments[0] >>= arg))
212 return create(ServiceSpecifier, arg);
214 throw lang::NoSupportException();
224 OSL_ENSURE(
mpDoc,
"No SdrModel in UnoDrawingModel, should not happen");
231 css::drawing::XDrawPagesSupplier(),
232 css::lang::XServiceInfo(),
233 css::ucb::XAnyCompareFactory(),
240 mxTransGradientTable(),
255 else QUERYINT(lang::XMultiServiceFactory);
256 else QUERYINT(drawing::XDrawPagesSupplier);
257 else QUERYINT(css::ucb::XAnyCompareFactory);
281 return css::uno::Sequence<sal_Int8>();
310 if( !xDrawPages.is() )
321 if( aServiceSpecifier ==
"com.sun.star.drawing.DashTable" )
327 if( aServiceSpecifier ==
"com.sun.star.drawing.GradientTable" )
333 if( aServiceSpecifier ==
"com.sun.star.drawing.HatchTable" )
339 if( aServiceSpecifier ==
"com.sun.star.drawing.BitmapTable" )
345 if( aServiceSpecifier ==
"com.sun.star.drawing.TransparencyGradientTable" )
351 if( aServiceSpecifier ==
"com.sun.star.drawing.MarkerTable" )
357 if( aServiceSpecifier ==
"com.sun.star.text.NumberingRules" )
362 if ( aServiceSpecifier ==
"com.sun.star.image.ImageMapRectangleObject" )
367 if ( aServiceSpecifier ==
"com.sun.star.image.ImageMapCircleObject" )
372 if ( aServiceSpecifier ==
"com.sun.star.image.ImageMapPolygonObject" )
377 if( aServiceSpecifier ==
"com.sun.star.text.TextField.DateTime" )
382 uno::Reference< uno::XInterface > xRet;
384 static const OUStringLiteral aPackagePrefix(
u"com.sun.star.presentation." );
385 if( aServiceSpecifier.startsWith( aPackagePrefix ) )
390 OUString aTypeName = aServiceSpecifier.copy( aPackagePrefix.getLength() );
392 if( aTypeName.startsWith(
"TitleTextShape") )
396 else if( aTypeName.startsWith(
"OutlinerShape" ) )
400 else if( aTypeName.startsWith(
"SubtitleShape" ) )
404 else if( aTypeName.startsWith(
"GraphicObjectShape" ) )
408 else if( aTypeName.startsWith(
"PageShape" ) )
412 else if( aTypeName.startsWith(
"OLE2Shape" ) )
416 else if( aTypeName.startsWith(
"ChartShape" ) )
420 else if( aTypeName.startsWith(
"OrgChartShape" ) )
424 else if( aTypeName.startsWith(
"NotesShape" ) )
428 else if( aTypeName.startsWith(
"HandoutShape" ) )
432 else if( aTypeName.startsWith(
"FooterShape" ) )
436 else if( aTypeName.startsWith(
"HeaderShape" ) )
440 else if( aTypeName.startsWith(
"SlideNumberShape" ) )
444 else if( aTypeName.startsWith(
"DateTimeShape" ) )
448 else if( aTypeName.startsWith(
"TableShape" ) )
454 throw lang::ServiceNotRegisteredException();
459 pShape = xNewShape.get();
465 xRet =
static_cast<uno::XWeak*
>(pShape);
479 uno::Sequence< OUString > aSNS( 21 );
483 aSNS[i++] =
"com.sun.star.drawing.DashTable";
484 aSNS[i++] =
"com.sun.star.drawing.GradientTable";
485 aSNS[i++] =
"com.sun.star.drawing.HatchTable";
486 aSNS[i++] =
"com.sun.star.drawing.BitmapTable";
487 aSNS[i++] =
"com.sun.star.drawing.TransparencyGradientTable";
488 aSNS[i++] =
"com.sun.star.drawing.MarkerTable";
489 aSNS[i++] =
"com.sun.star.text.NumberingRules";
490 aSNS[i++] =
"com.sun.star.image.ImageMapRectangleObject";
491 aSNS[i++] =
"com.sun.star.image.ImageMapCircleObject";
492 aSNS[i++] =
"com.sun.star.image.ImageMapPolygonObject";
494 aSNS[i++] =
"com.sun.star.presentation.TitleTextShape";
495 aSNS[i++] =
"com.sun.star.presentation.OutlinerShape";
496 aSNS[i++] =
"com.sun.star.presentation.SubtitleShape";
497 aSNS[i++] =
"com.sun.star.presentation.GraphicObjectShape";
498 aSNS[i++] =
"com.sun.star.presentation.ChartShape";
499 aSNS[i++] =
"com.sun.star.presentation.PageShape";
500 aSNS[i++] =
"com.sun.star.presentation.OLE2Shape";
501 aSNS[i++] =
"com.sun.star.presentation.TableShape";
502 aSNS[i++] =
"com.sun.star.presentation.OrgChartShape";
503 aSNS[i++] =
"com.sun.star.presentation.NotesShape";
504 aSNS[i++] =
"com.sun.star.presentation.HandoutShape";
506 DBG_ASSERT( i == aSNS.getLength(),
"Sequence overrun!" );
514 return "SvxUnoDrawingModel";
524 return {
"com.sun.star.drawing.DrawingDocument" };
560 throw lang::IndexOutOfBoundsException();
565 uno::Reference< uno::XInterface > xPage( pPage->
mxUnoPage );
569 if( dynamic_cast<FmFormModel*>( mrModel.
mpDoc ) )
570 xPage = static_cast<drawing::XDrawPage*>(
new SvxFmDrawPage( pPage ));
572 xPage =
static_cast<drawing::XDrawPage*
>(
new SvxDrawPage( pPage ));
602 uno::Reference< drawing::XDrawPage > xDrawPage;
608 if(
auto pFormModel = dynamic_cast<FmFormModel*>( mrModel.
mpDoc ) )
613 mrModel.
mpDoc->
InsertPage( pPage.get(),
static_cast<sal_uInt16
>(nIndex) );
614 xDrawPage.set( pPage->getUnoPage(), uno::UNO_QUERY );
625 if( nPageCount <= 1 )
629 SvxDrawPage* pSvxPage = comphelper::getUnoTunnelImplementation<SvxDrawPage>( xPage );
645 return "SvxUnoDrawPagesAccess";
655 return {
"com.sun.star.drawing.DrawPages" };
676 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)
Reference< XInterface > SvUnoImageMapCircleObject_createInstance(const SvEventDescription *pSupportedMacroItems)
static rtl::Reference< SvxShape > CreateShapeByTypeAndInventor(sal_uInt16 nType, SdrInventor nInventor, SdrObject *pObj, SvxDrawPage *pPage=nullptr, OUString const &referer=OUString())
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments(const OUString &ServiceSpecifier, const css::uno::Sequence< css::uno::Any > &Arguments) override
Reference< XAnyCompare > SvxCreateNumRuleCompare()
virtual void SAL_CALL unlockControllers() override
static css::uno::Reference< css::uno::XInterface > createTextField(const OUString &aServiceSpecifier)
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)
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
SvxUnoDrawingModel(SdrModel *pDoc)
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
Polyline represented by SdrPathObj.
void SetShapeType(const OUString &ShapeType)
virtual void DeletePage(sal_uInt16 nPgNum)
virtual void SAL_CALL remove(const css::uno::Reference< css::drawing::XDrawPage > &xPage) override
SdrPage * GetSdrPage() const
#define DBG_ASSERT(sCon, aError)
css::uno::Reference< css::uno::XInterface > mxMarkerTable
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
SvxNumRule * GetNumRule() const
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
OutlineText, special text object for StarDraw.
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)
virtual ::com::sun::star::uno::Reference<::com::sun::star::uno::XInterface > SAL_CALL createInstance(const OUString &ServiceSpecifier) override
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override
SfxItemPool * GetSecondaryPool() const
#define E3D_INVENTOR_FLAG
Globals.
static sal_uInt32 getId(const OUString &rCompareString)
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes() override
virtual OUString SAL_CALL getImplementationName() override
static const SvEventDescription * ImplGetSupportedMacroItems()
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) override
#define UHASHMAP_NOTFOUND
class UHashMap
uno::Reference< uno::XInterface > SvxUnoDashTable_createInstance(SdrModel *pModel)
Create a gradienttable.
uno::Reference< uno::XInterface > SvxUnoTextCreateTextField(const OUString &ServiceSpecifier)
SvxUnoDrawPagesAccess(SvxUnoDrawingModel &rMyModel)
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
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
periodic cubic Spline (ni)
virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL insertNewByIndex(sal_Int32 nIndex) override
foreign graphic (StarView Graphic)
virtual ~SvxUnoDrawingModel() override
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId() override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(const OUString &aServiceSpecifier) override
sal_uInt16 GetPageCount() const
rtl::Reference< SvxShape > CreateSvxShapeByTypeAndInventor(sal_uInt16 nType, SdrInventor nInventor, OUString const &referer)
Creates a StarOffice API wrapper with the given type and inventor Deprecated: This will be replaced w...
const SdrObject * GetObject() const