LibreOffice Module vcl (master)  1
FeatureParser.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 
10 #ifndef INCLUDED_VCL_FONT_FEATUREPASER_HXX
11 #define INCLUDED_VCL_FONT_FEATUREPASER_HXX
12 
13 #include <vcl/dllapi.h>
14 #include <rtl/ustring.hxx>
15 #include <vector>
16 #include <unordered_map>
17 
18 #include <vcl/font/Feature.hxx>
19 
20 namespace vcl
21 {
22 namespace font
23 {
24 // These must not conflict with font name lists which use ; and ,
25 constexpr const char FeaturePrefix = ':';
26 constexpr const char FeatureSeparator = '&';
27 
28 VCL_DLLPUBLIC OUString trimFontNameFeatures(OUString const& rFontName);
29 
31 {
32 private:
33  OUString m_sLanguage;
34  std::vector<FeatureSetting> m_aFeatures;
35 
36 public:
37  FeatureParser(OUString const& sFontName);
38 
39  OUString const& getLanguage() const { return m_sLanguage; }
40 
41  std::vector<FeatureSetting> const& getFeatures() const { return m_aFeatures; }
42 
43  std::unordered_map<uint32_t, uint32_t> getFeaturesMap() const;
44 };
45 
46 } // end font namespace
47 } // end vcl namespace
48 
49 #endif // INCLUDED_VCL_FONT_FEATUREPASER_HXX
50 
51 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString const & getLanguage() const
constexpr const char FeaturePrefix
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
OUString trimFontNameFeatures(OUString const &rFontName)
std::vector< FeatureSetting > m_aFeatures
constexpr const char FeatureSeparator
std::vector< FeatureSetting > const & getFeatures() const