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.
20class IconThemeInfoTest;
21class IconThemeSelectorTest;
22class IconThemeScannerTest;
23
24namespace vcl
25{
29{
30public:
32 static constexpr OUStringLiteral HIGH_CONTRAST_ID_BRIGHT = u"sifr";
33 static constexpr OUStringLiteral HIGH_CONTRAST_ID_DARK = u"sifr_dark";
34
39 IconThemeInfo(const OUString& urlToFile);
40
41 const OUString& GetDisplayName() const { return mDisplayName; }
42
43 const OUString& GetThemeId() const { return mThemeId; }
44
45 const OUString& GetUrlToFile() const { return mUrlToFile; }
46
52 static Size SizeByThemeName(std::u16string_view);
53
55 static bool UrlCanBeParsed(std::u16string_view url);
56
60 static const vcl::IconThemeInfo&
61 FindIconThemeById(const std::vector<vcl::IconThemeInfo>& themes, const OUString& themeId);
62
64 static bool IconThemeIsInVector(const std::vector<vcl::IconThemeInfo>& themes,
65 const OUString& themeId);
66
67private:
70
77 static OUString FileNameToThemeId(std::u16string_view);
78
82 static OUString ThemeIdToDisplayName(const OUString&);
83
85 OUString mDisplayName;
87 OUString mThemeId;
89 OUString mUrlToFile;
90
91 friend class ::IconThemeInfoTest;
92 friend class ::IconThemeScannerTest;
93 friend class ::IconThemeSelectorTest;
94};
95
96} // namespace vcl
97
98#endif // INCLUDED_VCL_ICONTHEMEINFO_HXX
This class provides information about an icon theme.
const OUString & GetThemeId() const
OUString mDisplayName
The name which is presented to the user.
OUString mUrlToFile
The url to the icon theme package.
const OUString & GetUrlToFile() const
const OUString & GetDisplayName() const
OUString mThemeId
The theme id.
#define VCL_DLLPUBLIC
Definition: dllapi.h:29
float u