LibreOffice Module package (master) 1
ZipPackageEntry.hxx
Go to the documentation of this file.
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"
30
31#include <vector>
32
33typedef void* rtlRandomPool;
34class ZipOutputStream;
36
37class ZipPackageEntry : public cppu::WeakImplHelper
38<
39 css::container::XNamed,
40 css::container::XChild,
41 css::beans::XPropertySet,
42 css::lang::XServiceInfo
43>
44{
45protected:
46 css::uno::Reference< css::uno::XComponentContext > m_xContext;
47 OUString msName;
48 bool mbIsFolder:1;
50 OUString msMediaType;
52 sal_Int32 m_nFormat;
53
54public:
57 virtual ~ZipPackageEntry() override;
58
59 const OUString& GetMediaType() const { return msMediaType; }
60 void SetMediaType(const OUString & sNewType) { msMediaType = sNewType; }
61 void doSetParent(ZipPackageFolder * pNewParent);
62 bool IsFolder() const { return mbIsFolder; }
63 void SetFolder(const bool bSetFolder) { mbIsFolder = bSetFolder; }
64
65 virtual bool saveChild( const OUString &rPath,
66 std::vector < css::uno::Sequence < css::beans::PropertyValue > > &rManList,
67 ZipOutputStream & rZipOut,
68 const css::uno::Sequence < sal_Int8 >& rEncryptionKey,
69 sal_Int32 nPBKDF2IterationCount,
70 const rtlRandomPool &rRandomPool ) = 0;
71
73 {
74 // xParent.clear();
75 mpParent = nullptr;
76 }
77 // XNamed
78 virtual OUString SAL_CALL getName( ) override;
79 virtual void SAL_CALL setName( const OUString& aName ) override;
80 // XChild
81 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent( ) override;
82 virtual void SAL_CALL setParent( const css::uno::Reference< css::uno::XInterface >& Parent ) override;
83 // XPropertySet
84 virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) override;
85 virtual void SAL_CALL setPropertyValue( const OUString& aPropertyName, const css::uno::Any& aValue ) override = 0;
86 virtual css::uno::Any SAL_CALL getPropertyValue( const OUString& PropertyName ) override = 0;
87 virtual void SAL_CALL addPropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener ) override;
88 virtual void SAL_CALL removePropertyChangeListener( const OUString& aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener >& aListener ) override;
89 virtual void SAL_CALL addVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
90 virtual void SAL_CALL removeVetoableChangeListener( const OUString& PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener ) override;
91};
92#endif
93
94/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void * rtlRandomPool
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo() override
virtual OUString SAL_CALL getName() override
virtual void SAL_CALL addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override
bool IsFolder() const
virtual ~ZipPackageEntry() override
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
const OUString & GetMediaType() const
virtual void SAL_CALL removeVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
virtual void SAL_CALL addVetoableChangeListener(const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override
void SetMediaType(const OUString &sNewType)
virtual css::uno::Any SAL_CALL getPropertyValue(const OUString &PropertyName) override=0
virtual void SAL_CALL removePropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override
ZipPackageFolder * mpParent
virtual void SAL_CALL setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue) override=0
void doSetParent(ZipPackageFolder *pNewParent)
virtual void SAL_CALL setName(const OUString &aName) override
void SetFolder(const bool bSetFolder)
virtual bool saveChild(const OUString &rPath, std::vector< css::uno::Sequence< css::beans::PropertyValue > > &rManList, ZipOutputStream &rZipOut, const css::uno::Sequence< sal_Int8 > &rEncryptionKey, sal_Int32 nPBKDF2IterationCount, const rtlRandomPool &rRandomPool)=0
css::uno::Reference< css::uno::XComponentContext > m_xContext