LibreOffice Module vcl (master)  1
Classes | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
ImplImageTree Class Reference

#include <implimagetree.hxx>

Classes

struct  IconSet
 

Public Member Functions

 ImplImageTree ()
 
 ~ImplImageTree ()
 
OUString getImageUrl (OUString const &name, OUString const &style, OUString const &lang)
 
std::shared_ptr< SvMemoryStreamgetImageStream (OUString const &rName, OUString const &rStyle, OUString const &rLang)
 
bool loadImage (OUString const &name, OUString const &style, BitmapEx &bitmap, bool localized, const ImageLoadFlags eFlags, sal_Int32 nScalePercentage=-1)
 
void shutdown ()
 a crude form of life cycle control (called from DeInitVCL; otherwise, if the ImplImageTree singleton were destroyed during exit that would be too late for the destructors of the bitmaps in maIconCache) More...
 
css::uno::Reference< css::container::XNameAccess > const & getNameAccess ()
 

Private Types

typedef std::unordered_map< OUString, std::pair< bool, BitmapEx > > IconCache
 
typedef std::unordered_map< sal_Int32, std::unique_ptr< IconCache > > ScaledIconCache
 
typedef std::unordered_map< OUString, OUString > IconLinkHash
 

Private Member Functions

 ImplImageTree (const ImplImageTree &)=delete
 
ImplImageTreeoperator= (const ImplImageTree &)=delete
 
IconSetgetCurrentIconSet ()
 
bool doLoadImage (ImageRequestParameters &rParameters)
 
std::vector< OUString > getPaths (OUString const &name, LanguageTag const &rLanguageTag)
 
bool checkPathAccess ()
 
void setStyle (OUString const &rStyle)
 
void createStyle ()
 
IconCachegetIconCache (const ImageRequestParameters &rParameters)
 Find an icon cache for the right scale factor. More...
 
bool iconCacheLookup (ImageRequestParameters &rParameters)
 
bool findImage (std::vector< OUString > const &rPaths, ImageRequestParameters &rParameters)
 
void loadImageLinks ()
 
void parseLinkFile (std::shared_ptr< SvStream > const &aStream)
 
OUString const & getRealImageName (OUString const &rName)
 Return name of a real .png according to links.txt. More...
 

Static Private Member Functions

static OUString fallbackStyle (const OUString &rStyle)
 Return name of the fallback style for the provided one. More...
 

Private Attributes

std::unordered_map< OUString, IconSetmaIconSets
 Remember all the (used) icon styles and individual icons in them. More...
 
OUString maCurrentStyle
 Style used for the current operations; switches switch several times during fallback search. More...
 

Detailed Description

Definition at line 65 of file implimagetree.hxx.

Member Typedef Documentation

typedef std::unordered_map<OUString, std::pair<bool,BitmapEx> > ImplImageTree::IconCache
private

Definition at line 94 of file implimagetree.hxx.

typedef std::unordered_map<OUString, OUString> ImplImageTree::IconLinkHash
private

Definition at line 96 of file implimagetree.hxx.

typedef std::unordered_map<sal_Int32, std::unique_ptr<IconCache> > ImplImageTree::ScaledIconCache
private

Definition at line 95 of file implimagetree.hxx.

Constructor & Destructor Documentation

ImplImageTree::ImplImageTree ( )

Definition at line 199 of file ImplImageTree.cxx.

ImplImageTree::~ImplImageTree ( )

Definition at line 203 of file ImplImageTree.cxx.

ImplImageTree::ImplImageTree ( const ImplImageTree )
privatedelete

Member Function Documentation

bool ImplImageTree::checkPathAccess ( )
private
void ImplImageTree::createStyle ( )
private
bool ImplImageTree::doLoadImage ( ImageRequestParameters rParameters)
private
OUString ImplImageTree::fallbackStyle ( const OUString &  rStyle)
staticprivate

Return name of the fallback style for the provided one.

Must not be cyclic :-) The last theme in the chain returns an empty string.

Definition at line 308 of file ImplImageTree.cxx.

bool ImplImageTree::findImage ( std::vector< OUString > const &  rPaths,
ImageRequestParameters rParameters 
)
private

Definition at line 540 of file ImplImageTree.cxx.

References void().

IconSet& ImplImageTree::getCurrentIconSet ( )
inlineprivate

Definition at line 120 of file implimagetree.hxx.

References maCurrentStyle.

ImplImageTree::IconCache & ImplImageTree::getIconCache ( const ImageRequestParameters rParameters)
private

Find an icon cache for the right scale factor.

Definition at line 516 of file ImplImageTree.cxx.

References ImplImageTree::IconSet::maScaledIconCaches, and ImageRequestParameters::mnScalePercentage.

std::shared_ptr< SvMemoryStream > ImplImageTree::getImageStream ( OUString const &  rName,
OUString const &  rStyle,
OUString const &  rLang 
)
OUString ImplImageTree::getImageUrl ( OUString const &  name,
OUString const &  style,
OUString const &  lang 
)
uno::Reference< container::XNameAccess > const & ImplImageTree::getNameAccess ( )

Definition at line 691 of file ImplImageTree.cxx.

References void().

std::vector< OUString > ImplImageTree::getPaths ( OUString const &  name,
LanguageTag const &  rLanguageTag 
)
private

Definition at line 207 of file ImplImageTree.cxx.

References LanguageTag::getFallbackStrings().

OUString const & ImplImageTree::getRealImageName ( OUString const &  rName)
private

Return name of a real .png according to links.txt.

Definition at line 618 of file ImplImageTree.cxx.

bool ImplImageTree::iconCacheLookup ( ImageRequestParameters rParameters)
private
bool ImplImageTree::loadImage ( OUString const &  name,
OUString const &  style,
BitmapEx bitmap,
bool  localized,
const ImageLoadFlags  eFlags,
sal_Int32  nScalePercentage = -1 
)

Definition at line 324 of file ImplImageTree.cxx.

void ImplImageTree::loadImageLinks ( )
private

Definition at line 564 of file ImplImageTree.cxx.

References void().

ImplImageTree& ImplImageTree::operator= ( const ImplImageTree )
privatedelete
void ImplImageTree::parseLinkFile ( std::shared_ptr< SvStream > const &  aStream)
private

Definition at line 585 of file ImplImageTree.cxx.

References SAL_WARN.

void ImplImageTree::setStyle ( OUString const &  rStyle)
private

Definition at line 438 of file ImplImageTree.cxx.

void ImplImageTree::shutdown ( )

a crude form of life cycle control (called from DeInitVCL; otherwise, if the ImplImageTree singleton were destroyed during exit that would be too late for the destructors of the bitmaps in maIconCache)

Definition at line 432 of file ImplImageTree.cxx.

Member Data Documentation

OUString ImplImageTree::maCurrentStyle
private

Style used for the current operations; switches switch several times during fallback search.

Definition at line 118 of file implimagetree.hxx.

Referenced by getCurrentIconSet().

std::unordered_map<OUString, IconSet> ImplImageTree::maIconSets
private

Remember all the (used) icon styles and individual icons in them.

Map between the theme name(s) and the content.

Definition at line 115 of file implimagetree.hxx.


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