LCOV - code coverage report
Current view: top level - include/oox/ole - olehelper.hxx (source / functions) Hit Total Coverage
Test: commit c8344322a7af75b84dd3ca8f78b05543a976dfd5 Lines: 1 2 50.0 %
Date: 2015-06-13 12:38:46 Functions: 3 4 75.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 INCLUDED_OOX_OLE_OLEHELPER_HXX
      21             : #define INCLUDED_OOX_OLE_OLEHELPER_HXX
      22             : 
      23             : #include <rtl/ustring.hxx>
      24             : #include <tools/ref.hxx>
      25             : #include <oox/helper/binarystreambase.hxx>
      26             : #include <oox/helper/storagebase.hxx>
      27             : #include <oox/helper/graphichelper.hxx>
      28             : #include <com/sun/star/form/XFormComponent.hpp>
      29             : #include <com/sun/star/uno/XComponentContext.hpp>
      30             : #include <com/sun/star/lang/XMultiServiceFactory.hpp>
      31             : #include <com/sun/star/frame/XModel.hpp>
      32             : #include <com/sun/star/frame/XFrame.hpp>
      33             : #include <com/sun/star/drawing/XShapes.hpp>
      34             : #include <com/sun/star/awt/XControlModel.hpp>
      35             : #include <com/sun/star/io/XInputStream.hpp>
      36             : #include <com/sun/star/io/XOutputStream.hpp>
      37             : #include <com/sun/star/drawing/XDrawPage.hpp>
      38             : #include <com/sun/star/container/XIndexContainer.hpp>
      39             : #include <filter/msfilter/msocximex.hxx>
      40             : #include <oox/dllapi.h>
      41             : 
      42             : class SotStorage;
      43             : class SotStorageStream;
      44             : class SvGlobalName;
      45             : 
      46             : namespace oox {
      47             :     class BinaryInputStream;
      48             :     class BinaryOutputStream;
      49             :     class BinaryXInputStream;
      50             :     class GraphicHelper;
      51             : }
      52             : 
      53             : namespace oox {
      54             : 
      55             : 
      56             : namespace ole {
      57             : 
      58             : 
      59             : 
      60             : 
      61             : #define OLE_GUID_STDFONT "{0BE35203-8F91-11CE-9DE3-00AA004BB851}"
      62             : #define OLE_GUID_STDPIC  "{0BE35204-8F91-11CE-9DE3-00AA004BB851}"
      63             : 
      64             : 
      65             : 
      66             : const sal_uInt16 OLE_STDFONT_NORMAL     = 400;
      67             : const sal_uInt16 OLE_STDFONT_BOLD       = 700;
      68             : 
      69             : const sal_uInt8 OLE_STDFONT_ITALIC      = 0x02;
      70             : const sal_uInt8 OLE_STDFONT_UNDERLINE   = 0x04;
      71             : const sal_uInt8 OLE_STDFONT_STRIKE      = 0x08;
      72             : 
      73             : /** Stores data about a StdFont font structure. */
      74           0 : struct StdFontInfo
      75             : {
      76             :     OUString     maName;         ///< Font name.
      77             :     sal_uInt32          mnHeight;       ///< Font height (1/10,000 points).
      78             :     sal_uInt16          mnWeight;       ///< Font weight (normal/bold).
      79             :     sal_uInt16          mnCharSet;      ///< Font charset.
      80             :     sal_uInt8           mnFlags;        ///< Font flags.
      81             : 
      82             :     explicit            StdFontInfo();
      83             :     explicit            StdFontInfo(
      84             :                             const OUString& rName,
      85             :                             sal_uInt32 nHeight,
      86             :                             sal_uInt16 nWeight = OLE_STDFONT_NORMAL,
      87             :                             sal_uInt16 nCharSet = WINDOWS_CHARSET_ANSI,
      88             :                             sal_uInt8 nFlags = 0 );
      89             : };
      90             : 
      91             : 
      92             : 
      93             : /** Stores data about a StdHlink hyperlink. */
      94          12 : struct StdHlinkInfo
      95             : {
      96             :     OUString     maTarget;
      97             :     OUString     maLocation;
      98             :     OUString     maDisplay;
      99             :     OUString     maFrame;
     100             : };
     101             : 
     102             : 
     103             : 
     104             : /** Static helper functions for OLE import/export. */
     105             : namespace OleHelper
     106             : {
     107             :     /** Returns the UNO RGB color from the passed encoded OLE color.
     108             : 
     109             :         @param bDefaultColorBgr
     110             :             True = OLE default color type is treated as BGR color.
     111             :             False = OLE default color type is treated as palette color.
     112             :      */
     113             :     OOX_DLLPUBLIC sal_Int32    decodeOleColor(
     114             :                             const GraphicHelper& rGraphicHelper,
     115             :                             sal_uInt32 nOleColor,
     116             :                             bool bDefaultColorBgr = true );
     117             : 
     118             :     /** Returns the OLE color from the passed UNO RGB color.
     119             :      */
     120             :     OOX_DLLPUBLIC sal_uInt32   encodeOleColor( sal_Int32 nRgbColor );
     121             : 
     122             :     /** Imports a GUID from the passed binary stream and returns its string
     123             :         representation (in uppercase characters).
     124             :      */
     125             :     OOX_DLLPUBLIC OUString importGuid( BinaryInputStream& rInStrm );
     126             :     OOX_DLLPUBLIC void exportGuid( BinaryOutputStream& rOutStrm, const SvGlobalName& rId );
     127             : 
     128             :     /** Imports an OLE StdFont font structure from the current position of the
     129             :         passed binary stream.
     130             :      */
     131             :     OOX_DLLPUBLIC bool         importStdFont(
     132             :                             StdFontInfo& orFontInfo,
     133             :                             BinaryInputStream& rInStrm,
     134             :                             bool bWithGuid );
     135             : 
     136             :     /** Imports an OLE StdPic picture from the current position of the passed
     137             :         binary stream.
     138             :      */
     139             :     OOX_DLLPUBLIC bool         importStdPic(
     140             :                             StreamDataSequence& orGraphicData,
     141             :                             BinaryInputStream& rInStrm,
     142             :                             bool bWithGuid );
     143             : }
     144             : 
     145             : // ideally it would be great to get rid of SvxMSConvertOCXControls
     146             : // however msfilter/source/msfilter/svdfppt.cxx still uses
     147             : // SvxMSConvertOCXControls as a base class, unfortunately oox depends on
     148             : // msfilter. Probably the solution would be to move the svdfppt.cxx
     149             : // implementation into the sd module itself.
     150             : class OOX_DLLPUBLIC MSConvertOCXControls : public SvxMSConvertOCXControls
     151             : {
     152             : protected:
     153             :     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxCtx;
     154             :     ::oox::GraphicHelper maGrfHelper;
     155             : 
     156             :     bool importControlFromStream( ::oox::BinaryInputStream& rInStrm,
     157             :                                   ::com::sun::star::uno::Reference< com::sun::star::form::XFormComponent > & rxFormComp,
     158             :                                   const OUString& rGuidString );
     159             :     bool importControlFromStream( ::oox::BinaryInputStream& rInStrm,
     160             :                                   ::com::sun::star::uno::Reference< com::sun::star::form::XFormComponent > & rxFormComp,
     161             :                                   const OUString& rGuidString,
     162             :                                   sal_Int32 nSize );
     163             : public:
     164             :     MSConvertOCXControls( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel );
     165             :     virtual ~MSConvertOCXControls();
     166             :     bool ReadOCXStorage( tools::SvRef<SotStorage>& rSrc1, ::com::sun::star::uno::Reference< com::sun::star::form::XFormComponent > & rxFormComp );
     167             :     bool ReadOCXCtlsStream(tools::SvRef<SotStorageStream>& rSrc1, ::com::sun::star::uno::Reference< com::sun::star::form::XFormComponent > & rxFormComp,
     168             :                                    sal_Int32 nPos, sal_Int32 nSize );
     169             :     static bool WriteOCXStream( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel, tools::SvRef<SotStorage> &rSrc1, const com::sun::star::uno::Reference< com::sun::star::awt::XControlModel > &rControlModel, const com::sun::star::awt::Size& rSize,OUString &rName);
     170             :     static bool WriteOCXExcelKludgeStream( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& rxModel, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutStrm, const com::sun::star::uno::Reference< com::sun::star::awt::XControlModel > &rControlModel, const com::sun::star::awt::Size& rSize,OUString &rName);
     171             : };
     172             : 
     173             : 
     174             : 
     175             : 
     176             : } // namespace ole
     177             : } // namespace oox
     178             : 
     179             : #endif
     180             : 
     181             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.11