26#include <com/sun/star/beans/NamedValue.hpp>
27#include <com/sun/star/util/URL.hpp>
28#include <com/sun/star/uno/XInterface.hpp>
29#include <com/sun/star/container/XNameAccess.hpp>
30#include <com/sun/star/container/XNameReplace.hpp>
31#include <com/sun/star/uno/Reference.h>
32#include <com/sun/star/uno/Any.h>
36#include <rtl/ustring.hxx>
41class CacheUpdateListener;
294 std::unique_ptr<FilterCache>
clone()
const;
439 const OUString& sItem);
467 const OUString& sItem);
475 const OUString& sItem);
483 const OUString& sItem ,
492 const OUString& sItem);
531 const OUString& sItem);
647 static css::uno::Reference< css::uno::XInterface >
impl_createConfigAccess(std::unique_lock<std::mutex>& rGuard,
648 const OUString& sRoot ,
672 static css::uno::Any
impl_getDirectCFGValue(std::unique_lock<std::mutex>& rGuard, std::u16string_view sDirectKey);
737 const css::uno::Reference< css::container::XNameAccess >& xConfig,
766 const css::uno::Reference< css::container::XNameAccess >& xSet ,
768 const OUString& sItem ,
799 const OUString& sItem);
806 static void impl_saveItem(
const css::uno::Reference< css::container::XNameReplace >& xSet ,
816 const OUString& sItem);
823 static void impl_flushByList(
const css::uno::Reference< css::container::XNameAccess >& xSet ,
826 const std::vector<OUString>& lItems);
858 const OUString& sItem);
866 const css::uno::Reference< css::container::XNameAccess >& xNode,
885 const css::uno::Reference< css::container::XNameAccess >& xSet ,
887 const OUString& sItem);
907#if OSL_DEBUG_LEVEL > 0
represent an item of a FilterCache instance.
implements a cache, which contains all elements of our filter and type detection configuration.
std::unique_ptr< FilterCache > clone() const
creates a copy of this container.
static void impl_interpretDataVal4Filter(const OUString &sValue, sal_Int32 nProp, CacheItem &rItem)
TODO.
std::vector< OUString > m_lChangedContentHandlers
bool hasItems(EItemType eType) const
indicates if the requested sub container contains some items.
void impl_load(std::unique_lock< std::mutex > &rGuard, EFillState eRequiredState)
load the underlying configuration into this cache.
css::uno::Reference< css::uno::XInterface > m_xConfigTypes
holds the used configuration provider alive, which provides access to the list of types.
void impl_readPatchUINames(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< css::container::XNameAccess > &xNode, CacheItem &rItem)
TODO.
css::uno::Reference< css::container::XNameAccess > m_xModuleCfg
readonly access to the module configuration of OOo
OUString impl_searchFrameLoaderForType(const OUString &sType) const
TODO.
std::vector< OUString > getMatchingItemsByProps(EItemType eType, o3tl::span< const css::beans::NamedValue > lIProps, o3tl::span< const css::beans::NamedValue > lEProps={}) const
return a list of key names for items, which match the specified criteria.
static css::uno::Reference< css::uno::XInterface > impl_createConfigAccess(std::unique_lock< std::mutex > &rGuard, const OUString &sRoot, bool bReadOnly, bool bLocalesMode)
tries to open the requested configuration root using the specified modi.
static EItemFlushState impl_specifyFlushOperation(const css::uno::Reference< css::container::XNameAccess > &xSet, const CacheItemList &rList, const OUString &sItem)
specify, which save operation is necessary for the specified item.
css::uno::Reference< css::uno::XInterface > m_xConfigFilters
holds the used configuration provider alive, which provides access to the list of filters.
FilterCache()
standard ctor
static css::uno::Any impl_getDirectCFGValue(std::unique_lock< std::mutex > &rGuard, std::u16string_view sDirectKey)
reads the specified configuration key and return its value.
EFillState
indicates, which items already exists inside this cache and which not.
@ E_CONTAINS_CONTENTHANDLERS
@ E_CONTAINS_FRAMELOADERS
CacheItemRegistration m_lURLPattern2Types
optimize mapping of URL pattern to a type representation, by using patterns as key and a list of inte...
std::vector< OUString > m_lChangedFilters
static std::vector< OUString > impl_tokenizeString(std::u16string_view sData, sal_Unicode cSeparator)
TODO.
CacheItem & impl_getItem(std::unique_lock< std::mutex > &rGuard, EItemType eType, const OUString &sItem)
static css::uno::Sequence< OUString > impl_convertFlagField2FlagNames(SfxFilterFlags nFlags)
convert a flag field value to its list representation of flag names.
const CacheItemList & impl_getItemList(std::unique_lock< std::mutex > &rGuard, EItemType eType) const
return a reference to one of our internal sub container, which contains items of the requested type.
CacheItemRegistration m_lExtensions2Types
optimize mapping of URL extensions to a type representation, by using extensions as key and a list of...
OUString m_sActLocale
contains the current locale of the office and will be used to work with localized configuration value...
void flush()
force writing of all changes (which was made after last flush was called) back to the configuration.
std::vector< OUString > m_lChangedTypes
TODO document me ...
~FilterCache()
standard dtor.
static void impl_savePatchUINames(const css::uno::Reference< css::container::XNameReplace > &xNode, const CacheItem &rItem)
TODO.
css::uno::Reference< css::uno::XInterface > m_xConfigOthers
holds the used configuration provider alive, which provides access to the list of other values needed...
static void impl_flushByList(const css::uno::Reference< css::container::XNameAccess > &xSet, EItemType eType, const CacheItemList &rCache, const std::vector< OUString > &lItems)
TODO.
void impl_loadSet(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< css::container::XNameAccess > &xConfig, EItemType eType, EReadOption eOption, CacheItemList *pCache)
read the specified config set into the cache.
static void removeStatePropsFromItem(CacheItem &aValue)
TODO document me.
std::vector< OUString > getItemNames(EItemType eType) const
return a list of all key names, which represent an item inside the specified sub container.
static SfxFilterFlags impl_convertFlagNames2FlagField(const css::uno::Sequence< OUString > &lNames)
convert a list of flag names to its int representation.
bool isFillState(EFillState eRequired) const
return the current fill state of this cache.
bool hasItem(EItemType eType, const OUString &sItem)
check if the required item exist inside this container.
void load(EFillState eRequired)
force special fill state of this cache.
CacheItemList::iterator impl_loadItemOnDemand(std::unique_lock< std::mutex > &rGuard, EItemType eType, const OUString &sItem)
try to load the requested item on demand from the underlying configuration layer.
EConfigProvider
TODO document me.
void refreshItem(EItemType eType, const OUString &sItem)
TODO document me ...
css::uno::Reference< css::uno::XInterface > impl_openConfig(std::unique_lock< std::mutex > &rGuard, EConfigProvider eProvide)
return a valid configuration update access to the underlying configuration package,...
css::uno::Sequence< OUString > m_aStandardProps[4]
standard property names for filter config keyed by EReadOption
CacheItemList m_lFrameLoaders
contains all loaded frame loader with its properties.
EItemType
identify the type of a container item.
css::uno::Any getItemWithStateProps(EItemType eType, const OUString &sItem)
add some implicit properties to the given cache item reference.
void detectFlatForURL(const css::util::URL &aURL, FlatDetection &rFlatTypes) const
supports a flat type detection for given URL.
rtl::Reference< CacheUpdateListener > m_xFiltersChgListener
EFillState m_eFillState
contains status, which cache items/properties was already loaded from the underlying configuration.
EItemFlushState
indicates the state of a configuration set item.
@ E_ITEM_UNCHANGED
indicates an unchanged item (can occur e.g. if an item was added and(!) removed before it was flushed...
@ E_ITEM_REMOVED
indicates an item, which exists inside config layer but not inside our own cache
@ E_ITEM_ADDED
indicates an item, which does not exists inside config layer but inside our own cache
@ E_ITEM_CHANGED
indicates an item, which exists inside config layer and inside our own cache
EReadOption
regulate, which properties of a configured item will be read.
static void impl_interpretDataVal4Type(const OUString &sValue, sal_Int32 nProp, CacheItem &rItem)
TODO.
rtl::Reference< CacheUpdateListener > m_xTypesChglisteners
void removeItem(EItemType eType, const OUString &sItem)
TODO document me ...
void takeOver(const FilterCache &rClone)
copy the cache content or rClone back to this instance.
void impl_validateAndOptimize(std::unique_lock< std::mutex > &rGuard)
validate the whole cache and create structures for optimized items access.
bool impl_isModuleInstalled(std::unique_lock< std::mutex > &rGuard, const OUString &sModule)
check if the specified OOo module is installed.
CacheItemList m_lFilters
contains all loaded filters with its properties.
CacheItem impl_loadItem(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< css::container::XNameAccess > &xSet, EItemType eType, const OUString &sItem, EReadOption eOption)
read the specified container item from the given configuration set.
void impl_addItem2FlushList(EItemType eType, const OUString &sItem)
TODO.
void setItem(EItemType eType, const OUString &sItem, const CacheItem &aValue)
TODO document me ...
CacheItem impl_readOldItem(std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< css::container::XNameAccess > &xSet, EItemType eType, const OUString &sItem)
TODO.
void impl_readOldFormat(std::unique_lock< std::mutex > &rGuard)
TODO.
CacheItem getItem(EItemType eType, const OUString &sItem)
return an item, which match the specified type and name.
CacheItemList m_lTypes
contains all loaded types with its properties.
static void impl_saveItem(const css::uno::Reference< css::container::XNameReplace > &xSet, EItemType eType, const CacheItem &aValue)
TODO.
std::vector< OUString > m_lChangedFrameLoaders
css::uno::Sequence< OUString > m_aTypeProps[4]
type property names for filter config keyed by EReadOption
CacheItemList m_lContentHandlers
contains all loaded content handler with its properties.
OUString impl_searchContentHandlerForType(const OUString &sType) const
::std::vector< FlatDetectionInfo > FlatDetection
std::unordered_map< OUString, std::vector< OUString > > CacheItemRegistration
supports registration of multiple key to another string information.
std::unordered_map< OUString, CacheItem > CacheItemList
represent an item list of a FilterCache instance.
FilterCache & GetTheFilterCache()