LCOV - code coverage report
Current view: top level - usr/local/src/libreoffice/include/oox/export - drawingml.hxx (source / functions) Hit Total Coverage
Test: libreoffice_filtered.info Lines: 6 6 100.0 %
Date: 2013-07-09 Functions: 6 6 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             : 
      20             : #ifndef _OOX_EXPORT_DRAWINGML_HXX_
      21             : #define _OOX_EXPORT_DRAWINGML_HXX_
      22             : 
      23             : #include <oox/dllapi.h>
      24             : #include <sax/fshelper.hxx>
      25             : #include <rtl/strbuf.hxx>
      26             : #include <com/sun/star/awt/FontDescriptor.hpp>
      27             : #include <com/sun/star/uno/XReference.hpp>
      28             : #include <tools/poly.hxx>
      29             : #include <filter/msfilter/escherex.hxx>
      30             : #ifndef PPTX_EXPORT_ROTATE_CLOCKWISIFY
      31             : #define PPTX_EXPORT_ROTATE_CLOCKWISIFY(input) ((21600000-input*600)%21600000)
      32             : #endif
      33             : 
      34             : class Graphic;
      35             : class String;
      36             : 
      37             : namespace com { namespace sun { namespace star {
      38             : namespace beans {
      39             :     class XPropertySet;
      40             :     class XPropertyState;
      41             : }
      42             : namespace drawing {
      43             :     class XShape;
      44             : }
      45             : namespace style {
      46             :     struct LineSpacing;
      47             : }
      48             : namespace text {
      49             :     class XTextContent;
      50             :     class XTextRange;
      51             : }
      52             : namespace io {
      53             :     class XOutputStream;
      54             : }
      55             : }}}
      56             : 
      57             : namespace oox {
      58             : namespace core {
      59             :     class XmlFilterBase;
      60             : }
      61             : 
      62             : namespace drawingml {
      63             : 
      64          50 : class OOX_DLLPUBLIC DrawingML {
      65             : public:
      66             :     enum DocumentType { DOCUMENT_DOCX, DOCUMENT_PPTX, DOCUMENT_XLSX };
      67             : 
      68             : private:
      69             :     static int mnImageCounter;
      70             : 
      71             :     /// To specify where write eg. the images to (like 'ppt', or 'word' - according to the OPC).
      72             :     DocumentType meDocumentType;
      73             : 
      74             : protected:
      75             :     ::com::sun::star::uno::Any mAny;
      76             :     ::sax_fastparser::FSHelperPtr mpFS;
      77             :     ::oox::core::XmlFilterBase* mpFB;
      78             : 
      79             :     bool GetProperty( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, OUString aName );
      80             :     bool GetPropertyAndState( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet,
      81             :                   ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState > rXPropState,
      82             :                   String aName, ::com::sun::star::beans::PropertyState& eState );
      83             :     const char* GetFieldType( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > rRun, sal_Bool& bIsField );
      84             : 
      85             :     OUString WriteImage( const OUString& rURL );
      86             : 
      87             :     const char* GetComponentDir();
      88             :     const char* GetRelationCompPrefix();
      89             : 
      90             : public:
      91          50 :     DrawingML( ::sax_fastparser::FSHelperPtr pFS, ::oox::core::XmlFilterBase* pFB = NULL, DocumentType eDocumentType = DOCUMENT_PPTX ) : meDocumentType( eDocumentType ), mpFS( pFS ), mpFB( pFB ) {}
      92           4 :     void SetFS( ::sax_fastparser::FSHelperPtr pFS ) { mpFS = pFS; }
      93          47 :     ::sax_fastparser::FSHelperPtr GetFS() { return mpFS; }
      94          12 :     ::oox::core::XmlFilterBase* GetFB() { return mpFB; }
      95           4 :     DocumentType GetDocumentType() { return meDocumentType; }
      96             : 
      97             :     OUString WriteImage( const Graphic &rGraphic );
      98             : 
      99             :     void WriteColor( sal_uInt32 nColor );
     100             :     void WriteGradientStop( sal_uInt16 nStop, sal_uInt32 nColor );
     101             :     void WriteLineArrow( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, sal_Bool bLineStart );
     102             :     void WriteConnectorConnections( EscherConnectorListEntry& rConnectorEntry, sal_Int32 nStartID, sal_Int32 nEndID );
     103             : 
     104             :     void WriteSolidFill( sal_uInt32 nColor );
     105             :     void WriteSolidFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet );
     106             :     void WriteGradientFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet );
     107             :     void WriteBlipFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, OUString sURLPropName, sal_Int32 nXmlNamespace );
     108             :     void WriteBlipFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, OUString sURLPropName );
     109             :     void WriteSrcRect( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >, const OUString& );
     110             :     void WriteOutline( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet );
     111             :     void WriteStretch();
     112             :     void WriteLinespacing( ::com::sun::star::style::LineSpacing& rLineSpacing );
     113             : 
     114             :     OUString WriteBlip( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet, OUString& rURL, const Graphic *pGraphic=NULL );
     115             :     void WriteBlipMode( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet );
     116             : 
     117             :     void WriteShapeTransformation( ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShape > rXShape,
     118             :                   sal_Int32 nXmlNamespace, sal_Bool bFlipH = false, sal_Bool bFlipV = false, sal_Bool bSuppressRotation = false );
     119             :     void WriteTransformation( const Rectangle& rRectangle,
     120             :                   sal_Int32 nXmlNamespace, sal_Bool bFlipH = false, sal_Bool bFlipV = false, sal_Int32 nRotation = 0 );
     121             : 
     122             :     void WriteText( ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > rXIface );
     123             :     void WriteParagraph( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > rParagraph );
     124             :     void WriteParagraphProperties( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextContent > rParagraph );
     125             :     void WriteParagraphNumbering( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rXPropSet,
     126             :                                   sal_Int16 nLevel );
     127             :     void WriteRun( ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > rRun );
     128             :     void WriteRunProperties( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > rRun, sal_Bool bIsField );
     129             : 
     130             :     void WritePresetShape( const char* pShape );
     131             :     void WritePresetShape( const char* pShape, MSO_SPT eShapeType, sal_Bool bPredefinedHandlesUsed, sal_Int32 nAdjustmentsWhichNeedsToBeConverted, const ::com::sun::star::beans::PropertyValue& rProp );
     132             :     void WritePolyPolygon( const PolyPolygon& rPolyPolygon );
     133             :     void WriteFill( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xPropSet );
     134             : 
     135             :     static void ResetCounters();
     136             : 
     137             :     void GetUUID( OStringBuffer& rBuffer );
     138             : 
     139             :     static sal_Unicode SubstituteBullet( sal_Unicode cBulletId, ::com::sun::star::awt::FontDescriptor& rFontDesc );
     140             : 
     141             :     sal_uInt32 ColorWithIntensity( sal_uInt32 nColor, sal_uInt32 nIntensity );
     142             : 
     143             :     static const char* GetAlignment( sal_Int32 nAlignment );
     144             : 
     145             :     sax_fastparser::FSHelperPtr     CreateOutputStream (
     146             :                                         const OUString& sFullStream,
     147             :                                         const OUString& sRelativeStream,
     148             :                                         const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xParentRelation,
     149             :                                         const char* sContentType,
     150             :                                         const char* sRelationshipType,
     151             :                                         OUString* pRelationshipId = NULL );
     152             : 
     153             : };
     154             : 
     155             : }
     156             : }
     157             : 
     158             : #endif
     159             : 
     160             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10