LibreOffice Module filter (master) 1
xmlfilterjar.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#pragma once
20
21#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
22#include <com/sun/star/lang/XSingleServiceFactory.hpp>
23#include <com/sun/star/uno/XComponentContext.hpp>
24
25#include <memory>
26#include <vector>
27
29
31{
32public:
33 explicit XMLFilterJarHelper( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
34
35 bool savePackage( const OUString& rPackageURL, const std::vector<filter_info_impl*>& rFilters );
36 void openPackage( const OUString& rPackageURL, std::vector< std::unique_ptr<filter_info_impl> >& rFilters );
37
38private:
40 void addFile( css::uno::Reference< css::uno::XInterface > const & xRootFolder, css::uno::Reference< css::lang::XSingleServiceFactory > const & xFactory, const OUString& rSourceFile );
41
42 static bool copyFile( const css::uno::Reference< css::container::XHierarchicalNameAccess >& xIfc, OUString& rURL, std::u16string_view rTargetURL );
43 bool copyFiles( const css::uno::Reference< css::container::XHierarchicalNameAccess >& xIfc, filter_info_impl* pFilter );
44
45 css::uno::Reference< css::uno::XComponentContext > mxContext;
46
47 OUString sXSLTPath;
48 OUString sTemplatePath;
49 OUString sProgPath;
50};
51
52/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
XMLFilterJarHelper(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
css::uno::Reference< css::uno::XComponentContext > mxContext
void openPackage(const OUString &rPackageURL, std::vector< std::unique_ptr< filter_info_impl > > &rFilters)
void addFile(css::uno::Reference< css::uno::XInterface > const &xRootFolder, css::uno::Reference< css::lang::XSingleServiceFactory > const &xFactory, const OUString &rSourceFile)
bool savePackage(const OUString &rPackageURL, const std::vector< filter_info_impl * > &rFilters)
bool copyFiles(const css::uno::Reference< css::container::XHierarchicalNameAccess > &xIfc, filter_info_impl *pFilter)
static bool copyFile(const css::uno::Reference< css::container::XHierarchicalNameAccess > &xIfc, OUString &rURL, std::u16string_view rTargetURL)
Reference< XSingleServiceFactory > xFactory