API Documentation
Documentation for developing SailfishOS applicationsThemeIconResolver Class
Allows to request theme icons. More...
| Header: | #include <silicathemeiconresolver.h> |
Public Types
| enum | InitFlags { NoContent, LoadDefaultTheme } |
Public Functions
| ThemeIconResolver() | |
| ThemeIconResolver(InitFlags initFlags) | |
| virtual | ~ThemeIconResolver() |
| void | addIconRoot(const QString &path) |
| IconInfo | resolveIcon(const QString &id) const |
| IconInfo | resolveIcon(const QString &id, Silica::Theme::ColorScheme colorScheme) const |
| QString | resolvePath(const QString &id) const |
| QString | resolvePath(const QString &id, Silica::Theme::ColorScheme colorScheme) const |
Detailed Description
Allows to request theme icons.
Member Type Documentation
enum ThemeIconResolver::InitFlags
| Constant | Value | Description |
|---|---|---|
ThemeIconResolver::NoContent | 0x0 | Used to instantiate the ImageProvider with no content loaded |
ThemeIconResolver::LoadDefaultTheme | 0x1 | Used to instantiate the ImageProvider with default theme loaded |
Member Function Documentation
ThemeIconResolver::ThemeIconResolver()
Default constructs an instance of ThemeIconResolver.
ThemeIconResolver::ThemeIconResolver(InitFlags initFlags)
Default constructs an instance of ThemeIconResolver.
[virtual] ThemeIconResolver::~ThemeIconResolver()
Destroys the instance of ThemeIconResolver. The destructor is virtual.
void ThemeIconResolver::addIconRoot(const QString &path)
addIconRoot Add an icon root to be used for icon lookups.
This can include multiple 'zN.M' subdirectories where N.M signify the pixel ratio using two decimals, or one if last is zero. The root and the pixel ratio subdirectories can contain 'icons' and 'icons-monochrome' directories for the icon content. path Path of the icon root.
IconInfo ThemeIconResolver::resolveIcon(const QString &id) const
resolveIcon Resolves icon info from an icon id. id Identifier of the image.
Returns info object for the lookup result. If icon is not found, it has an empty path.
IconInfo ThemeIconResolver::resolveIcon(const QString &id, Silica::Theme::ColorScheme colorScheme) const
resolveIcon Resolves icon info from an icon id using given color schme id Identifier of the image. colorScheme Color scheme to be used
Returns info object for the lookup result. If icon is not found, it has an empty path.
QString ThemeIconResolver::resolvePath(const QString &id) const
resolvePath Resolves absolute path of an icon id. id Identifier of the image.
Returns absolute path of the id. If icon is not found an empty string is returned.
QString ThemeIconResolver::resolvePath(const QString &id, Silica::Theme::ColorScheme colorScheme) const
resolvePath Resolves absolute path of an icon id using a given color scheme id Identifier of the image. colorScheme Color scheme to use
Returns absolute path of the id. If icon is not found an empty string is returned.