bump product version to 5.0.4.1
[LibreOffice.git] / configmgr / source / data.hxx
blob681bf55aa2617d2429786d063eec43ef8cac92a4
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 #ifndef INCLUDED_CONFIGMGR_SOURCE_DATA_HXX
21 #define INCLUDED_CONFIGMGR_SOURCE_DATA_HXX
23 #include <sal/config.h>
25 #include <climits>
26 #include "config_map.hxx"
27 #include <vector>
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"
37 #include "path.hxx"
39 namespace configmgr {
41 class Node;
43 struct Data {
44 enum { NO_LAYER = INT_MAX };
46 struct ExtensionXcu: public salhelper::SimpleReferenceObject {
47 int layer;
48 Additions additions;
51 NodeMap templates;
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);
69 Data();
71 rtl::Reference< Node > resolvePathRepresentation(
72 OUString const & pathRepresentation,
73 OUString * canonicRepresenation, Path * path, int * finalizedLayer)
74 const;
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);
87 private:
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_;
101 #endif
103 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */