/src/libreoffice/package/inc/ZipPackageEntry.hxx
Line | Count | Source |
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/XServiceInfo.hpp> |
27 | | #include <com/sun/star/uno/XComponentContext.hpp> |
28 | | #include "ZipEntry.hxx" |
29 | | #include <cppuhelper/implbase.hxx> |
30 | | |
31 | | #include <vector> |
32 | | #include <optional> |
33 | | #include <tuple> |
34 | | |
35 | | class ZipOutputStream; |
36 | | class ZipPackageFolder; |
37 | | |
38 | | class ZipPackageEntry : public cppu::WeakImplHelper |
39 | | < |
40 | | css::container::XNamed, |
41 | | css::container::XChild, |
42 | | css::beans::XPropertySet, |
43 | | css::lang::XServiceInfo |
44 | | > |
45 | | { |
46 | | protected: |
47 | | css::uno::Reference< css::uno::XComponentContext > m_xContext; |
48 | | OUString msName; |
49 | | bool mbIsFolder:1; |
50 | | bool mbAllowRemoveOnInsert:1; |
51 | | OUString msMediaType; |
52 | | ZipPackageFolder* mpParent; |
53 | | sal_Int32 m_nFormat; |
54 | | |
55 | | public: |
56 | | ZipEntry aEntry; |
57 | | ZipPackageEntry(); |
58 | | virtual ~ZipPackageEntry() override; |
59 | | |
60 | 0 | const OUString& GetMediaType() const { return msMediaType; } |
61 | 212k | void SetMediaType(const OUString & sNewType) { msMediaType = sNewType; } |
62 | | void doSetParent(ZipPackageFolder * pNewParent); |
63 | 560k | bool IsFolder() const { return mbIsFolder; } |
64 | 761k | void SetFolder(const bool bSetFolder) { mbIsFolder = bSetFolder; } |
65 | | |
66 | | virtual bool saveChild( const OUString &rPath, |
67 | | std::vector < css::uno::Sequence < css::beans::PropertyValue > > &rManList, |
68 | | ZipOutputStream & rZipOut, |
69 | | const css::uno::Sequence < sal_Int8 >& rEncryptionKey, |
70 | | ::std::optional<sal_Int32> oPBKDF2IterationCount, |
71 | | ::std::optional<::std::tuple<sal_Int32, sal_Int32, sal_Int32>> oArgon2Args) = 0; |
72 | | |
73 | | void clearParent() |
74 | 1.12M | { |
75 | | // xParent.clear(); |
76 | 1.12M | mpParent = nullptr; |
77 | 1.12M | } |
78 | | // XNamed |
79 | | virtual OUString SAL_CALL getName( ) override; |
80 | | virtual void SAL_CALL setName( const OUString& aName ) override; |
81 | | // XChild |
82 | | virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override; |
83 | | virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override; |
84 | | // XPropertySet |
85 | | virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override; |
86 | | virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override = 0; |
87 | | virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override = 0; |
88 | | virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override; |
89 | | virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override; |
90 | | virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; |
91 | | virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override; |
92 | | }; |
93 | | #endif |
94 | | |
95 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |