1 /************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at 10 * 11 * http://www.apache.org/licenses/LICENSE-2.0 12 * 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. 19 * 20 *************************************************************/ 21 22 23 #ifndef _ZIP_PACKAGE_ENTRY_HXX 24 #define _ZIP_PACKAGE_ENTRY_HXX 25 26 #include <com/sun/star/container/XChild.hpp> 27 #include <com/sun/star/container/XNamed.hpp> 28 #include <com/sun/star/beans/XPropertySet.hpp> 29 #include <com/sun/star/lang/XUnoTunnel.hpp> 30 #include <com/sun/star/container/XNameContainer.hpp> 31 #ifndef _COM_SUN_STAR_LANG_XPSERVICEINFO_HPP_ 32 #include <com/sun/star/lang/XServiceInfo.hpp> 33 #endif 34 #include <ZipEntry.hxx> 35 #include <cppuhelper/implbase5.hxx> 36 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 ::rtl::OUString msName; 50 bool mbIsFolder:1; 51 bool mbAllowRemoveOnInsert:1; 52 // com::sun::star::uno::Reference < com::sun::star::container::XNameContainer > xParent; 53 ::rtl::OUString sMediaType; 54 ZipPackageFolder * pParent; 55 public: 56 ZipEntry aEntry; 57 ZipPackageEntry ( bool bNewFolder = sal_False ); 58 virtual ~ZipPackageEntry( void ); 59 GetMediaType()60 ::rtl::OUString & GetMediaType () { return sMediaType; } SetMediaType(const::rtl::OUString & sNewType)61 void SetMediaType ( const ::rtl::OUString & sNewType) { sMediaType = sNewType; } 62 void doSetParent ( ZipPackageFolder * pNewParent, sal_Bool bInsert ); IsFolder()63 bool IsFolder ( ) { return mbIsFolder; } GetParent()64 ZipPackageFolder* GetParent ( ) { return pParent; } SetFolder(bool bSetFolder)65 void SetFolder ( bool bSetFolder ) { mbIsFolder = bSetFolder; } 66 clearParent(void)67 void clearParent ( void ) 68 { 69 // xParent.clear(); 70 pParent = NULL; 71 } 72 // XNamed 73 virtual ::rtl::OUString SAL_CALL getName( ); 74 virtual void SAL_CALL setName( const ::rtl::OUString& aName ); 75 // XChild 76 virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent( ); 77 virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent ); 78 // XUnoTunnel 79 virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) = 0; 80 // XPropertySet 81 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ); 82 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) = 0; 83 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) = 0; 84 virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ); 85 virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ); 86 virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ); 87 virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ); 88 }; 89 #endif 90