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