LibreOffice Module filter (master) 1
filterfactory.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
20#pragma once
21
22#include "basecontainer.hxx"
23#include "querytokenizer.hxx"
24#include <com/sun/star/lang/XMultiServiceFactory.hpp>
26
27
28namespace filter::config {
29
30
33class FilterFactory : public ::cppu::ImplInheritanceHelper< BaseContainer ,
34 css::lang::XMultiServiceFactory >
35{
36
37 // native interface
38
39 css::uno::Reference< css::uno::XComponentContext > m_xContext;
40
41 public:
42
43
44 // ctor/dtor
45
52 explicit FilterFactory(const css::uno::Reference< css::uno::XComponentContext >& rxContext);
53
54
57 virtual ~FilterFactory() override;
58
59
60 // uno interface
61
62 public:
63
64
65 // XMultiServiceFactory
66
67 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(const OUString& sFilter) override;
68
69 virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments(const OUString& sFilter ,
70 const css::uno::Sequence< css::uno::Any >& lArguments) override;
71
72 virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override;
73
74
75 // XContainerQuery
76
77 virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createSubSetEnumerationByQuery(const OUString& sQuery) override;
78
79
80 // internal helper!
81
82 private:
83
84
93 std::vector<OUString> impl_queryMatchByDocumentService(const QueryTokenizer& lTokens) const;
94
95
98 static css::uno::Sequence<OUString> impl_getListOfInstalledModules();
99
100
110 std::vector<OUString> impl_getSortedFilterList(const QueryTokenizer& lTokens) const;
111
112
115 std::vector<OUString> impl_getSortedFilterListForModule(const OUString& sModule,
116 sal_Int32 nIFlags,
117 sal_Int32 nEFlags) const;
118
119
129 static std::vector<OUString> impl_readSortedFilterListFromConfig(const OUString& sModule);
130
131};
132
133} // namespace filter::config
134
135/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
implements the service <type scope="com.sun.star.document">FilterFactory</type>.
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createSubSetEnumerationByQuery(const OUString &sQuery) override
std::vector< OUString > impl_getSortedFilterList(const QueryTokenizer &lTokens) const
implement the container string query: "getSortedFilterList()[:module=<xxx>]:[iflags=<xxx>][:eflags=<x...
std::vector< OUString > impl_queryMatchByDocumentService(const QueryTokenizer &lTokens) const
implement the container string query: "matchByDocumentService=:iflags=:eflags=:......
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstance(const OUString &sFilter) override
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL createInstanceWithArguments(const OUString &sFilter, const css::uno::Sequence< css::uno::Any > &lArguments) override
virtual ~FilterFactory() override
standard dtor.
static css::uno::Sequence< OUString > impl_getListOfInstalledModules()
TODO document me.
css::uno::Reference< css::uno::XComponentContext > m_xContext
std::vector< OUString > impl_getSortedFilterListForModule(const OUString &sModule, sal_Int32 nIFlags, sal_Int32 nEFlags) const
TODO document me.
static std::vector< OUString > impl_readSortedFilterListFromConfig(const OUString &sModule)
read a specialized and sorted list of filter names from the configuration (matching the specified mod...
FilterFactory(const css::uno::Reference< css::uno::XComponentContext > &rxContext)
standard ctor to connect this interface wrapper to the global filter cache instance ....
virtual css::uno::Sequence< OUString > SAL_CALL getAvailableServiceNames() override
It can be used to split any query string (which can be used at the related interface <type scope="css...