LibreOffice Module sd (master) 1
ConfigurationAccess.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 <rtl/ustring.hxx>
23#include <com/sun/star/uno/XInterface.hpp>
24
25#include <vector>
26#include <functional>
27
28namespace com::sun::star::container { class XHierarchicalNameAccess; }
29namespace com::sun::star::container { class XNameAccess; }
30namespace com::sun::star::lang { class XMultiServiceFactory; }
31namespace com::sun::star::uno { class XComponentContext; }
32
33namespace sd::tools {
34
41{
42public:
44
54 const OUString& rsRootName,
55 const WriteMode eMode);
56
65 css::uno::Any GetConfigurationNode (
66 const OUString& rsPathToNode);
67
77 static css::uno::Any GetConfigurationNode (
78 const css::uno::Reference<css::container::XHierarchicalNameAccess>& rxNode,
79 const OUString& rsPathToNode);
80
85 void CommitChanges();
86
91 typedef ::std::function<void (
92 const OUString&,
93 const std::vector<css::uno::Any>&) > Functor;
94
95private:
96 css::uno::Reference<css::uno::XInterface> mxRoot;
97
98 void Initialize (
99 const css::uno::Reference<css::lang::XMultiServiceFactory>& rxProvider,
100 const OUString& rsRootName,
101 const WriteMode eMode);
102};
103
104} // end of namespace sd::tools
105
106/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
This class gives access to the configuration.
ConfigurationAccess(const OUString &rsRootName, const WriteMode eMode)
Create a new object to access the configuration entries below the given root.
void Initialize(const css::uno::Reference< css::lang::XMultiServiceFactory > &rxProvider, const OUString &rsRootName, const WriteMode eMode)
void CommitChanges()
Write any changes that have been made back to the configuration.
css::uno::Any GetConfigurationNode(const OUString &rsPathToNode)
Return a configuration node below the root of the called object.
css::uno::Reference< css::uno::XInterface > mxRoot
::std::function< void(const OUString &, const std::vector< css::uno::Any > &) > Functor
This functor is typically called for every item in a set.