tdf#154546 skip dispatch when presenter controller is not set
[LibreOffice.git] / configmgr / source / data.hxx
blobc3614e6435da4b980756887c9682cefca1eb7988
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include <sal/config.h>
24 #include <climits>
25 #include "config_map.hxx"
26 #include <vector>
28 #include <rtl/ref.hxx>
29 #include <rtl/ustring.hxx>
30 #include <sal/types.h>
31 #include <salhelper/simplereferenceobject.hxx>
33 #include "additions.hxx"
34 #include "modifications.hxx"
35 #include "nodemap.hxx"
37 namespace configmgr {
39 class Node;
41 struct Data {
42 enum { NO_LAYER = INT_MAX };
44 struct ExtensionXcu: public salhelper::SimpleReferenceObject {
45 int layer;
46 Additions additions;
49 NodeMap templates;
51 Modifications modifications;
53 static OUString createSegment(
54 std::u16string_view templateName, OUString const & name);
56 static sal_Int32 parseSegment(
57 OUString const & path, sal_Int32 index, OUString * name,
58 bool * setElement, OUString * templateName);
60 static OUString fullTemplateName(
61 std::u16string_view component, std::u16string_view name);
63 //TODO: better rules under which circumstances a short template name matches
64 static bool equalTemplateNames(
65 OUString const & shortName, OUString const & longName);
67 Data();
69 rtl::Reference< Node > resolvePathRepresentation(
70 OUString const & pathRepresentation,
71 OUString * canonicRepresentation, std::vector<OUString> * path, int * finalizedLayer)
72 const;
74 rtl::Reference< Node > getTemplate(
75 int layer, OUString const & fullName) const;
77 NodeMap & getComponents() const;
79 Additions * addExtensionXcuAdditions(
80 OUString const & url, int layer);
82 rtl::Reference< ExtensionXcu > removeExtensionXcuAdditions(
83 OUString const & url);
85 private:
86 Data(const Data&) = delete;
87 Data& operator=(const Data&) = delete;
89 typedef config_map< rtl::Reference< ExtensionXcu > >
90 ExtensionXcuAdditions;
92 rtl::Reference< Node > root_;
94 ExtensionXcuAdditions extensionXcuAdditions_;
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */