LibreOffice Module desktop (master)  1
dp_activepackages.hxx
Go to the documentation of this file.
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 #pragma once
21 
22 #include <config_extensions.h>
23 
24 #include <sal/config.h>
25 
26 #include <utility>
27 #include <vector>
28 
29 #if HAVE_FEATURE_EXTENSIONS
30 #include <dp_persmap.h>
31 #endif
32 
33 
34 namespace dp_manager {
35 
37 public:
38  struct Data {
40  {}
41  /* name of the temporary file (shared, user extension) or the name of
42  the folder of the bundled extension.
43  It does not contain the trailing '_' of the folder.
44  UTF-8 encoded
45  */
46  OUString temporaryName;
47  /* The file name (shared, user) or the folder name (bundled)
48  If the key is the file name, then file name is not encoded.
49  If the key is the identifier then the file name is UTF-8 encoded.
50  */
51  OUString fileName;
52  OUString mediaType;
53  OUString version;
54  /* If this string contains the value according to
55  css::deployment::Prerequisites or "0". That is, if
56  the value is > 0 then
57  the call to XPackage::checkPrerequisites failed.
58  In this case the extension must not be registered.
59  */
61  };
62 
63  typedef std::vector< std::pair< OUString, Data > > Entries;
64 
66 
67  explicit ActivePackages(OUString const & url);
68 
70 
71  bool has(OUString const & id, OUString const & fileName)
72  const;
73 
74  bool get(
75  Data * data, OUString const & id,
76  OUString const & fileName) const;
77 
78  Entries getEntries() const;
79 
80  void put(OUString const & id, Data const & value);
81 
82  void erase(OUString const & id, OUString const & fileName);
83 
84 private:
85  ActivePackages(ActivePackages const &) = delete;
86  ActivePackages& operator =(ActivePackages const &) = delete;
87 #if HAVE_FEATURE_EXTENSIONS
89 #endif
90 };
91 
92 }
93 
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void erase(OUString const &id, OUString const &fileName)
void put(OUString const &id, Data const &value)
t_map m_map
std::vector< std::pair< OUString, Data > > Entries
bool has(OUString const &id, OUString const &fileName) const
exports com.sun.star.chart2. data
ActivePackages & operator=(ActivePackages const &)=delete