LibreOffice Module slideshow (master) 1
shapeimporter.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19#ifndef INCLUDED_SLIDESHOW_SOURCE_INC_SHAPEIMPORTER_HXX
20#define INCLUDED_SLIDESHOW_SOURCE_INC_SHAPEIMPORTER_HXX
21
22#include <com/sun/star/drawing/XDrawPage.hpp>
23#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
24#include <com/sun/star/drawing/XShapes.hpp>
25#include <com/sun/star/beans/XPropertySet.hpp>
26#include <com/sun/star/drawing/XLayer.hpp>
27
29
30#include "unoview.hxx"
31
32#include "shape.hxx"
33
34#include <stack>
35
36namespace slideshow::internal {
37
38struct SlideShowContext;
39
40typedef std::vector< ::cppcanvas::PolyPolygonSharedPtr> PolyPolygonVector;
41typedef std::shared_ptr< UnoView > UnoViewSharedPtr;
42typedef std::vector< UnoViewSharedPtr > UnoViewVector;
43
47{
48public:
72 ShapeImporter( const css::uno::Reference< css::drawing::XDrawPage >& xPage,
73 css::uno::Reference< css::drawing::XDrawPage > xActualPage,
74 css::uno::Reference< css::drawing::XDrawPagesSupplier> xPagesSupplier,
75 const SlideShowContext& rContext,
76 sal_Int32 nOrdNumStart,
77 bool bConvertingMasterPage );
78
81 ShapeSharedPtr importBackgroundShape(); // throw (ShapeLoadFailedException)
82
87 ShapeSharedPtr importShape(); // throw (ConversionFailedException)
88
94 bool isImportDone() const;
95 const PolyPolygonVector& getPolygons() const;
96
97 double getImportedShapesCount() const{ return mnAscendingPrio; }
98private:
99 bool isSkip( css::uno::Reference<css::beans::XPropertySet> const& xPropSet,
100 std::u16string_view shapeType,
101 css::uno::Reference<css::drawing::XLayer> const& xLayer);
102
104 css::uno::Reference<css::drawing::XShape> const& xCurrShape,
105 css::uno::Reference<css::beans::XPropertySet> const& xPropSet,
106 std::u16string_view shapeType ) const;
107
108 void importPolygons(css::uno::Reference< css::beans::XPropertySet > const& xPropSet) ;
109
111 {
113 css::uno::Reference<css::drawing::XShapes> const mxShapes;
114 sal_Int32 const mnCount;
115 sal_Int32 mnPos;
116
117 explicit XShapesEntry( ShapeSharedPtr const& pGroupShape )
118 : mpGroupShape(pGroupShape),
119 mxShapes( pGroupShape->getXShape(),
120 css::uno::UNO_QUERY_THROW ),
121 mnCount(mxShapes->getCount()), mnPos(0) {}
122 explicit XShapesEntry( css::uno::Reference<
123 css::drawing::XShapes> const& xShapes )
124 : mpGroupShape(), mxShapes(xShapes),
125 mnCount(xShapes->getCount()), mnPos(0) {}
126 };
127
128 css::uno::Reference<css::drawing::XDrawPage> mxPage;
129 css::uno::Reference<css::drawing::XDrawPagesSupplier> mxPagesSupplier;
132 ::std::stack<XShapesEntry> maShapesStack;
135};
136
137} // namespace presentation::internal
138
139#endif
140
141/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class imports all shapes from a given XShapes object.
const PolyPolygonVector & getPolygons() const
bool isSkip(css::uno::Reference< css::beans::XPropertySet > const &xPropSet, std::u16string_view shapeType, css::uno::Reference< css::drawing::XLayer > const &xLayer)
ShapeSharedPtr importShape()
This method imports presentation-visible shapes (and skips all others).
ShapeImporter(const css::uno::Reference< css::drawing::XDrawPage > &xPage, css::uno::Reference< css::drawing::XDrawPage > xActualPage, css::uno::Reference< css::drawing::XDrawPagesSupplier > xPagesSupplier, const SlideShowContext &rContext, sal_Int32 nOrdNumStart, bool bConvertingMasterPage)
Create shape importer.
const SlideShowContext & mrContext
bool isImportDone() const
Test whether import is done.
css::uno::Reference< css::drawing::XDrawPagesSupplier > mxPagesSupplier
::std::stack< XShapesEntry > maShapesStack
ShapeSharedPtr importBackgroundShape()
This method imports the presentation background shape.
css::uno::Reference< css::drawing::XDrawPage > mxPage
void importPolygons(css::uno::Reference< css::beans::XPropertySet > const &xPropSet)
ShapeSharedPtr createShape(css::uno::Reference< css::drawing::XShape > const &xCurrShape, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, std::u16string_view shapeType) const
::std::vector< ::cppcanvas::PolyPolygonSharedPtr > PolyPolygonVector
std::vector< UnoViewSharedPtr > UnoViewVector
::std::shared_ptr< Shape > ShapeSharedPtr
std::shared_ptr< UnoView > UnoViewSharedPtr
css::uno::Reference< css::drawing::XShapes > const mxShapes
XShapesEntry(ShapeSharedPtr const &pGroupShape)
XShapesEntry(css::uno::Reference< css::drawing::XShapes > const &xShapes)
Common arguments for slideshow objects.