LibreOffice Module sd (master) 1
ModuleController.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 <com/sun/star/drawing/framework/XModuleController.hpp>
23#include <com/sun/star/lang/XInitialization.hpp>
26#include <rtl/ref.hxx>
27
28#include <unordered_map>
29
30namespace com::sun::star::frame { class XController; }
31namespace com::sun::star::uno { class XComponentContext; }
32namespace sd { class DrawController; }
33
34namespace sd::framework {
35
37 css::drawing::framework::XModuleController
39
59{
60public:
63
64 virtual void disposing(std::unique_lock<std::mutex>&) override;
65
66 // XModuleController
67
68 virtual void SAL_CALL requestResource(const OUString& rsResourceURL) override;
69
70private:
72
73 std::unordered_map<OUString, OUString> maResourceToFactoryMap;
74 std::unordered_map<OUString, css::uno::WeakReference<css::uno::XInterface>> maLoadedFactories;
75
77 virtual ~ModuleController() noexcept override;
78
81 void ProcessFactory (const OUString& ServiceName, ::std::vector<OUString> aURLs);
82
87};
88
89} // end of namespace sd::framework
90
91/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
The ModuleController has two tasks:
ModuleController(const ModuleController &)=delete
std::unordered_map< OUString, css::uno::WeakReference< css::uno::XInterface > > maLoadedFactories
ModuleController(const rtl::Reference<::sd::DrawController > &rxController)
void ProcessFactory(const OUString &ServiceName, ::std::vector< OUString > aURLs)
Called for every entry in the ResourceFactories configuration entry.
void InstantiateStartupServices()
Instantiate startup services.
rtl::Reference<::sd::DrawController > mxController
virtual void SAL_CALL requestResource(const OUString &rsResourceURL) override
virtual ~ModuleController() noexcept override
virtual void disposing(std::unique_lock< std::mutex > &) override
std::unordered_map< OUString, OUString > maResourceToFactoryMap
comphelper::WeakComponentImplHelper< css::drawing::framework::XModuleController > ModuleControllerInterfaceBase