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"
44 enum { NO_LAYER
= INT_MAX
};
46 struct ExtensionXcu
: public salhelper::SimpleReferenceObject
{
53 Modifications modifications
;
55 static OUString
createSegment(
56 OUString
const & templateName
, OUString
const & name
);
58 static sal_Int32
parseSegment(
59 OUString
const & path
, sal_Int32 index
, OUString
* name
,
60 bool * setElement
, OUString
* templateName
);
62 static OUString
fullTemplateName(
63 OUString
const & component
, OUString
const & name
);
65 //TODO: better rules under which circumstances a short template name matches
66 static bool equalTemplateNames(
67 OUString
const & shortName
, OUString
const & longName
);
71 rtl::Reference
< Node
> resolvePathRepresentation(
72 OUString
const & pathRepresentation
,
73 OUString
* canonicRepresenation
, Path
* path
, int * finalizedLayer
)
76 rtl::Reference
< Node
> getTemplate(
77 int layer
, OUString
const & fullName
) const;
79 NodeMap
& getComponents() const;
81 Additions
* addExtensionXcuAdditions(
82 OUString
const & url
, int layer
);
84 rtl::Reference
< ExtensionXcu
> removeExtensionXcuAdditions(
85 OUString
const & url
);
88 Data(const Data
&) SAL_DELETED_FUNCTION
;
89 Data
& operator=(const Data
&) SAL_DELETED_FUNCTION
;
91 typedef config_map
< rtl::Reference
< ExtensionXcu
> >
92 ExtensionXcuAdditions
;
94 rtl::Reference
< Node
> root_
;
96 ExtensionXcuAdditions extensionXcuAdditions_
;
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */