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_COMPONENTS_HXX
21 #define INCLUDED_CONFIGMGR_SOURCE_COMPONENTS_HXX
23 #include "sal/config.h"
28 #include "boost/noncopyable.hpp"
29 #include "boost/shared_ptr.hpp"
30 #include "com/sun/star/beans/Optional.hpp"
31 #include "com/sun/star/uno/Reference.hxx"
32 #include "rtl/ref.hxx"
34 #include "additions.hxx"
36 #include "modifications.hxx"
39 namespace com
{ namespace sun
{ namespace star
{
40 namespace beans
{ class XPropertySet
; }
43 class XComponentContext
;
54 class Components
: private boost::noncopyable
{
56 static Components
& getSingleton(
57 com::sun::star::uno::Reference
< com::sun::star::uno::XComponentContext
>
60 static bool allLocales(OUString
const & locale
);
62 rtl::Reference
< Node
> resolvePathRepresentation(
63 OUString
const & pathRepresentation
,
64 OUString
* canonicRepresenation
, Path
* path
, int * finalizedLayer
)
67 rtl::Reference
< Node
> getTemplate(
68 int layer
, OUString
const & fullName
) const;
70 void addRootAccess(rtl::Reference
< RootAccess
> const & access
);
72 void removeRootAccess(RootAccess
* access
);
74 void initGlobalBroadcaster(
75 Modifications
const & modifications
,
76 rtl::Reference
< RootAccess
> const & exclude
,
77 Broadcaster
* broadcaster
);
79 void addModification(Path
const & path
);
81 void writeModifications();
83 bool hasModifications() const;
85 void flushModifications();
86 // must be called with configmgr::lock unaquired; must be called before
87 // shutdown if writeModifications has ever been called (probably
88 // indirectly, via removeExtensionXcuFile)
90 void insertExtensionXcsFile(bool shared
, OUString
const & fileUri
);
92 void insertExtensionXcuFile(
93 bool shared
, OUString
const & fileUri
,
94 Modifications
* modifications
);
96 void removeExtensionXcuFile(
97 OUString
const & fileUri
, Modifications
* modifications
);
99 void insertModificationXcuFile(
100 OUString
const & fileUri
,
101 std::set
< OUString
> const & includedPaths
,
102 std::set
< OUString
> const & excludedPaths
,
103 Modifications
* modifications
);
105 com::sun::star::beans::Optional
< com::sun::star::uno::Any
>
106 getExternalValue(OUString
const & descriptor
);
109 typedef void FileParser(
110 OUString
const &, int, Data
&, Partial
const *, Modifications
*,
114 com::sun::star::uno::Reference
< com::sun::star::uno::XComponentContext
>
120 void parseFileLeniently(
121 FileParser
* parseFile
, OUString
const & url
, int layer
,
122 Data
& data
, Partial
const * partial
, Modifications
* modifications
,
123 Additions
* additions
);
126 int layer
, OUString
const & extension
, FileParser
* parseFile
,
127 OUString
const & url
, bool recursive
);
130 int layer
, FileParser
* parseFile
, OUString
const & urls
,
131 bool recordAdditions
);
133 void parseXcdFiles(int layer
, OUString
const & url
);
135 void parseXcsXcuLayer(int layer
, OUString
const & url
);
137 void parseXcsXcuIniLayer(
138 int layer
, OUString
const & url
, bool recordAdditions
);
140 void parseModuleLayer(int layer
, OUString
const & url
);
142 void parseResLayer(int layer
, OUString
const & url
);
144 void parseModificationLayer(OUString
const & url
);
146 int getExtensionLayer(bool shared
);
148 typedef std::set
< RootAccess
* > WeakRootSet
;
153 com::sun::star::uno::Reference
<
154 com::sun::star::beans::XPropertySet
> >
159 com::sun::star::uno::Reference
< com::sun::star::uno::XComponentContext
>
163 ExternalServices externalServices_
;
164 rtl::Reference
< WriteThread
> writeThread_
;
165 int sharedExtensionLayer_
;
166 int userExtensionLayer_
;
167 OUString modificationFileUrl_
;
168 boost::shared_ptr
<osl::Mutex
> lock_
;
175 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */