LCOV - code coverage report
Current view: top level - package/inc - ZipPackageEntry.hxx (source / functions) Hit Total Coverage
Test: commit 10e77ab3ff6f4314137acd6e2702a6e5c1ce1fae Lines: 7 7 100.0 %
Date: 2014-11-03 Functions: 5 5 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 INCLUDED_PACKAGE_INC_ZIPPACKAGEENTRY_HXX
      20             : #define INCLUDED_PACKAGE_INC_ZIPPACKAGEENTRY_HXX
      21             : 
      22             : #include <com/sun/star/container/XChild.hpp>
      23             : #include <com/sun/star/container/XNamed.hpp>
      24             : #include <com/sun/star/beans/PropertyValue.hpp>
      25             : #include <com/sun/star/beans/XPropertySet.hpp>
      26             : #include <com/sun/star/lang/XUnoTunnel.hpp>
      27             : #include <com/sun/star/container/XNameContainer.hpp>
      28             : #include <com/sun/star/lang/XServiceInfo.hpp>
      29             : #include <com/sun/star/uno/XComponentContext.hpp>
      30             : #include <ZipEntry.hxx>
      31             : #include <cppuhelper/implbase5.hxx>
      32             : 
      33             : #include <vector>
      34             : 
      35             : typedef void* rtlRandomPool;
      36             : class ZipOutputStream;
      37             : class ZipPackageFolder;
      38             : 
      39             : class ZipPackageEntry : public cppu::WeakImplHelper5
      40             : <
      41             :     com::sun::star::container::XNamed,
      42             :     com::sun::star::container::XChild,
      43             :     com::sun::star::lang::XUnoTunnel,
      44             :     com::sun::star::beans::XPropertySet,
      45             :     com::sun::star::lang::XServiceInfo
      46             : >
      47             : {
      48             : protected:
      49             :     css::uno::Reference< css::uno::XComponentContext > m_xContext;
      50             :     OUString msName;
      51             :     bool mbIsFolder:1;
      52             :     bool mbAllowRemoveOnInsert:1;
      53             :     // com::sun::star::uno::Reference < com::sun::star::container::XNameContainer > xParent;
      54             :     OUString msMediaType;
      55             :     ZipPackageFolder* mpParent;
      56             :     sal_Int32 m_nFormat;
      57             : 
      58             : public:
      59             :     ZipEntry aEntry;
      60             :     ZipPackageEntry();
      61             :     virtual ~ZipPackageEntry( void );
      62             : 
      63       26388 :     const OUString& GetMediaType () const { return msMediaType; }
      64      243154 :     void SetMediaType ( const OUString & sNewType) { msMediaType = sNewType; }
      65             :     void doSetParent ( ZipPackageFolder * pNewParent, bool bInsert );
      66      538510 :     bool IsFolder ( ) { return mbIsFolder; }
      67             :     const ZipPackageFolder* GetParent () const { return mpParent; }
      68      674024 :     void SetFolder ( bool bSetFolder ) { mbIsFolder = bSetFolder; }
      69             : 
      70             :     virtual bool saveChild( const OUString &rPath,
      71             :                             std::vector < css::uno::Sequence < css::beans::PropertyValue > > &rManList,
      72             :                             ZipOutputStream & rZipOut,
      73             :                             const css::uno::Sequence < sal_Int8 >& rEncryptionKey,
      74             :                             const rtlRandomPool &rRandomPool ) = 0;
      75             : 
      76      538456 :     void clearParent ( void )
      77             :     {
      78             :         // xParent.clear();
      79      538456 :         mpParent = NULL;
      80      538456 :     }
      81             :     // XNamed
      82             :     virtual OUString SAL_CALL getName(  )
      83             :         throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      84             :     virtual void SAL_CALL setName( const OUString& aName )
      85             :         throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      86             :     // XChild
      87             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent(  )
      88             :         throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      89             :     virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent )
      90             :         throw(::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      91             :     // XUnoTunnel
      92             :     virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier )
      93             :         throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE = 0;
      94             :     // XPropertySet
      95             :     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  )
      96             :         throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
      97             :     virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue )
      98             :         throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE = 0;
      99             :     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName )
     100             :         throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE = 0;
     101             :     virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener )
     102             :         throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     103             :     virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener )
     104             :         throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     105             :     virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
     106             :         throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     107             :     virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
     108             :         throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
     109             : };
     110             : #endif
     111             : 
     112             : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */

Generated by: LCOV version 1.10