1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #ifndef INCLUDED_CONFIGMGR_SOURCE_DATA_HXX
21 #define INCLUDED_CONFIGMGR_SOURCE_DATA_HXX
23 #include <sal/config.h>
26 #include "config_map.hxx"
29 #include <rtl/ref.hxx>
30 #include <rtl/ustring.hxx>
31 #include <sal/types.h>
32 #include <salhelper/simplereferenceobject.hxx>
34 #include "additions.hxx"
35 #include "modifications.hxx"
36 #include "nodemap.hxx"
43 enum { NO_LAYER
= INT_MAX
};
45 struct ExtensionXcu
: public salhelper::SimpleReferenceObject
{
52 Modifications modifications
;
54 static OUString
createSegment(
55 OUString
const & templateName
, OUString
const & name
);
57 static sal_Int32
parseSegment(
58 OUString
const & path
, sal_Int32 index
, OUString
* name
,
59 bool * setElement
, OUString
* templateName
);
61 static OUString
fullTemplateName(
62 OUString
const & component
, OUString
const & name
);
64 //TODO: better rules under which circumstances a short template name matches
65 static bool equalTemplateNames(
66 OUString
const & shortName
, OUString
const & longName
);
70 rtl::Reference
< Node
> resolvePathRepresentation(
71 OUString
const & pathRepresentation
,
72 OUString
* canonicRepresenation
, std::vector
<OUString
> * path
, int * finalizedLayer
)
75 rtl::Reference
< Node
> getTemplate(
76 int layer
, OUString
const & fullName
) const;
78 NodeMap
& getComponents() const;
80 Additions
* addExtensionXcuAdditions(
81 OUString
const & url
, int layer
);
83 rtl::Reference
< ExtensionXcu
> removeExtensionXcuAdditions(
84 OUString
const & url
);
87 Data(const Data
&) = delete;
88 Data
& operator=(const Data
&) = delete;
90 typedef config_map
< rtl::Reference
< ExtensionXcu
> >
91 ExtensionXcuAdditions
;
93 rtl::Reference
< Node
> root_
;
95 ExtensionXcuAdditions extensionXcuAdditions_
;
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */