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"
29 #include "boost/noncopyable.hpp"
30 #include "rtl/ref.hxx"
31 #include "rtl/ustring.hxx"
32 #include "sal/types.h"
33 #include "salhelper/simplereferenceobject.hxx"
35 #include "additions.hxx"
36 #include "modifications.hxx"
37 #include "nodemap.hxx"
44 struct Data
: private boost::noncopyable
{
45 enum { NO_LAYER
= INT_MAX
};
47 struct ExtensionXcu
: public salhelper::SimpleReferenceObject
{
54 Modifications modifications
;
56 static OUString
createSegment(
57 OUString
const & templateName
, OUString
const & name
);
59 static sal_Int32
parseSegment(
60 OUString
const & path
, sal_Int32 index
, OUString
* name
,
61 bool * setElement
, OUString
* templateName
);
63 static OUString
fullTemplateName(
64 OUString
const & component
, OUString
const & name
);
66 //TODO: better rules under which circumstances a short template name matches
67 static bool equalTemplateNames(
68 OUString
const & shortName
, OUString
const & longName
);
70 static rtl::Reference
< Node
> findNode(
71 int layer
, NodeMap
const & map
, OUString
const & name
);
75 rtl::Reference
< Node
> resolvePathRepresentation(
76 OUString
const & pathRepresentation
,
77 OUString
* canonicRepresenation
, Path
* path
, int * finalizedLayer
)
80 rtl::Reference
< Node
> getTemplate(
81 int layer
, OUString
const & fullName
) const;
83 NodeMap
& getComponents() const;
85 Additions
* addExtensionXcuAdditions(
86 OUString
const & url
, int layer
);
88 rtl::Reference
< ExtensionXcu
> removeExtensionXcuAdditions(
89 OUString
const & url
);
92 typedef std::map
< OUString
, rtl::Reference
< ExtensionXcu
> >
93 ExtensionXcuAdditions
;
95 rtl::Reference
< Node
> root_
;
97 ExtensionXcuAdditions extensionXcuAdditions_
;
104 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */