LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/oox/source/shape - ShapeContextHandler.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 4 4 100.0 %
Date: 2013-07-09 Functions: 3 3 100.0 %
Legend: Lines: hit not hit

          Line data    Source code
       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 OOX_SHAPE_SHAPE_CONTEXT_HANDLER_HXX
      20             : #define OOX_SHAPE_SHAPE_CONTEXT_HANDLER_HXX
      21             : 
      22             : #include <boost/shared_ptr.hpp>
      23             : #include <com/sun/star/uno/XComponentContext.hpp>
      24             : #include <cppuhelper/implbase1.hxx>
      25             : #include <com/sun/star/xml/sax/XFastShapeContextHandler.hpp>
      26             : #include "oox/drawingml/graphicshapecontext.hxx"
      27             : #include "oox/drawingml/shape.hxx"
      28             : #include "oox/drawingml/theme.hxx"
      29             : #include "oox/core/fragmenthandler2.hxx"
      30             : #include "oox/core/xmlfilterbase.hxx"
      31             : #include "ShapeFilterBase.hxx"
      32             : 
      33             : namespace oox { namespace shape {
      34             : 
      35           6 : class ShapeFragmentHandler : public core::FragmentHandler2
      36             : {
      37             : public:
      38             :     typedef boost::shared_ptr<ShapeFragmentHandler> Pointer_t;
      39             : 
      40          18 :     explicit ShapeFragmentHandler(core::XmlFilterBase& rFilter,
      41             :                                   const OUString& rFragmentPath )
      42          18 :     : FragmentHandler2(rFilter, rFragmentPath)
      43             :     {
      44          18 :     }
      45             : };
      46             : 
      47             : class ShapeContextHandler:
      48             :     public ::cppu::WeakImplHelper1<
      49             :         css::xml::sax::XFastShapeContextHandler>
      50             : {
      51             : public:
      52             :     explicit ShapeContextHandler
      53             :     (css::uno::Reference< css::uno::XComponentContext > const & context);
      54             : 
      55             :     virtual ~ShapeContextHandler();
      56             : 
      57             :     // ::com::sun::star::lang::XServiceInfo:
      58             :     virtual OUString SAL_CALL getImplementationName()
      59             :         throw (css::uno::RuntimeException);
      60             : 
      61             :     virtual ::sal_Bool SAL_CALL supportsService
      62             :     (const OUString & ServiceName) throw (css::uno::RuntimeException);
      63             : 
      64             :     virtual css::uno::Sequence< OUString > SAL_CALL
      65             :     getSupportedServiceNames() throw (css::uno::RuntimeException);
      66             : 
      67             :     // ::com::sun::star::xml::sax::XFastContextHandler:
      68             :     virtual void SAL_CALL startFastElement
      69             :     (::sal_Int32 Element,
      70             :      const css::uno::Reference< css::xml::sax::XFastAttributeList > & Attribs)
      71             :         throw (css::uno::RuntimeException, css::xml::sax::SAXException);
      72             : 
      73             :     virtual void SAL_CALL startUnknownElement
      74             :     (const OUString & Namespace,
      75             :      const OUString & Name,
      76             :      const css::uno::Reference< css::xml::sax::XFastAttributeList > & Attribs)
      77             :         throw (css::uno::RuntimeException, css::xml::sax::SAXException);
      78             : 
      79             :     virtual void SAL_CALL endFastElement(::sal_Int32 Element)
      80             :         throw (css::uno::RuntimeException, css::xml::sax::SAXException);
      81             : 
      82             :     virtual void SAL_CALL endUnknownElement
      83             :     (const OUString & Namespace,
      84             :      const OUString & Name)
      85             :         throw (css::uno::RuntimeException, css::xml::sax::SAXException);
      86             : 
      87             :     virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL
      88             :     createFastChildContext
      89             :     (::sal_Int32 Element,
      90             :      const css::uno::Reference< css::xml::sax::XFastAttributeList > & Attribs)
      91             :         throw (css::uno::RuntimeException, css::xml::sax::SAXException);
      92             : 
      93             :     virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL
      94             :     createUnknownChildContext
      95             :     (const OUString & Namespace,
      96             :      const OUString & Name,
      97             :      const css::uno::Reference< css::xml::sax::XFastAttributeList > & Attribs)
      98             :         throw (css::uno::RuntimeException, css::xml::sax::SAXException);
      99             : 
     100             :     virtual void SAL_CALL characters(const OUString & aChars)
     101             :         throw (css::uno::RuntimeException, css::xml::sax::SAXException);
     102             : 
     103             :     // ::com::sun::star::xml::sax::XFastShapeContextHandler:
     104             :     virtual css::uno::Reference< css::drawing::XShape > SAL_CALL getShape()
     105             :         throw (css::uno::RuntimeException);
     106             : 
     107             :     virtual css::uno::Reference< css::drawing::XDrawPage > SAL_CALL getDrawPage()
     108             :         throw (css::uno::RuntimeException);
     109             : 
     110             :     virtual void SAL_CALL setDrawPage
     111             :     (const css::uno::Reference< css::drawing::XDrawPage > & the_value)
     112             :         throw (css::uno::RuntimeException);
     113             : 
     114             :     virtual css::uno::Reference< css::frame::XModel > SAL_CALL getModel()
     115             :         throw (css::uno::RuntimeException);
     116             : 
     117             :     virtual void SAL_CALL setModel
     118             :     (const css::uno::Reference< css::frame::XModel > & the_value)
     119             :         throw (css::uno::RuntimeException);
     120             : 
     121             :     virtual css::uno::Reference< css::io::XInputStream > SAL_CALL
     122             :     getInputStream() throw (css::uno::RuntimeException);
     123             : 
     124             :     virtual void SAL_CALL setInputStream
     125             :     (const css::uno::Reference< css::io::XInputStream > & the_value)
     126             :         throw (css::uno::RuntimeException);
     127             : 
     128             :     virtual OUString SAL_CALL getRelationFragmentPath()
     129             :         throw (css::uno::RuntimeException);
     130             :     virtual void SAL_CALL setRelationFragmentPath
     131             :     (const OUString & the_value)
     132             :         throw (css::uno::RuntimeException);
     133             : 
     134             :     virtual ::sal_Int32 SAL_CALL getStartToken() throw (::com::sun::star::uno::RuntimeException);
     135             :     virtual void SAL_CALL setStartToken( ::sal_Int32 _starttoken ) throw (::com::sun::star::uno::RuntimeException);
     136             : 
     137             : private:
     138             :     ShapeContextHandler(ShapeContextHandler &); // not defined
     139             :     void operator =(ShapeContextHandler &); // not defined
     140             : 
     141             :     ::sal_uInt32 mnStartToken;
     142             : 
     143             :     css::uno::Reference< css::uno::XComponentContext > m_xContext;
     144             :     drawingml::ShapePtr mpShape;
     145             :     ::boost::shared_ptr< vml::Drawing > mpDrawing;
     146             : 
     147             :     typedef boost::shared_ptr<drawingml::GraphicShapeContext>
     148             :     GraphicShapeContextPtr;
     149             :     css::uno::Reference<XFastContextHandler> mxDrawingFragmentHandler;
     150             :     css::uno::Reference<XFastContextHandler> mxGraphicShapeContext;
     151             :     css::uno::Reference<XFastContextHandler> mxDiagramShapeContext;
     152             :     css::uno::Reference<XFastContextHandler> mxLockedCanvasContext;
     153             : 
     154             :     core::XmlFilterRef mxFilterBase;
     155             :     drawingml::ThemePtr mpThemePtr;
     156             :     css::uno::Reference<css::drawing::XDrawPage> mxDrawPage;
     157             :     css::uno::Reference<css::io::XInputStream> mxInputStream;
     158             :     OUString msRelationFragmentPath;
     159             : 
     160             :     css::uno::Reference<XFastContextHandler> getGraphicShapeContext(::sal_Int32 Element);
     161             :     css::uno::Reference<XFastContextHandler> getDrawingShapeContext();
     162             :     css::uno::Reference<XFastContextHandler> getDiagramShapeContext();
     163             :     css::uno::Reference<XFastContextHandler> getLockedCanvasContext(sal_Int32 nElement);
     164             :     css::uno::Reference<XFastContextHandler> getContextHandler();
     165             : };
     166             : 
     167             : }}
     168             : 
     169             : #endif // OOX_SHAPE_SHAPE_CONTEXT_HANDLER_HXX
     170             : 
     171             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10