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 #ifndef INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_INC_DP_DESCRIPTIONINFOSET_HXX
21 #define INCLUDED_DESKTOP_SOURCE_DEPLOYMENT_INC_DP_DESCRIPTIONINFOSET_HXX
22 
23 #include <sal/config.h>
24 
25 #include <boost/optional.hpp>
26 #include <com/sun/star/uno/Reference.hxx>
27 #include <com/sun/star/uno/Sequence.hxx>
28 #include <sal/types.h>
29 #include "dp_misc_api.hxx"
30 
32 
33 namespace com { namespace sun { namespace star {
34  namespace uno { class XComponentContext; }
35  namespace xml {
36  namespace dom {
37  class XNode;
38  class XNodeList;
39  }
40  namespace xpath { class XXPathAPI; }
41  }
42 } } }
43 
44 namespace dp_misc {
45 
47 {
48  OUString acceptBy;
49  //Attribute suppress-on-update. Default is false.
51  //Attribute suppress-if-required. Default is false.
53 };
54 
55 
63 public:
75  css::uno::Reference< css::uno::XComponentContext > const & context,
76  css::uno::Reference< css::xml::dom::XNode > const & element);
77 
79 
87 
94  OUString getVersion() const;
95 
111  css::uno::Sequence< OUString > getSupportedPlatforms() const;
112 
118  std::pair< OUString, OUString > getLocalizedPublisherNameAndURL() const;
119 
125  OUString getLocalizedReleaseNotesURL() const;
126 
131  OUString getLocalizedLicenseURL() const;
132 
138  ::boost::optional<SimpleLicenseAttributes> getSimpleLicenseAttributes() const;
139 
144  OUString getLocalizedDisplayName() const;
145 
165  ::boost::optional< OUString > getLocalizedUpdateWebsiteURL() const;
166 
171  OUString getLocalizedDescriptionURL() const;
178  css::uno::Reference< css::xml::dom::XNodeList >
179  getDependencies() const;
180 
187  css::uno::Sequence< OUString > getUpdateInformationUrls() const;
188 
199  css::uno::Sequence< OUString > getUpdateDownloadUrls() const;
200 
204  OUString getIconURL( bool bHighContrast ) const;
205 
206  bool hasDescription() const;
207 
208 private:
209  SAL_DLLPRIVATE ::boost::optional< OUString > getOptionalValue(
210  OUString const & expression) const;
211 
212  SAL_DLLPRIVATE css::uno::Sequence< OUString > getUrls(
213  OUString const & expression) const;
214 
224  SAL_DLLPRIVATE css::uno::Reference< css::xml::dom::XNode >
225  getLocalizedChild( OUString const & sParent) const;
226  SAL_DLLPRIVATE css::uno::Reference< css::xml::dom::XNode>
227  matchLanguageTag(
228  css::uno::Reference< css::xml::dom::XNode > const & xParent,
229  OUString const & rTag) const;
230 
238  SAL_DLLPRIVATE css::uno::Reference< css::xml::dom::XNode>
239  getChildWithDefaultLocale(
240  css::uno::Reference< css::xml::dom::XNode > const & xParent) const;
245  SAL_DLLPRIVATE OUString getLocalizedHREFAttrFromChild(
246  OUString const & sXPathParent, bool * out_bParentExists) const;
247 
252  SAL_DLLPRIVATE OUString
253  getNodeValueFromExpression(OUString const & expression) const;
254 
258  SAL_DLLPRIVATE void
259  checkBlacklist() const;
260 
263  SAL_DLLPRIVATE static bool
264  checkBlacklistVersion(const OUString& currentversion,
265  css::uno::Sequence< OUString > const & versions);
266 
267  css::uno::Reference< css::uno::XComponentContext > m_context;
268  css::uno::Reference< css::xml::dom::XNode > m_element;
269  css::uno::Reference< css::xml::xpath::XXPathAPI > m_xpath;
270 };
271 
273 {
274  return m_element.is();
275 }
276 
283 DescriptionInfoset getDescriptionInfoset(OUString const & sExtensionFolderURL);
284 }
285 
286 #endif
287 
288 /* 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:29
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.