bump product version to 4.1.6.2
[LibreOffice.git] / oox / source / ppt / dgmimport.cxx
blob10d16141cc70bc216030cca88b306c809f062272
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include "oox/ppt/dgmimport.hxx"
21 #include "oox/drawingml/theme.hxx"
22 #include "oox/drawingml/diagram/diagram.hxx"
23 #include "oox/dump/pptxdumper.hxx"
25 #include <com/sun/star/drawing/XShape.hpp>
27 using namespace ::com::sun::star;
28 using namespace ::com::sun::star::uno;
29 using namespace ::com::sun::star::xml::sax;
30 using namespace oox::core;
32 namespace oox { namespace ppt {
34 OUString SAL_CALL QuickDiagrammingImport_getImplementationName() throw()
36 return OUString( "com.sun.star.comp.Impress.oox.QuickDiagrammingImport" );
39 uno::Sequence< OUString > SAL_CALL QuickDiagrammingImport_getSupportedServiceNames() throw()
41 const OUString aServiceName = "com.sun.star.comp.ooxpptx.dgm.import";
42 const Sequence< OUString > aSeq( &aServiceName, 1 );
43 return aSeq;
46 uno::Reference< uno::XInterface > SAL_CALL QuickDiagrammingImport_createInstance( const Reference< XComponentContext >& rxContext ) throw( Exception )
48 return (cppu::OWeakObject*)new QuickDiagrammingImport( rxContext );
51 QuickDiagrammingImport::QuickDiagrammingImport( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext )
52 : XmlFilterBase( rxContext )
55 bool QuickDiagrammingImport::importDocument() throw()
57 /* to activate the PPTX dumper, define the environment variable
58 OOO_PPTXDUMPER and insert the full path to the file
59 file:///<path-to-oox-module>/source/dump/pptxdumper.ini. */
60 OOX_DUMP_FILE( ::oox::dump::pptx::Dumper );
62 OUString aEmpty;
63 OUString aFragmentPath = getFragmentPathFromFirstType( CREATE_OFFICEDOC_RELATION_TYPE( "diagramLayout" ) );
65 Reference<drawing::XShapes> xParentShape(getParentShape(),
66 UNO_QUERY_THROW);
67 oox::drawingml::ShapePtr pShape(
68 new oox::drawingml::Shape( "com.sun.star.drawing.DiagramShape" ) );
69 drawingml::loadDiagram(pShape,
70 *this,
71 aEmpty,
72 aFragmentPath,
73 aEmpty,
74 aEmpty);
75 oox::drawingml::ThemePtr pTheme(
76 new oox::drawingml::Theme());
77 basegfx::B2DHomMatrix aMatrix;
78 pShape->addShape( *this,
79 pTheme.get(),
80 xParentShape,
81 aMatrix, pShape->getFillProperties() );
83 return true;
86 bool QuickDiagrammingImport::exportDocument() throw()
88 return false;
91 const ::oox::drawingml::Theme* QuickDiagrammingImport::getCurrentTheme() const
93 // TODO
94 return 0;
97 sal_Int32 QuickDiagrammingImport::getSchemeClr( sal_Int32 /*nColorSchemeToken*/ ) const
99 // TODO
100 return 0;
103 const oox::drawingml::table::TableStyleListPtr QuickDiagrammingImport::getTableStyles()
105 return oox::drawingml::table::TableStyleListPtr();
108 oox::vml::Drawing* QuickDiagrammingImport::getVmlDrawing()
110 return 0;
113 oox::drawingml::chart::ChartConverter* QuickDiagrammingImport::getChartConverter()
115 return 0;
118 OUString QuickDiagrammingImport::implGetImplementationName() const
120 return QuickDiagrammingImport_getImplementationName();
123 ::oox::ole::VbaProject* QuickDiagrammingImport::implCreateVbaProject() const
125 return 0;
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */