LibreOffice Module desktop (master)  1
dp_descriptioninfoset.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 <sal/config.h>
23 
24 #include <optional>
25 #include <com/sun/star/uno/Reference.hxx>
26 #include <com/sun/star/uno/Sequence.hxx>
27 #include <sal/types.h>
28 #include "dp_misc_api.hxx"
29 
31 
32 namespace com::sun::star {
33  namespace uno { class XComponentContext; }
34  namespace xml {
35  namespace dom {
36  class XNode;
37  class XNodeList;
38  }
39  namespace xpath { class XXPathAPI; }
40  }
41 }
42 
43 namespace dp_misc {
44 
46 {
47  OUString acceptBy;
48  //Attribute suppress-on-update. Default is false.
50  //Attribute suppress-if-required. Default is false.
52 };
53 
54 
62 public:
74  css::uno::Reference< css::uno::XComponentContext > const & context,
75  css::uno::Reference< css::xml::dom::XNode > const & element);
76 
78 
85  ::std::optional< OUString > getIdentifier() const;
86 
93  OUString getVersion() const;
94 
110  css::uno::Sequence< OUString > getSupportedPlatforms() const;
111 
117  std::pair< OUString, OUString > getLocalizedPublisherNameAndURL() const;
118 
124  OUString getLocalizedReleaseNotesURL() const;
125 
130  OUString getLocalizedLicenseURL() const;
131 
137  ::std::optional<SimpleLicenseAttributes> getSimpleLicenseAttributes() const;
138 
143  OUString getLocalizedDisplayName() const;
144 
164  ::std::optional< OUString > getLocalizedUpdateWebsiteURL() const;
165 
170  OUString getLocalizedDescriptionURL() const;
177  css::uno::Reference< css::xml::dom::XNodeList >
178  getDependencies() const;
179 
186  css::uno::Sequence< OUString > getUpdateInformationUrls() const;
187 
198  css::uno::Sequence< OUString > getUpdateDownloadUrls() const;
199 
203  OUString getIconURL( bool bHighContrast ) const;
204 
205  bool hasDescription() const;
206 
207 private:
208  SAL_DLLPRIVATE ::std::optional< OUString > getOptionalValue(
209  OUString const & expression) const;
210 
211  SAL_DLLPRIVATE css::uno::Sequence< OUString > getUrls(
212  OUString const & expression) const;
213 
223  SAL_DLLPRIVATE css::uno::Reference< css::xml::dom::XNode >
224  getLocalizedChild( OUString const & sParent) const;
225  SAL_DLLPRIVATE css::uno::Reference< css::xml::dom::XNode>
226  matchLanguageTag(
227  css::uno::Reference< css::xml::dom::XNode > const & xParent,
228  OUString const & rTag) const;
229 
237  SAL_DLLPRIVATE css::uno::Reference< css::xml::dom::XNode>
238  getChildWithDefaultLocale(
239  css::uno::Reference< css::xml::dom::XNode > const & xParent) const;
244  SAL_DLLPRIVATE OUString getLocalizedHREFAttrFromChild(
245  OUString const & sXPathParent, bool * out_bParentExists) const;
246 
251  SAL_DLLPRIVATE OUString
252  getNodeValueFromExpression(OUString const & expression) const;
253 
257  SAL_DLLPRIVATE void
258  checkDenylist() const;
259 
262  SAL_DLLPRIVATE static bool
263  checkDenylistVersion(std::u16string_view currentversion,
264  css::uno::Sequence< OUString > const & versions);
265 
266  css::uno::Reference< css::uno::XComponentContext > m_context;
267  css::uno::Reference< css::xml::dom::XNode > m_element;
268  css::uno::Reference< css::xml::xpath::XXPathAPI > m_xpath;
269 };
270 
272 {
273  return m_element.is();
274 }
275 
282 DescriptionInfoset getDescriptionInfoset(OUString const & sExtensionFolderURL);
283 }
284 
285 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::xml::xpath::XXPathAPI > m_xpath
#define DESKTOP_DEPLOYMENTMISC_DLLPUBLIC
Definition: dp_misc_api.hxx:28
exports com.sun.star.xml. dom
exports com.sun.star.xml. xpath
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC DescriptionInfoset getDescriptionInfoset(OUString const &sExtensionFolderURL)
creates a DescriptionInfoset object.
css::uno::Reference< css::xml::dom::XNode > m_element
css::uno::Reference< css::uno::XComponentContext > m_context
DESKTOP_DEPLOYMENTMISC_DLLPUBLIC OUString getIdentifier(css::uno::Reference< css::deployment::XPackage > const &package)
Gets the identifier of a package.
Access to the content of an XML description element.