Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_MANAGER_DP_ACTIVEPACKAGES_HXX
21 : #define INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_MANAGER_DP_ACTIVEPACKAGES_HXX
22 :
23 : #include <config_features.h>
24 :
25 : #include <sal/config.h>
26 :
27 : #include <utility>
28 : #include <vector>
29 :
30 : #if HAVE_FEATURE_EXTENSIONS
31 : #include "dp_persmap.h"
32 : #endif
33 :
34 :
35 : namespace dp_manager {
36 :
37 : class ActivePackages {
38 : public:
39 35 : struct Data {
40 28 : Data(): failedPrerequisites("0")
41 28 : {}
42 : /* name of the temporary file (shared, user extension) or the name of
43 : the folder of the bundled extension.
44 : It does not contain the trailing '_' of the folder.
45 : UTF-8 encoded
46 : */
47 : OUString temporaryName;
48 : /* The file name (shared, user) or the folder name (bundled)
49 : If the key is the file name, then file name is not encoded.
50 : If the key is the idendifier then the file name is UTF-8 encoded.
51 : */
52 : OUString fileName;
53 : OUString mediaType;
54 : OUString version;
55 : /* If this string contains the value according to
56 : com::sun::star::deployment::Prerequisites or "0". That is, if
57 : the value is > 0 then
58 : the call to XPackage::checkPrerequisites failed.
59 : In this case the extension must not be registered.
60 : */
61 : OUString failedPrerequisites;
62 : };
63 :
64 : typedef ::std::vector< ::std::pair< OUString, Data > > Entries;
65 :
66 : ActivePackages();
67 :
68 : ActivePackages(OUString const & url, bool readOnly);
69 :
70 : ~ActivePackages();
71 :
72 : bool has(OUString const & id, OUString const & fileName)
73 : const;
74 :
75 : bool get(
76 : Data * data, OUString const & id,
77 : OUString const & fileName) const;
78 :
79 : Entries getEntries() const;
80 :
81 : void put(OUString const & id, Data const & value);
82 :
83 : void erase(OUString const & id, OUString const & fileName);
84 :
85 : private:
86 : ActivePackages(ActivePackages &) SAL_DELETED_FUNCTION;
87 : void operator =(ActivePackages &) SAL_DELETED_FUNCTION;
88 : #if HAVE_FEATURE_EXTENSIONS
89 : ::dp_misc::PersistentMap m_map;
90 : #endif
91 : };
92 :
93 : }
94 :
95 : #endif
96 :
97 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|