LibreOffice Module vcl (master)  1
Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
vcl::IconThemeInfo Class Reference

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 (const OUString &)
 Obtain the icon size by theme name. More...
 
static bool UrlCanBeParsed (const OUString &url)
 Check whether an IconThemeInfo can be constructed from a URL. More...
 
static const vcl::IconThemeInfoFindIconThemeById (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 const OUStringLiteral HIGH_CONTRAST_ID
 The name of the icon theme to use for high contrast mode. More...
 

Private Member Functions

 IconThemeInfo ()
 private constructor for testing purposes only More...
 

Static Private Member Functions

static OUString FileNameToThemeId (const OUString &)
 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
 

Detailed Description

This class provides information about an icon theme.

Definition at line 28 of file IconThemeInfo.hxx.

Constructor & Destructor Documentation

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 50 of file IconThemeInfo.cxx.

References FileNameToThemeId(), mDisplayName, mThemeId, and ThemeIdToDisplayName().

vcl::IconThemeInfo::IconThemeInfo ( )
private

private constructor for testing purposes only

Definition at line 46 of file IconThemeInfo.cxx.

Member Function Documentation

OUString vcl::IconThemeInfo::FileNameToThemeId ( const OUString &  filename)
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 98 of file IconThemeInfo.cxx.

Referenced by IconThemeInfo().

const vcl::IconThemeInfo & vcl::IconThemeInfo::FindIconThemeById ( const std::vector< vcl::IconThemeInfo > &  themes,
const OUString &  themeId 
)
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 171 of file IconThemeInfo.cxx.

const OUString& vcl::IconThemeInfo::GetDisplayName ( ) const
inline

Definition at line 41 of file IconThemeInfo.hxx.

Referenced by vcl::IconThemeScanner::AddIconThemeByPath().

const OUString& vcl::IconThemeInfo::GetThemeId ( ) const
inline

Definition at line 43 of file IconThemeInfo.hxx.

Referenced by vcl::IconThemeScanner::AddIconThemeByPath().

const OUString& vcl::IconThemeInfo::GetUrlToFile ( ) const
inline

Definition at line 45 of file IconThemeInfo.hxx.

bool vcl::IconThemeInfo::IconThemeIsInVector ( const std::vector< vcl::IconThemeInfo > &  themes,
const OUString &  themeId 
)
static

Check whether a theme with a specified id is in a vector of IconThemeInfo.

Definition at line 183 of file IconThemeInfo.cxx.

Referenced by vcl::IconThemeScanner::IconThemeIsInstalled().

Size vcl::IconThemeInfo::SizeByThemeName ( const OUString &  themeName)
static

Obtain the icon size by theme name.

Definition at line 64 of file IconThemeInfo.cxx.

Referenced by ToolBox::GetDefaultImageSize().

OUString vcl::IconThemeInfo::ThemeIdToDisplayName ( const OUString &  themeId)
staticprivate

Creates the display name for the given id of a file.

Currently, we only uppercase the id.

Definition at line 115 of file IconThemeInfo.cxx.

Referenced by IconThemeInfo().

bool vcl::IconThemeInfo::UrlCanBeParsed ( const OUString &  url)
static

Check whether an IconThemeInfo can be constructed from a URL.

Definition at line 75 of file IconThemeInfo.cxx.

Referenced by vcl::IconThemeScanner::AddIconThemeByPath(), and vcl::IconThemeScanner::FileIsValidIconTheme().

Friends And Related Function Documentation

friend class ::IconThemeInfoTest
friend

Definition at line 91 of file IconThemeInfo.hxx.

friend class ::IconThemeScannerTest
friend

Definition at line 92 of file IconThemeInfo.hxx.

friend class ::IconThemeSelectorTest
friend

Definition at line 93 of file IconThemeInfo.hxx.

Member Data Documentation

const OUStringLiteral vcl::IconThemeInfo::HIGH_CONTRAST_ID
static

The name of the icon theme to use for high contrast mode.

Definition at line 33 of file IconThemeInfo.hxx.

Referenced by vcl::IconThemeSelector::SelectIconTheme().

OUString vcl::IconThemeInfo::mDisplayName
private

The name which is presented to the user.

Definition at line 85 of file IconThemeInfo.hxx.

Referenced by IconThemeInfo().

OUString vcl::IconThemeInfo::mThemeId
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().

OUString vcl::IconThemeInfo::mUrlToFile
private

The url to the icon theme package.

Definition at line 89 of file IconThemeInfo.hxx.


The documentation for this class was generated from the following files: