LibreOffice Module vcl (master) 1
|
This class provides information about an icon theme. More...
#include <IconThemeInfo.hxx>
Public Member Functions | |
IconThemeInfo (const OUString &urlToFile) | |
Construct an IconThemeInfo from the URL to a file. More... | |
const OUString & | GetDisplayName () const |
const OUString & | GetThemeId () const |
const OUString & | GetUrlToFile () const |
Static Public Member Functions | |
static Size | SizeByThemeName (std::u16string_view) |
Obtain the icon size by theme name. More... | |
static bool | UrlCanBeParsed (std::u16string_view url) |
Check whether an IconThemeInfo can be constructed from a URL. More... | |
static const vcl::IconThemeInfo & | FindIconThemeById (const std::vector< vcl::IconThemeInfo > &themes, const OUString &themeId) |
Find an icon theme by its id in a vector. More... | |
static bool | IconThemeIsInVector (const std::vector< vcl::IconThemeInfo > &themes, const OUString &themeId) |
Check whether a theme with a specified id is in a vector of IconThemeInfo. More... | |
Static Public Attributes | |
static constexpr OUStringLiteral | HIGH_CONTRAST_ID_BRIGHT = u"sifr" |
The name of the icon theme to use for high contrast mode. More... | |
static constexpr OUStringLiteral | HIGH_CONTRAST_ID_DARK = u"sifr_dark" |
Private Member Functions | |
IconThemeInfo () | |
private constructor for testing purposes only More... | |
Static Private Member Functions | |
static OUString | FileNameToThemeId (std::u16string_view) |
Determine the icon theme name from the filename If the name has an underscore, the name is taken from the first underscore to the last dot, e.g., images_oxygen.zip becomes oxygen If the name does not have an underscore in it, the whole name until the last dot is returned, e.g. More... | |
static OUString | ThemeIdToDisplayName (const OUString &) |
Creates the display name for the given id of a file. More... | |
Private Attributes | |
OUString | mDisplayName |
The name which is presented to the user. More... | |
OUString | mThemeId |
The theme id. More... | |
OUString | mUrlToFile |
The url to the icon theme package. More... | |
Friends | |
class | ::IconThemeInfoTest |
class | ::IconThemeScannerTest |
class | ::IconThemeSelectorTest |
This class provides information about an icon theme.
Definition at line 28 of file IconThemeInfo.hxx.
vcl::IconThemeInfo::IconThemeInfo | ( | const OUString & | urlToFile | ) |
Construct an IconThemeInfo from the URL to a file.
This method will throw a std::runtime_error if the URL cannot be properly parsed. Check the URL with UrlCanBeParsed() first.
Definition at line 46 of file IconThemeInfo.cxx.
References FileNameToThemeId(), mDisplayName, mThemeId, and ThemeIdToDisplayName().
|
private |
private constructor for testing purposes only
Definition at line 42 of file IconThemeInfo.cxx.
|
staticprivate |
Determine the icon theme name from the filename If the name has an underscore, the name is taken from the first underscore to the last dot, e.g., images_oxygen.zip becomes oxygen If the name does not have an underscore in it, the whole name until the last dot is returned, e.g.
default.zip becomes default
Definition at line 94 of file IconThemeInfo.cxx.
References vcl::EXTENSION_FOR_ICON_PACKAGES, and vcl::ICON_THEME_PACKAGE_PREFIX.
Referenced by IconThemeInfo().
|
static |
Find an icon theme by its id in a vector.
Throws a runtime_error if the theme is not contained in the vector
Definition at line 161 of file IconThemeInfo.cxx.
|
inline |
Definition at line 41 of file IconThemeInfo.hxx.
Referenced by vcl::IconThemeScanner::AddIconThemeByPath().
|
inline |
Definition at line 43 of file IconThemeInfo.hxx.
Referenced by vcl::IconThemeScanner::AddIconThemeByPath().
|
inline |
Definition at line 45 of file IconThemeInfo.hxx.
|
static |
Check whether a theme with a specified id is in a vector of IconThemeInfo.
Definition at line 173 of file IconThemeInfo.cxx.
Referenced by vcl::IconThemeScanner::IconThemeIsInstalled().
|
static |
Obtain the icon size by theme name.
Definition at line 60 of file IconThemeInfo.cxx.
References u.
Referenced by ToolBox::GetDefaultImageSize().
|
staticprivate |
Creates the display name for the given id of a file.
Currently, we only uppercase the id.
Definition at line 111 of file IconThemeInfo.cxx.
Referenced by IconThemeInfo().
|
static |
Check whether an IconThemeInfo can be constructed from a URL.
Definition at line 71 of file IconThemeInfo.cxx.
References vcl::EXTENSION_FOR_ICON_PACKAGES, and vcl::ICON_THEME_PACKAGE_PREFIX.
Referenced by vcl::IconThemeScanner::AddIconThemeByPath(), and vcl::IconThemeScanner::FileIsValidIconTheme().
|
friend |
Definition at line 91 of file IconThemeInfo.hxx.
|
friend |
Definition at line 92 of file IconThemeInfo.hxx.
|
friend |
Definition at line 93 of file IconThemeInfo.hxx.
|
staticconstexpr |
The name of the icon theme to use for high contrast mode.
Definition at line 32 of file IconThemeInfo.hxx.
Referenced by vcl::IconThemeSelector::SelectIconTheme().
|
staticconstexpr |
Definition at line 33 of file IconThemeInfo.hxx.
Referenced by vcl::IconThemeSelector::SelectIconTheme().
|
private |
The name which is presented to the user.
Definition at line 85 of file IconThemeInfo.hxx.
Referenced by IconThemeInfo().
|
private |
The theme id.
This id is used in ... to determine the file name
Definition at line 87 of file IconThemeInfo.hxx.
Referenced by IconThemeInfo().
|
private |
The url to the icon theme package.
Definition at line 89 of file IconThemeInfo.hxx.