LibreOffice Module vcl (master)  1
IconThemeInfo.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_ICONTHEMEINFO_HXX
11 #define INCLUDED_VCL_ICONTHEMEINFO_HXX
12 
13 #include <vcl/dllapi.h>
14 #include <tools/gen.hxx>
15 #include <rtl/ustring.hxx>
16 
17 #include <vector>
18 
19 // forward declaration of unit test classes. Required for friend relationship.
20 class IconThemeInfoTest;
21 class IconThemeSelectorTest;
22 class IconThemeScannerTest;
23 
24 namespace vcl
25 {
29 {
30 public:
32  static constexpr OUStringLiteral HIGH_CONTRAST_ID = u"sifr";
33 
38  IconThemeInfo(const OUString& urlToFile);
39 
40  const OUString& GetDisplayName() const { return mDisplayName; }
41 
42  const OUString& GetThemeId() const { return mThemeId; }
43 
44  const OUString& GetUrlToFile() const { return mUrlToFile; }
45 
51  static Size SizeByThemeName(std::u16string_view);
52 
54  static bool UrlCanBeParsed(const OUString& url);
55 
59  static const vcl::IconThemeInfo&
60  FindIconThemeById(const std::vector<vcl::IconThemeInfo>& themes, const OUString& themeId);
61 
63  static bool IconThemeIsInVector(const std::vector<vcl::IconThemeInfo>& themes,
64  const OUString& themeId);
65 
66 private:
68  IconThemeInfo();
69 
76  static OUString FileNameToThemeId(const OUString&);
77 
81  static OUString ThemeIdToDisplayName(const OUString&);
82 
84  OUString mDisplayName;
86  OUString mThemeId;
88  OUString mUrlToFile;
89 
90  friend class ::IconThemeInfoTest;
91  friend class ::IconThemeScannerTest;
92  friend class ::IconThemeSelectorTest;
93 };
94 
95 } // namespace vcl
96 
97 #endif // INCLUDED_VCL_ICONTHEMEINFO_HXX
This class provides information about an icon theme.
OUString mThemeId
The theme id.
const OUString & GetThemeId() const
OUString mUrlToFile
The url to the icon theme package.
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
const OUString & GetUrlToFile() const
float u
const OUString & GetDisplayName() const
OUString mDisplayName
The name which is presented to the user.