LibreOffice Module sd (master) 1
ResourceFactoryManager.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 <sal/config.h>
23
24#include <mutex>
25#include <unordered_map>
26#include <utility>
27#include <vector>
28
29#include <com/sun/star/uno/Reference.hxx>
30#include <rtl/ref.hxx>
31#include <rtl/ustring.hxx>
32
33namespace com::sun::star::drawing::framework { class XControllerManager; }
34namespace com::sun::star::drawing::framework { class XResourceFactory; }
35namespace com::sun::star::util { class XURLTransformer; }
36namespace sd { class DrawController; }
37
38namespace sd::framework {
39
43{
44public:
46
48
56 void AddFactory (
57 const OUString& rsURL,
58 const css::uno::Reference<css::drawing::framework::XResourceFactory>& rxFactory);
59
67 const OUString& rsURL);
68
76 const css::uno::Reference<css::drawing::framework::XResourceFactory>& rxFactory);
77
87 css::uno::Reference<css::drawing::framework::XResourceFactory> GetFactory (
88 const OUString& rsURL);
89
90private:
91 std::mutex maMutex;
92 typedef std::unordered_map<
93 OUString,
94 css::uno::Reference<css::drawing::framework::XResourceFactory> > FactoryMap;
96
97 typedef ::std::vector<
98 ::std::pair<
99 OUString,
100 css::uno::Reference<css::drawing::framework::XResourceFactory> > >
103
105 css::uno::Reference<css::util::XURLTransformer> mxURLTransformer;
106
115 css::uno::Reference<css::drawing::framework::XResourceFactory> FindFactory (
116 const OUString& rsURLBase);
117};
118
119} // end of namespace sd::framework
120
121/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Container of resource factories of the drawing framework.
rtl::Reference<::sd::DrawController > mxControllerManager
void RemoveFactoryForReference(const css::uno::Reference< css::drawing::framework::XResourceFactory > &rxFactory)
Unregister the specified factory.
css::uno::Reference< css::drawing::framework::XResourceFactory > FindFactory(const OUString &rsURLBase)
Look up the factory for the given URL.
std::unordered_map< OUString, css::uno::Reference< css::drawing::framework::XResourceFactory > > FactoryMap
css::uno::Reference< css::util::XURLTransformer > mxURLTransformer
void AddFactory(const OUString &rsURL, const css::uno::Reference< css::drawing::framework::XResourceFactory > &rxFactory)
Register a resource factory for one type of resource.
ResourceFactoryManager(const rtl::Reference<::sd::DrawController > &rxManager)
::std::vector< ::std::pair< OUString, css::uno::Reference< css::drawing::framework::XResourceFactory > > > FactoryPatternList
css::uno::Reference< css::drawing::framework::XResourceFactory > GetFactory(const OUString &rsURL)
Return a factory that can create resources specified by the given URL.
void RemoveFactoryForURL(const OUString &rsURL)
Unregister the specified factory.