Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #ifndef INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_MANAGER_DP_ACTIVEPACKAGES_HXX
30 : : #define INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_MANAGER_DP_ACTIVEPACKAGES_HXX
31 : :
32 : : #include "sal/config.h"
33 : :
34 : : #include <utility>
35 : : #include <vector>
36 : :
37 : : #if !defined(ANDROID) && !defined(IOS)
38 : : #include "dp_persmap.h"
39 : : #endif
40 : :
41 : : namespace rtl { class OUString; }
42 : :
43 : : namespace dp_manager {
44 : :
45 : : class ActivePackages {
46 : : public:
47 : 19810 : struct Data {
48 : 3404 : Data(): failedPrerequisites(::rtl::OUString::valueOf((sal_Int32)0))
49 : 3404 : {}
50 : : /* name of the temporary file (shared, user extension) or the name of
51 : : the folder of the bundled extension.
52 : : It does not contain the trailing '_' of the folder.
53 : : UTF-8 encoded
54 : : */
55 : : ::rtl::OUString temporaryName;
56 : : /* The file name (shared, user) or the folder name (bundled)
57 : : If the key is the file name, then file name is not encoded.
58 : : If the key is the idendifier then the file name is UTF-8 encoded.
59 : : */
60 : : ::rtl::OUString fileName;
61 : : ::rtl::OUString mediaType;
62 : : ::rtl::OUString version;
63 : : /* If this string contains the value according to
64 : : com::sun::star::deployment::Prerequisites or "0". That is, if
65 : : the value is > 0 then
66 : : the call to XPackage::checkPrerequisites failed.
67 : : In this case the extension must not be registered.
68 : : */
69 : : ::rtl::OUString failedPrerequisites;
70 : : };
71 : :
72 : : typedef ::std::vector< ::std::pair< ::rtl::OUString, Data > > Entries;
73 : :
74 : : ActivePackages();
75 : :
76 : : ActivePackages(::rtl::OUString const & url);
77 : :
78 : : ~ActivePackages();
79 : :
80 : : bool has(::rtl::OUString const & id, ::rtl::OUString const & fileName)
81 : : const;
82 : :
83 : : bool get(
84 : : Data * data, ::rtl::OUString const & id,
85 : : ::rtl::OUString const & fileName) const;
86 : :
87 : : Entries getEntries() const;
88 : :
89 : : void put(::rtl::OUString const & id, Data const & value);
90 : :
91 : : void erase(::rtl::OUString const & id, ::rtl::OUString const & fileName);
92 : :
93 : : private:
94 : : ActivePackages(ActivePackages &); // not defined
95 : : void operator =(ActivePackages &); // not defined
96 : : #if !defined(ANDROID) && !defined(IOS)
97 : : ::dp_misc::PersistentMap m_map;
98 : : #endif
99 : : };
100 : :
101 : : }
102 : :
103 : : #endif
104 : :
105 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|