LibreOffice Module vcl (master) 1
|
This class scans a folder for icon themes and provides the results. More...
#include <IconThemeScanner.hxx>
Public Member Functions | |
const std::vector< IconThemeInfo > & | GetFoundIconThemes () const |
const IconThemeInfo & | GetIconThemeInfo (const OUString &themeId) |
Get the IconThemeInfo for a theme. More... | |
bool | IconThemeIsInstalled (const OUString &themeId) const |
Checks whether the theme with the provided name has been found in the scanned directory. More... | |
Static Public Member Functions | |
static std::shared_ptr< IconThemeScanner > | Create (std::u16string_view path) |
Factory method to create the object. More... | |
static OUString | GetStandardIconThemePath () |
This method will return the standard path where icon themes are located. More... | |
Private Member Functions | |
IconThemeScanner () | |
void | ScanDirectoryForIconThemes (std::u16string_view path) |
Scan a directory for icon themes. More... | |
bool | AddIconThemeByPath (const OUString &path) |
Adds the provided icon theme by path. More... | |
Static Private Member Functions | |
static std::vector< OUString > | ReadIconThemesFromPath (const OUString &dir) |
Scans the provided directory for icon themes. More... | |
static bool | FileIsValidIconTheme (const OUString &) |
Check whether a single file is valid. More... | |
Private Attributes | |
std::vector< IconThemeInfo > | mFoundIconThemes |
Friends | |
class | ::IconThemeScannerTest |
This class scans a folder for icon themes and provides the results.
Definition at line 28 of file IconThemeScanner.hxx.
|
private |
Definition at line 60 of file IconThemeScanner.cxx.
|
private |
Adds the provided icon theme by path.
Definition at line 102 of file IconThemeScanner.cxx.
References vcl::IconThemeInfo::GetDisplayName(), vcl::IconThemeInfo::GetThemeId(), mFoundIconThemes, SAL_INFO, and vcl::IconThemeInfo::UrlCanBeParsed().
Referenced by ScanDirectoryForIconThemes().
|
static |
Factory method to create the object.
Provide a path to search for IconThemes.
Definition at line 172 of file IconThemeScanner.cxx.
Referenced by StyleSettings::DetermineIconTheme(), StyleSettings::GetAutomaticallyChosenIconTheme(), and StyleSettings::GetInstalledIconThemes().
|
staticprivate |
Check whether a single file is valid.
Definition at line 145 of file IconThemeScanner.cxx.
References SAL_INFO, and vcl::IconThemeInfo::UrlCanBeParsed().
Referenced by ReadIconThemesFromPath().
|
inline |
Definition at line 40 of file IconThemeScanner.hxx.
const vcl::IconThemeInfo & vcl::IconThemeScanner::GetIconThemeInfo | ( | const OUString & | themeId | ) |
Get the IconThemeInfo for a theme.
If the theme id is not among the found themes, a std::runtime_error will be thrown. Use IconThemeIsInstalled() to check whether it is available.
Definition at line 202 of file IconThemeScanner.cxx.
References mFoundIconThemes, and SAL_WARN.
|
static |
This method will return the standard path where icon themes are located.
Definition at line 180 of file IconThemeScanner.cxx.
References SvtPathOptions::GetIconsetPath().
Referenced by ImplImageTree::createStyle(), StyleSettings::DetermineIconTheme(), StyleSettings::GetAutomaticallyChosenIconTheme(), and StyleSettings::GetInstalledIconThemes().
bool vcl::IconThemeScanner::IconThemeIsInstalled | ( | const OUString & | themeId | ) | const |
Checks whether the theme with the provided name has been found in the scanned directory.
Definition at line 166 of file IconThemeScanner.cxx.
References vcl::IconThemeInfo::IconThemeIsInVector(), and mFoundIconThemes.
|
staticprivate |
Scans the provided directory for icon themes.
The returned strings will contain the URLs to the icon themes.
Definition at line 116 of file IconThemeScanner.cxx.
References FileIsValidIconTheme(), and SAL_INFO.
Referenced by ScanDirectoryForIconThemes().
|
private |
Scan a directory for icon themes.
Definition at line 63 of file IconThemeScanner.cxx.
References AddIconThemeByPath(), o3tl::getToken(), mFoundIconThemes, nIndex, ReadIconThemesFromPath(), SAL_INFO, and SAL_WARN.
|
friend |
Definition at line 79 of file IconThemeScanner.hxx.
|
private |
Definition at line 77 of file IconThemeScanner.hxx.
Referenced by AddIconThemeByPath(), GetIconThemeInfo(), IconThemeIsInstalled(), and ScanDirectoryForIconThemes().