LibreOffice Module xmlhelp (master) 1
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
chelp::Databases Class Reference

#include <databases.hxx>

Public Member Functions

 Databases (bool showBasic, const OUString &instPath, const OUString &productName, const OUString &productVersion, const OUString &styleSheet, css::uno::Reference< css::uno::XComponentContext > const &xContext)
 Input is the installdirectory in system dependent notation. More...
 
 ~Databases ()
 
OString getImageTheme () const
 
OUString getInstallPathAsURL ()
 
OUString getInstallPathAsURL (std::unique_lock< std::mutex > &rGuard)
 
const std::vector< OUString > & getModuleList (const OUString &Language)
 
StaticModuleInformationgetStaticInformationForModule (std::u16string_view Module, const OUString &Language)
 
bool checkModuleMatchForExtension (std::u16string_view Database, const OUString &doclist)
 
KeywordInfogetKeyword (const OUString &Module, const OUString &Language)
 
helpdatafileproxy::HdfgetHelpDataFile (std::u16string_view Module, const OUString &Language, bool helpText=false, const OUString *pExtensionPath=nullptr)
 
helpdatafileproxy::HdfgetHelpDataFile (std::unique_lock< std::mutex > &rGuard, std::u16string_view Module, const OUString &Language, bool helpText=false, const OUString *pExtensionPath=nullptr)
 
css::uno::Reference< css::i18n::XCollator > getCollator (std::unique_lock< std::mutex > &rGuard, const OUString &Language)
 The following method returns the Collator for the given language-country combination. More...
 
void cascadingStylesheet (const OUString &Language, OStringBuffer &buffer)
 Returns the cascading style sheet used to format the HTML-output. More...
 
void changeCSS (const OUString &newStyleSheet)
 Changes the stylesheet for further reads. More...
 
void setActiveText (const OUString &Module, const OUString &Language, std::u16string_view Id, OStringBuffer &buffer)
 Returns the active help text for the given module, language and id. More...
 
css::uno::Reference< css::container::XHierarchicalNameAccess > jarFile (std::unique_lock< std::mutex > &rGuard, std::u16string_view jar, const OUString &Language)
 Has the purpose of forcing the jarfile to stay open. More...
 
css::uno::Reference< css::container::XHierarchicalNameAccess > findJarFileForPath (const OUString &jar, const OUString &Language, const OUString &path, OUString *o_pExtensionPath=nullptr, OUString *o_pExtensionRegistryPath=nullptr)
 
OUString processLang (const OUString &Language)
 Maps a given language-locale combination to language or locale. More...
 
OUString processLang (std::unique_lock< std::mutex > &rGuard, const OUString &Language)
 
void replaceName (OUString &oustring) const
 
const OUString & getProductName () const
 
const OUString & getProductVersion () const
 
OUString expandURL (const OUString &aURL)
 
OUString expandURL (std::unique_lock< std::mutex > &rGuard, const OUString &aURL)
 

Static Public Member Functions

static OUString expandURL (const OUString &aURL, const css::uno::Reference< css::uno::XComponentContext > &xContext)
 

Private Types

enum  {
  PRODUCTNAME = 0 ,
  PRODUCTVERSION ,
  VENDORNAME ,
  VENDORVERSION ,
  VENDORSHORT ,
  NEWPRODUCTNAME ,
  NEWPRODUCTVERSION
}
 
typedef std::unordered_map< OUString, std::unique_ptr< helpdatafileproxy::Hdf > > DatabasesTable
 
typedef std::unordered_map< OUString, OUString > LangSetTable
 
typedef std::unordered_map< OUString, std::unique_ptr< StaticModuleInformation > > ModInfoTable
 
typedef std::unordered_map< OUString, std::unique_ptr< KeywordInfo > > KeywordInfoTable
 
typedef std::unordered_map< OUString, css::uno::Reference< css::container::XHierarchicalNameAccess > > ZipFileTable
 
typedef std::unordered_map< OUString, css::uno::Reference< css::i18n::XCollator > > CollatorTable
 
typedef std::unordered_set< OString > EmptyActiveTextSet
 

Private Member Functions

void setInstallPath (const OUString &aInstallDirectory)
 

Private Attributes

std::mutex m_aMutex
 
css::uno::Reference< css::uno::XComponentContext > m_xContext
 
css::uno::Reference< css::lang::XMultiComponentFactory > m_xSMgr
 
css::uno::Reference< css::ucb::XSimpleFileAccess3 > m_xSFA
 
bool m_bShowBasic
 
std::vector< char > m_vCustomCSSDoc
 
OUString m_aCSS
 
int m_vAdd [7]
 
OUString m_vReplacement [7]
 
OUString m_aInstallDirectory
 
std::vector< OUString > m_avModules
 
DatabasesTable m_aDatabases
 
LangSetTable m_aLangSet
 
ModInfoTable m_aModInfo
 
KeywordInfoTable m_aKeywordInfo
 
ZipFileTable m_aZipFileTable
 
CollatorTable m_aCollatorTable
 
EmptyActiveTextSet m_aEmptyActiveTextSet
 

Detailed Description

Definition at line 129 of file databases.hxx.

Member Typedef Documentation

◆ CollatorTable

typedef std::unordered_map< OUString, css::uno::Reference< css::i18n::XCollator > > chelp::Databases::CollatorTable
private

Definition at line 278 of file databases.hxx.

◆ DatabasesTable

typedef std::unordered_map< OUString, std::unique_ptr<helpdatafileproxy::Hdf> > chelp::Databases::DatabasesTable
private

Definition at line 257 of file databases.hxx.

◆ EmptyActiveTextSet

typedef std::unordered_set< OString > chelp::Databases::EmptyActiveTextSet
private

Definition at line 284 of file databases.hxx.

◆ KeywordInfoTable

typedef std::unordered_map< OUString, std::unique_ptr<KeywordInfo> > chelp::Databases::KeywordInfoTable
private

Definition at line 266 of file databases.hxx.

◆ LangSetTable

typedef std::unordered_map< OUString,OUString > chelp::Databases::LangSetTable
private

Definition at line 260 of file databases.hxx.

◆ ModInfoTable

typedef std::unordered_map< OUString, std::unique_ptr<StaticModuleInformation> > chelp::Databases::ModInfoTable
private

Definition at line 263 of file databases.hxx.

◆ ZipFileTable

typedef std::unordered_map< OUString, css::uno::Reference< css::container::XHierarchicalNameAccess > > chelp::Databases::ZipFileTable
private

Definition at line 272 of file databases.hxx.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
private
Enumerator
PRODUCTNAME 
PRODUCTVERSION 
VENDORNAME 
VENDORVERSION 
VENDORSHORT 
NEWPRODUCTNAME 
NEWPRODUCTVERSION 

Definition at line 240 of file databases.hxx.

Constructor & Destructor Documentation

◆ Databases()

Databases::Databases ( bool  showBasic,
const OUString &  instPath,
const OUString &  productName,
const OUString &  productVersion,
const OUString &  styleSheet,
css::uno::Reference< css::uno::XComponentContext > const &  xContext 
)

Input is the installdirectory in system dependent notation.

Definition at line 134 of file databases.cxx.

References m_vAdd, m_vReplacement, m_xContext, m_xContext, m_xSFA, m_xSMgr, and setInstallPath().

◆ ~Databases()

Databases::~Databases ( )

Definition at line 165 of file databases.cxx.

References m_aDatabases, m_aKeywordInfo, and m_aModInfo.

Member Function Documentation

◆ cascadingStylesheet()

void Databases::cascadingStylesheet ( const OUString &  Language,
OStringBuffer &  buffer 
)

Returns the cascading style sheet used to format the HTML-output.

First try is language directory, second try is main installation directory.

Definition at line 949 of file databases.cxx.

References a, getInstallPathAsURL(), LONG, m_aCSS, m_vCustomCSSDoc, and processLang().

◆ changeCSS()

void Databases::changeCSS ( const OUString &  newStyleSheet)

Changes the stylesheet for further reads.

Definition at line 943 of file databases.cxx.

References m_aCSS, and m_vCustomCSSDoc.

◆ checkModuleMatchForExtension()

bool Databases::checkModuleMatchForExtension ( std::u16string_view  Database,
const OUString &  doclist 
)

Definition at line 674 of file databases.cxx.

References Database, m_avModules, and result.

Referenced by getKeyword().

◆ expandURL() [1/3]

OUString Databases::expandURL ( const OUString &  aURL)

Definition at line 82 of file databases.cxx.

References aURL, expandURL(), and m_aMutex.

Referenced by expandURL(), getHelpDataFile(), and jarFile().

◆ expandURL() [2/3]

static OUString chelp::Databases::expandURL ( const OUString &  aURL,
const css::uno::Reference< css::uno::XComponentContext > &  xContext 
)
static

◆ expandURL() [3/3]

OUString Databases::expandURL ( std::unique_lock< std::mutex > &  rGuard,
const OUString &  aURL 
)

Definition at line 88 of file databases.cxx.

References aURL, expandURL(), and m_xContext.

◆ findJarFileForPath()

Reference< XHierarchicalNameAccess > Databases::findJarFileForPath ( const OUString &  jar,
const OUString &  Language,
const OUString &  path,
OUString *  o_pExtensionPath = nullptr,
OUString *  o_pExtensionRegistryPath = nullptr 
)

◆ getCollator()

Reference< XCollator > Databases::getCollator ( std::unique_lock< std::mutex > &  rGuard,
const OUString &  Language 
)

The following method returns the Collator for the given language-country combination.

Definition at line 497 of file databases.cxx.

References LanguageTag::getCountry(), LanguageTag::getLanguage(), LanguageTag::getLocale(), m_aCollatorTable, m_xContext, and LanguageTag::reset().

Referenced by getKeyword().

◆ getHelpDataFile() [1/2]

helpdatafileproxy::Hdf * Databases::getHelpDataFile ( std::u16string_view  Module,
const OUString &  Language,
bool  helpText = false,
const OUString *  pExtensionPath = nullptr 
)

◆ getHelpDataFile() [2/2]

helpdatafileproxy::Hdf * Databases::getHelpDataFile ( std::unique_lock< std::mutex > &  rGuard,
std::u16string_view  Module,
const OUString &  Language,
bool  helpText = false,
const OUString *  pExtensionPath = nullptr 
)

◆ getImageTheme()

OString Databases::getImageTheme ( ) const

Definition at line 179 of file databases.cxx.

References comphelper::InitAnyPropertySequence(), and m_xContext.

◆ getInstallPathAsURL() [1/2]

OUString Databases::getInstallPathAsURL ( )

◆ getInstallPathAsURL() [2/2]

OUString Databases::getInstallPathAsURL ( std::unique_lock< std::mutex > &  rGuard)

Definition at line 280 of file databases.cxx.

References m_aInstallDirectory.

◆ getKeyword()

KeywordInfo * Databases::getKeyword ( const OUString &  Module,
const OUString &  Language 
)

◆ getModuleList()

const std::vector< OUString > & Databases::getModuleList ( const OUString &  Language)

◆ getProductName()

const OUString & chelp::Databases::getProductName ( ) const
inline

Definition at line 219 of file databases.hxx.

References m_vReplacement.

◆ getProductVersion()

const OUString & chelp::Databases::getProductVersion ( ) const
inline

Definition at line 220 of file databases.hxx.

References m_vReplacement.

◆ getStaticInformationForModule()

StaticModuleInformation * Databases::getStaticInformationForModule ( std::u16string_view  Module,
const OUString &  Language 
)

◆ jarFile()

Reference< XHierarchicalNameAccess > Databases::jarFile ( std::unique_lock< std::mutex > &  rGuard,
std::u16string_view  jar,
const OUString &  Language 
)

Has the purpose of forcing the jarfile to stay open.

Definition at line 801 of file databases.cxx.

References aArguments, Exception, expandURL(), m_aInstallDirectory, m_aZipFileTable, m_xContext, m_xSMgr, p, processLang(), and ZIP_STORAGE_FORMAT_STRING.

Referenced by chelp::JarFileIterator::nextJarFile().

◆ processLang() [1/2]

OUString Databases::processLang ( const OUString &  Language)

◆ processLang() [2/2]

OUString Databases::processLang ( std::unique_lock< std::mutex > &  rGuard,
const OUString &  Language 
)

Definition at line 406 of file databases.cxx.

References m_aInstallDirectory, and m_aLangSet.

◆ replaceName()

void Databases::replaceName ( OUString &  oustring) const

◆ setActiveText()

void Databases::setActiveText ( const OUString &  Module,
const OUString &  Language,
std::u16string_view  Id,
OStringBuffer &  buffer 
)

◆ setInstallPath()

void Databases::setInstallPath ( const OUString &  aInstallDirectory)
private

Definition at line 1112 of file databases.cxx.

References m_aInstallDirectory, and m_aMutex.

Referenced by Databases().

Member Data Documentation

◆ m_aCollatorTable

CollatorTable chelp::Databases::m_aCollatorTable
private

Definition at line 279 of file databases.hxx.

Referenced by getCollator().

◆ m_aCSS

OUString chelp::Databases::m_aCSS
private

Definition at line 238 of file databases.hxx.

Referenced by cascadingStylesheet(), and changeCSS().

◆ m_aDatabases

DatabasesTable chelp::Databases::m_aDatabases
private

Definition at line 258 of file databases.hxx.

Referenced by getHelpDataFile(), and ~Databases().

◆ m_aEmptyActiveTextSet

EmptyActiveTextSet chelp::Databases::m_aEmptyActiveTextSet
private

Definition at line 285 of file databases.hxx.

Referenced by setActiveText().

◆ m_aInstallDirectory

OUString chelp::Databases::m_aInstallDirectory
private

◆ m_aKeywordInfo

KeywordInfoTable chelp::Databases::m_aKeywordInfo
private

Definition at line 267 of file databases.hxx.

Referenced by getKeyword(), and ~Databases().

◆ m_aLangSet

LangSetTable chelp::Databases::m_aLangSet
private

Definition at line 261 of file databases.hxx.

Referenced by processLang().

◆ m_aModInfo

ModInfoTable chelp::Databases::m_aModInfo
private

Definition at line 264 of file databases.hxx.

Referenced by getStaticInformationForModule(), and ~Databases().

◆ m_aMutex

std::mutex chelp::Databases::m_aMutex
private

◆ m_avModules

std::vector< OUString > chelp::Databases::m_avModules
private

Definition at line 255 of file databases.hxx.

Referenced by checkModuleMatchForExtension(), and getModuleList().

◆ m_aZipFileTable

ZipFileTable chelp::Databases::m_aZipFileTable
private

Definition at line 273 of file databases.hxx.

Referenced by jarFile().

◆ m_bShowBasic

bool chelp::Databases::m_bShowBasic
private

Definition at line 235 of file databases.hxx.

Referenced by getModuleList().

◆ m_vAdd

int chelp::Databases::m_vAdd[7]
private

Definition at line 250 of file databases.hxx.

Referenced by Databases(), and replaceName().

◆ m_vCustomCSSDoc

std::vector<char> chelp::Databases::m_vCustomCSSDoc
private

Definition at line 237 of file databases.hxx.

Referenced by cascadingStylesheet(), and changeCSS().

◆ m_vReplacement

OUString chelp::Databases::m_vReplacement[7]
private

Definition at line 251 of file databases.hxx.

Referenced by Databases(), getProductName(), getProductVersion(), and replaceName().

◆ m_xContext

css::uno::Reference< css::uno::XComponentContext > chelp::Databases::m_xContext
private

◆ m_xSFA

css::uno::Reference< css::ucb::XSimpleFileAccess3 > chelp::Databases::m_xSFA
private

Definition at line 233 of file databases.hxx.

Referenced by Databases(), getHelpDataFile(), and getKeyword().

◆ m_xSMgr

css::uno::Reference< css::lang::XMultiComponentFactory > chelp::Databases::m_xSMgr
private

Definition at line 232 of file databases.hxx.

Referenced by Databases(), and jarFile().


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