xref: /AOO41X/main/package/inc/ZipPackageEntry.hxx (revision ebfcd9af2ce496a86a62eef7379364d0a42a7f96)
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         throw(::com::sun::star::uno::RuntimeException);
75     virtual void SAL_CALL setName( const ::rtl::OUString& aName )
76         throw(::com::sun::star::uno::RuntimeException);
77     // XChild
78     virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL getParent(  )
79         throw(::com::sun::star::uno::RuntimeException);
80     virtual void SAL_CALL setParent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& Parent )
81         throw(::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException);
82     // XUnoTunnel
83     virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier )
84         throw(::com::sun::star::uno::RuntimeException) = 0;
85     // XPropertySet
86     virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo(  )
87         throw(::com::sun::star::uno::RuntimeException);
88     virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue )
89         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;
90     virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName )
91         throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) = 0;
92     virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener )
93         throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
94     virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener )
95         throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
96     virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
97         throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
98     virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener )
99         throw(::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException);
100 };
101 #endif
102