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)
 
css::uno::Reference< css::io::XInputStream > getImageXInputStream (OUString const &rName, OUString const &rStyle, OUString const &rLang)
 
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, IconCacheScaledIconCache
 
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 (std::u16string_view 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 69 of file implimagetree.hxx.

Member Typedef Documentation

◆ IconCache

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

Definition at line 101 of file implimagetree.hxx.

◆ IconLinkHash

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

Definition at line 103 of file implimagetree.hxx.

◆ ScaledIconCache

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

Definition at line 102 of file implimagetree.hxx.

Constructor & Destructor Documentation

◆ ImplImageTree() [1/2]

ImplImageTree::ImplImageTree ( )

Definition at line 210 of file ImplImageTree.cxx.

◆ ~ImplImageTree()

ImplImageTree::~ImplImageTree ( )

Definition at line 214 of file ImplImageTree.cxx.

◆ ImplImageTree() [2/2]

ImplImageTree::ImplImageTree ( const ImplImageTree )
privatedelete

Member Function Documentation

◆ checkPathAccess()

bool ImplImageTree::checkPathAccess ( )
private

◆ createStyle()

void ImplImageTree::createStyle ( )
private

◆ doLoadImage()

bool ImplImageTree::doLoadImage ( ImageRequestParameters rParameters)
private

◆ fallbackStyle()

OUString ImplImageTree::fallbackStyle ( std::u16string_view  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 327 of file ImplImageTree.cxx.

References u.

Referenced by getImageUrl(), getImageXInputStream(), and loadImage().

◆ findImage()

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

◆ getCurrentIconSet()

IconSet & ImplImageTree::getCurrentIconSet ( )
inlineprivate

◆ getIconCache()

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

Find an icon cache for the right scale factor.

Definition at line 531 of file ImplImageTree.cxx.

References getCurrentIconSet(), ImageRequestParameters::mnScalePercentage, and rSet.

Referenced by doLoadImage(), and iconCacheLookup().

◆ getImageStream()

std::shared_ptr< SvMemoryStream > ImplImageTree::getImageStream ( OUString const &  rName,
OUString const &  rStyle,
OUString const &  rLang 
)

Definition at line 319 of file ImplImageTree.cxx.

References getImageXInputStream(), and xStream.

◆ getImageUrl()

OUString ImplImageTree::getImageUrl ( OUString const &  name,
OUString const &  style,
OUString const &  lang 
)

◆ getImageXInputStream()

uno::Reference< io::XInputStream > ImplImageTree::getImageXInputStream ( OUString const &  rName,
OUString const &  rStyle,
OUString const &  rLang 
)

◆ getNameAccess()

uno::Reference< container::XNameAccess > const & ImplImageTree::getNameAccess ( )

◆ getPaths()

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

◆ getRealImageName()

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

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

Definition at line 633 of file ImplImageTree.cxx.

References maCurrentStyle, and maIconSets.

Referenced by getPaths(), and iconCacheLookup().

◆ iconCacheLookup()

bool ImplImageTree::iconCacheLookup ( ImageRequestParameters rParameters)
private

◆ loadImage()

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

Definition at line 343 of file ImplImageTree.cxx.

References doLoadImage(), and fallbackStyle().

◆ loadImageLinks()

void ImplImageTree::loadImageLinks ( )
private

◆ operator=()

ImplImageTree & ImplImageTree::operator= ( const ImplImageTree )
privatedelete

◆ parseLinkFile()

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

◆ setStyle()

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

Definition at line 457 of file ImplImageTree.cxx.

References createStyle(), and maCurrentStyle.

Referenced by doLoadImage(), getImageUrl(), and getImageXInputStream().

◆ shutdown()

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 451 of file ImplImageTree.cxx.

References maCurrentStyle, and maIconSets.

Member Data Documentation

◆ maCurrentStyle

OUString ImplImageTree::maCurrentStyle
private

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

Definition at line 129 of file implimagetree.hxx.

Referenced by createStyle(), getCurrentIconSet(), getRealImageName(), setStyle(), and shutdown().

◆ maIconSets

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 126 of file implimagetree.hxx.

Referenced by createStyle(), getCurrentIconSet(), getRealImageName(), and shutdown().


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