LibreOffice Module filter (master) 1
|
implements a cache, which contains all elements of our filter and type detection configuration. More...
#include <filtercache.hxx>
Public Types | |
enum | EItemType { E_TYPE , E_FILTER , E_FRAMELOADER , E_CONTENTHANDLER } |
identify the type of a container item. More... | |
enum | EFillState { E_CONTAINS_NOTHING = 0 , E_CONTAINS_STANDARD = 1 , E_CONTAINS_TYPES = 2 , E_CONTAINS_FILTERS = 4 , E_CONTAINS_FRAMELOADERS = 8 , E_CONTAINS_CONTENTHANDLERS = 16 } |
indicates, which items already exists inside this cache and which not. More... | |
Public Member Functions | |
FilterCache () | |
standard ctor More... | |
~FilterCache () | |
standard dtor. More... | |
std::unique_ptr< FilterCache > | clone () const |
creates a copy of this container. More... | |
void | takeOver (const FilterCache &rClone) |
copy the cache content or rClone back to this instance. More... | |
void | load (EFillState eRequired) |
force special fill state of this cache. More... | |
bool | isFillState (EFillState eRequired) const |
return the current fill state of this cache. More... | |
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. More... | |
bool | hasItems (EItemType eType) const |
indicates if the requested sub container contains some items. More... | |
std::vector< OUString > | getItemNames (EItemType eType) const |
return a list of all key names, which represent an item inside the specified sub container. More... | |
bool | hasItem (EItemType eType, const OUString &sItem) |
check if the required item exist inside this container. More... | |
CacheItem | getItem (EItemType eType, const OUString &sItem) |
return an item, which match the specified type and name. More... | |
void | removeItem (EItemType eType, const OUString &sItem) |
TODO document me ... More... | |
void | setItem (EItemType eType, const OUString &sItem, const CacheItem &aValue) |
TODO document me ... More... | |
void | refreshItem (EItemType eType, const OUString &sItem) |
TODO document me ... More... | |
css::uno::Any | getItemWithStateProps (EItemType eType, const OUString &sItem) |
add some implicit properties to the given cache item reference. More... | |
void | flush () |
force writing of all changes (which was made after last flush was called) back to the configuration. More... | |
void | detectFlatForURL (const css::util::URL &aURL, FlatDetection &rFlatTypes) const |
supports a flat type detection for given URL. More... | |
Static Public Member Functions | |
static void | removeStatePropsFromItem (CacheItem &aValue) |
TODO document me. More... | |
Private Types | |
enum | EReadOption { E_READ_STANDARD = 1 , E_READ_UPDATE = 2 , E_READ_ALL = 3 } |
regulate, which properties of a configured item will be read. More... | |
enum | EItemFlushState { E_ITEM_UNCHANGED = 0 , E_ITEM_REMOVED = 1 , E_ITEM_CHANGED = 2 , E_ITEM_ADDED = 3 } |
indicates the state of a configuration set item. More... | |
enum | EConfigProvider { E_PROVIDER_TYPES = 0 , E_PROVIDER_FILTERS = 1 , E_PROVIDER_OTHERS = 2 , E_PROVIDER_OLD = 3 } |
TODO document me. More... | |
Private Member Functions | |
std::vector< OUString > | getItemNames (std::unique_lock< std::mutex > &rGuard, EItemType eType) const |
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. More... | |
CacheItemList & | impl_getItemList (std::unique_lock< std::mutex > &rGuard, EItemType eType) |
CacheItem & | impl_getItem (std::unique_lock< std::mutex > &rGuard, EItemType eType, const OUString &sItem) |
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, which is fix for this cache. More... | |
void | impl_load (std::unique_lock< std::mutex > &rGuard, EFillState eRequiredState) |
load the underlying configuration into this cache. More... | |
void | impl_validateAndOptimize (std::unique_lock< std::mutex > &rGuard) |
validate the whole cache and create structures for optimized items access. More... | |
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. More... | |
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. More... | |
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. More... | |
void | impl_addItem2FlushList (EItemType eType, const OUString &sItem) |
TODO. More... | |
void | impl_readPatchUINames (std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< css::container::XNameAccess > &xNode, CacheItem &rItem) |
TODO. More... | |
void | impl_readOldFormat (std::unique_lock< std::mutex > &rGuard) |
TODO. More... | |
CacheItem | impl_readOldItem (std::unique_lock< std::mutex > &rGuard, const css::uno::Reference< css::container::XNameAccess > &xSet, EItemType eType, const OUString &sItem) |
TODO. More... | |
OUString | impl_searchFrameLoaderForType (const OUString &sType) const |
TODO. More... | |
OUString | impl_searchContentHandlerForType (const OUString &sType) const |
bool | impl_isModuleInstalled (std::unique_lock< std::mutex > &rGuard, const OUString &sModule) |
check if the specified OOo module is installed. More... | |
Static Private Member Functions | |
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. More... | |
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. More... | |
static void | impl_saveItem (const css::uno::Reference< css::container::XNameReplace > &xSet, EItemType eType, const CacheItem &aValue) |
TODO. More... | |
static void | impl_flushByList (const css::uno::Reference< css::container::XNameAccess > &xSet, EItemType eType, const CacheItemList &rCache, const std::vector< OUString > &lItems) |
TODO. More... | |
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. More... | |
static void | impl_savePatchUINames (const css::uno::Reference< css::container::XNameReplace > &xNode, const CacheItem &rItem) |
TODO. More... | |
static void | impl_interpretDataVal4Type (const OUString &sValue, sal_Int32 nProp, CacheItem &rItem) |
TODO. More... | |
static void | impl_interpretDataVal4Filter (const OUString &sValue, sal_Int32 nProp, CacheItem &rItem) |
TODO. More... | |
static std::vector< OUString > | impl_tokenizeString (std::u16string_view sData, sal_Unicode cSeparator) |
TODO. More... | |
static SfxFilterFlags | impl_convertFlagNames2FlagField (const css::uno::Sequence< OUString > &lNames) |
convert a list of flag names to its int representation. More... | |
static css::uno::Sequence< OUString > | impl_convertFlagField2FlagNames (SfxFilterFlags nFlags) |
convert a flag field value to its list representation of flag names. More... | |
Private Attributes | |
std::mutex | m_aMutex |
css::uno::Reference< css::uno::XInterface > | m_xConfigTypes |
holds the used configuration provider alive, which provides access to the list of types. More... | |
css::uno::Reference< css::uno::XInterface > | m_xConfigFilters |
holds the used configuration provider alive, which provides access to the list of filters. More... | |
css::uno::Reference< css::uno::XInterface > | m_xConfigOthers |
holds the used configuration provider alive, which provides access to the list of other values needed by our type detection framework. More... | |
CacheItemList | m_lTypes |
contains all loaded types with its properties. More... | |
CacheItemList | m_lFilters |
contains all loaded filters with its properties. More... | |
CacheItemList | m_lFrameLoaders |
contains all loaded frame loader with its properties. More... | |
CacheItemList | m_lContentHandlers |
contains all loaded content handler with its properties. More... | |
CacheItemRegistration | m_lExtensions2Types |
optimize mapping of URL extensions to a type representation, by using extensions as key and a list of internal type names as value. More... | |
CacheItemRegistration | m_lURLPattern2Types |
optimize mapping of URL pattern to a type representation, by using patterns as key and a list of internal type names as value. More... | |
OUString | m_sActLocale |
contains the current locale of the office and will be used to work with localized configuration values. More... | |
EFillState | m_eFillState |
contains status, which cache items/properties was already loaded from the underlying configuration. More... | |
std::vector< OUString > | m_lChangedTypes |
TODO document me ... More... | |
std::vector< OUString > | m_lChangedFilters |
std::vector< OUString > | m_lChangedFrameLoaders |
std::vector< OUString > | m_lChangedContentHandlers |
css::uno::Sequence< OUString > | m_aStandardProps [4] |
standard property names for filter config keyed by EReadOption More... | |
css::uno::Sequence< OUString > | m_aTypeProps [4] |
type property names for filter config keyed by EReadOption More... | |
css::uno::Reference< css::container::XNameAccess > | m_xModuleCfg |
readonly access to the module configuration of OOo More... | |
rtl::Reference< CacheUpdateListener > | m_xTypesChglisteners |
rtl::Reference< CacheUpdateListener > | m_xFiltersChgListener |
implements a cache, which contains all elements of our filter and type detection configuration.
@descr The cache itself is threadsafe implemented. Because it should be used as a singleton only. To do so please use reference mechanism as wrapper around this FilterCache class.
Definition at line 60 of file filtercache.hxx.
|
private |
TODO document me.
Enumerator | |
---|---|
E_PROVIDER_TYPES | |
E_PROVIDER_FILTERS | |
E_PROVIDER_OTHERS | |
E_PROVIDER_OLD |
Definition at line 152 of file filtercache.hxx.
indicates, which items already exists inside this cache and which not.
@descr This cache supports a 2-step load mechanism. First only types (and only some special properties of every type!) but no filters/frame loaders/content handlers will be read. That should be enough to work with this cache e.g. for loading the first document. After this first document was loaded successfully, a special "load-on-demand-thread" will be started to fill this cache with ALL other information, which was not read before. That's the second step. All operations on top of this cache will be blocked then.
Enumerator | |
---|---|
E_CONTAINS_NOTHING | |
E_CONTAINS_STANDARD | |
E_CONTAINS_TYPES | |
E_CONTAINS_FILTERS | |
E_CONTAINS_FRAMELOADERS | |
E_CONTAINS_CONTENTHANDLERS |
Definition at line 95 of file filtercache.hxx.
|
private |
indicates the state of a configuration set item.
@descr Inside method flush we check:
Definition at line 138 of file filtercache.hxx.
identify the type of a container item.
@descr Because the cache interface is a generic one every group of container items must be specified.
Enumerator | |
---|---|
E_TYPE | |
E_FILTER | |
E_FRAMELOADER | |
E_CONTENTHANDLER |
Definition at line 73 of file filtercache.hxx.
|
private |
regulate, which properties of a configured item will be read.
@descr To perform reading of all configuration items, only standard properties will be handled. At a second step all optional properties will be read and added to our internal structures. Of course the combination of both options can be used too, to get all properties at the same time.
Enumerator | |
---|---|
E_READ_STANDARD | |
E_READ_UPDATE | |
E_READ_ALL |
Definition at line 121 of file filtercache.hxx.
filter::config::FilterCache::FilterCache | ( | ) |
standard ctor
@descr It's not allowed to do anything here... especially is forbidden to start operations, which needs a FilterCache instance too! Why? Because this FilterCache instance will be used as a singleton! And if during this ctor any action related to this FilterCache singleton is started... a race will be the result.
The first method after construction of a new singleton reference should be "load()". There a special fill state of this cache can be forced.
Definition at line 59 of file filtercache.cxx.
References E_READ_ALL, E_READ_STANDARD, E_READ_UPDATE, gentoken::i, m_aStandardProps, m_aTypeProps, PROPNAME_CLIPBOARDFORMAT, PROPNAME_DETECTSERVICE, PROPNAME_DOCUMENTSERVICE, PROPNAME_ENABLED, PROPNAME_EXPORTEXTENSION, PROPNAME_EXTENSIONS, PROPNAME_FILEFORMATVERSION, PROPNAME_FILTERSERVICE, PROPNAME_FLAGS, PROPNAME_MEDIATYPE, PROPNAME_PREFERRED, PROPNAME_PREFERREDFILTER, PROPNAME_TEMPLATENAME, PROPNAME_TYPE, PROPNAME_UICOMPONENT, PROPNAME_URLPATTERN, PROPNAME_USERDATA, and SAL_N_ELEMENTS.
filter::config::FilterCache::~FilterCache | ( | ) |
standard dtor.
Definition at line 110 of file filtercache.cxx.
References m_xFiltersChgListener, and m_xTypesChglisteners.
std::unique_ptr< FilterCache > filter::config::FilterCache::clone | ( | ) | const |
creates a copy of this container.
@descr Such copy can be used then to modify items (add/change/remove) without the risk to damage the original container. After its changed data was flushed to the configuration it can be removed.
The original container will get these new data automatically because it listen for changes on the internal used configuration layer. If the new data are needed immediately inside the original container, the method takeOver() can be used to copy all changes back. The may be following notifications of the configuration will be superfluous then. But they can't be stopped...
All internal structures will be copied here. But the internal used configuration (update) access won't be copied. The cloned instance contains a different one.
Definition at line 119 of file filtercache.cxx.
References m_aMutex, m_eFillState, m_lChangedContentHandlers, m_lChangedFilters, m_lChangedFrameLoaders, m_lChangedTypes, m_lContentHandlers, m_lExtensions2Types, m_lFilters, m_lFrameLoaders, m_lTypes, m_lURLPattern2Types, and m_sActLocale.
Referenced by filter::config::BaseContainer::impl_initFlushMode().
void filter::config::FilterCache::detectFlatForURL | ( | const css::util::URL & | aURL, |
FlatDetection & | rFlatTypes | ||
) | const |
supports a flat type detection for given URL.
@descr Because such detection works on our optimized internal structures (e.g. mapping from extensions/pattern to type names), it should be made inside this cache.
aURL | URL of the content, which type should be detected. It's already parsed and split into its different parts, like e.g.: main, jump marks etcpp. |
rFlatTypes | used as [out] parameter to add all types, which match to the given URL. Further an information is added for every type. It indicates, how this type is related to the specified URL (means e.g. if it matches by extension or URLPattern...). |
[css::uno::Exception] | if the cache itself is not valid any longer, because any operation before damage it. |
Definition at line 667 of file filtercache.cxx.
References aURL, filter::config::FlatDetectionInfo::bMatchByExtension, filter::config::FlatDetectionInfo::bMatchByPattern, INetURLObject::getExtension(), INetURLObject::LAST_SEGMENT, m_aMutex, m_lExtensions2Types, m_lURLPattern2Types, WildCard::Matches(), filter::config::FlatDetectionInfo::sType, and INetURLObject::WithCharset.
Referenced by filter::config::TypeDetection::impl_getAllFormatTypes().
void filter::config::FilterCache::flush | ( | ) |
force writing of all changes (which was made after last flush was called) back to the configuration.
@descr TODO
[css::uno::Exception] | if the cache itself is not valid any longer, because any operation before damage it. |
Definition at line 575 of file filtercache.cxx.
References CFGSET_FILTERS, CFGSET_TYPES, E_FILTER, E_PROVIDER_FILTERS, E_PROVIDER_TYPES, impl_flushByList(), impl_openConfig(), impl_validateAndOptimize(), m_aMutex, m_lChangedFilters, m_lChangedTypes, m_lFilters, and m_lTypes.
return an item, which match the specified type and name.
@descr Because this cache can be used inside multithreaded environments the caller must be aware of some exceptions - especially a "NoSuchElementExcepotion". May another thread already removed the required item before ...
eType | specify the sub container of this cache, which should be used for searching. see also EItemType. |
sItem | specify the requested item by its key name. |
[css::container::NoSuchElementException] | if the required item does not still exist. |
[css::uno::Exception] | if some input parameter are wrong or the cache itself is not valid any longer, because any operation before damage it. |
Definition at line 351 of file filtercache.cxx.
References eType, impl_getItem(), and m_aMutex.
Referenced by filter::config::TypeDetection::impl_detectTypeFlatAndDeep(), filter::config::TypeDetection::impl_getPreselectionForType(), filter::config::TypeDetection::impl_getTypeFromFilter(), and filter::config::FilterFactory::impl_queryMatchByDocumentService().
std::vector< OUString > filter::config::FilterCache::getItemNames | ( | EItemType | eType | ) | const |
return a list of all key names, which represent an item inside the specified sub container.
eType | specify the sub container of this cache, which should be used for searching. see also EItemType. |
[css::uno::Exception] | if some input parameter are wrong or the cache itself is not valid any longer, because any operation before damage it. |
Definition at line 295 of file filtercache.cxx.
References eType, getItemNames(), and m_aMutex.
Referenced by filter::config::BaseContainer::getElementNames(), getItemNames(), filter::config::FilterFactory::impl_queryMatchByDocumentService(), and impl_validateAndOptimize().
|
private |
Definition at line 303 of file filtercache.cxx.
References eType, and impl_getItemList().
css::uno::Any filter::config::FilterCache::getItemWithStateProps | ( | EItemType | eType, |
const OUString & | sItem | ||
) |
add some implicit properties to the given cache item reference.
@descr Such properties can e.g. finalized or mandatory. They are not persistent and not really part of e.g. a filter not. But they are attributes of a configuration entry and can influence our container interface.
eType | specify the sub container of this cache, which should be used for searching. see also EItemType. |
sItem | specify the requested item by its key name. |
rItem | contains already the normal properties of this item, and will be used as out parameter to add the implicit attributes there. |
[css::uno::Exception] | if an internal error occurred. Note: if the item is missing inside the underlying configuration no exception will be thrown. In such case the item is marked as finalized/mandatory automatically Reason: maybe the item comes from the old configuration package and was not migrated to the new one. So we can't provide write access to such items... |
Definition at line 467 of file filtercache.cxx.
References CFGDIRECTKEY_DEFAULTFRAMELOADER, CFGSET_CONTENTHANDLERS, CFGSET_FILTERS, CFGSET_FRAMELOADERS, CFGSET_TYPES, E_CONTENTHANDLER, E_FILTER, E_FRAMELOADER, E_PROVIDER_FILTERS, E_PROVIDER_OTHERS, E_PROVIDER_TYPES, E_TYPE, eType, filter::config::CacheItem::getAsPackedPropertyValueList(), impl_getDirectCFGValue(), impl_getItem(), impl_openConfig(), and m_aMutex.
Referenced by filter::config::BaseContainer::getByName().
std::vector< OUString > filter::config::FilterCache::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.
@descr The returned key names can be used at another method "getItem()" of this cache to get further information about this item.
eType | specify the sub container of this cache, which should be used for searching. see also EItemType. |
lIProps | specify the property set, which must exist at the searched items as minimum. |
lEProps | specify the property set, which must not(!) exist at the searched items as minimum. |
[css::uno::Exception] | if some input parameter are wrong or the cache itself is not valid any longer, because any operation before damage it. |
Definition at line 247 of file filtercache.cxx.
References eType, impl_getItemList(), and m_aMutex.
Referenced by filter::config::BaseContainer::createSubSetEnumerationByProperties(), filter::config::FilterFactory::getAvailableServiceNames(), and filter::config::FilterFactory::impl_getSortedFilterListForModule().
bool filter::config::FilterCache::hasItem | ( | EItemType | eType, |
const OUString & | sItem | ||
) |
check if the required item exist inside this container.
eType | specify the sub container of this cache, which should be used. see also EItemType. |
sItem | the key name of the requested item inside the specified sub container. |
[css::uno::Exception] | if some input parameter are wrong or the cache itself is not valid any longer, because any operation before damage it. |
Definition at line 319 of file filtercache.cxx.
References eType, impl_getItemList(), impl_loadItemOnDemand(), and m_aMutex.
Referenced by filter::config::BaseContainer::hasByName(), filter::config::BaseContainer::insertByName(), and filter::config::BaseContainer::replaceByName().
bool filter::config::FilterCache::hasItems | ( | EItemType | eType | ) | const |
indicates if the requested sub container contains some items.
@descr We don't provide any information about the count of such items. Because we don't implement any index based interface! The information "we have items or not" must be enough for the outside code ... till somewhere give us a good reason. :-)
eType | specify the sub container of this cache, which should be used. see also EItemType. |
[css::uno::Exception] | if some input parameter are wrong or the cache itself is not valid any longer, because any operation before damage it. |
Definition at line 280 of file filtercache.cxx.
References eType, impl_getItemList(), and m_aMutex.
Referenced by filter::config::BaseContainer::hasElements().
|
private |
TODO.
css::uno::Exception |
Definition at line 1206 of file filtercache.cxx.
References E_CONTENTHANDLER, E_FILTER, E_FRAMELOADER, E_TYPE, eType, m_lChangedContentHandlers, m_lChangedFilters, m_lChangedFrameLoaders, and m_lChangedTypes.
Referenced by removeItem(), and setItem().
|
staticprivate |
convert a flag field value to its list representation of flag names.
nFlags | the flag field value |
Definition at line 1815 of file filtercache.cxx.
References comphelper::containerToSequence(), FLAGNAME_3RDPARTYFILTER, FLAGNAME_ALIEN, FLAGNAME_COMBINED, FLAGNAME_CONSULTSERVICE, FLAGNAME_DEFAULT, FLAGNAME_ENCRYPTION, FLAGNAME_EXOTIC, FLAGNAME_EXPORT, FLAGNAME_GPGENCRYPTION, FLAGNAME_IMPORT, FLAGNAME_INTERNAL, FLAGNAME_NOTINFILEDIALOG, FLAGNAME_NOTINSTALLED, FLAGNAME_OWN, FLAGNAME_PACKED, FLAGNAME_PASSWORDTOMODIFY, FLAGNAME_PREFERRED, FLAGNAME_READONLY, FLAGNAME_STARTPRESENTATION, FLAGNAME_SUPPORTSSELECTION, FLAGNAME_SUPPORTSSIGNING, FLAGNAME_TEMPLATE, and FLAGNAME_TEMPLATEPATH.
|
staticprivate |
convert a list of flag names to its int representation.
lNames | the list of flag names. |
Definition at line 1849 of file filtercache.cxx.
References FLAGNAME_3RDPARTYFILTER, FLAGNAME_ALIEN, FLAGNAME_COMBINED, FLAGNAME_CONSULTSERVICE, FLAGNAME_DEFAULT, FLAGNAME_ENCRYPTION, FLAGNAME_EXOTIC, FLAGNAME_EXPORT, FLAGNAME_GPGENCRYPTION, FLAGNAME_IMPORT, FLAGNAME_INTERNAL, FLAGNAME_NOTINFILEDIALOG, FLAGNAME_NOTINSTALLED, FLAGNAME_OWN, FLAGNAME_PACKED, FLAGNAME_PASSWORDTOMODIFY, FLAGNAME_PREFERRED, FLAGNAME_READONLY, FLAGNAME_STARTPRESENTATION, FLAGNAME_SUPPORTSSELECTION, FLAGNAME_SUPPORTSSIGNING, FLAGNAME_TEMPLATE, FLAGNAME_TEMPLATEPATH, and gentoken::i.
Referenced by impl_loadItem().
|
staticprivate |
tries to open the requested configuration root using the specified modi.
sRoot | specify the configuration root, which should be opened. |
bReadOnly | enable/disable write access on the returned configuration object. |
bLocalesMode | enable/disable special handling of localized configuration items by the returned configuration object. |
Definition at line 877 of file filtercache.cxx.
References bReadOnly, comphelper::containerToSequence(), ex, comphelper::getProcessComponentContext(), utl::ConfigManager::IsFuzzing(), SERVICE_CONFIGURATIONACCESS, and SERVICE_CONFIGURATIONUPDATEACCESS.
Referenced by impl_getDirectCFGValue(), and impl_openConfig().
|
staticprivate |
TODO.
css::uno::Exception |
Definition at line 611 of file filtercache.cxx.
References E_ITEM_ADDED, E_ITEM_CHANGED, E_ITEM_REMOVED, eType, impl_saveItem(), impl_specifyFlushOperation(), and xFactory.
Referenced by flush().
|
staticprivate |
reads the specified configuration key and return its value.
@descr The specified key must be an absolute configuration path, which can be split into its package and relative path tokens.
sDirectKey | the absolute configuration path, which should be read. |
Definition at line 838 of file filtercache.cxx.
References impl_createConfigAccess(), and TOOLS_WARN_EXCEPTION.
Referenced by getItemWithStateProps(), impl_validateAndOptimize(), and load().
|
private |
Definition at line 363 of file filtercache.cxx.
References E_FILTER, eType, impl_getItemList(), impl_isModuleInstalled(), impl_loadItemOnDemand(), and PROPNAME_DOCUMENTSERVICE.
Referenced by getItem(), and getItemWithStateProps().
|
private |
Definition at line 741 of file filtercache.cxx.
References E_CONTENTHANDLER, E_FILTER, E_FRAMELOADER, E_TYPE, eType, m_lContentHandlers, m_lFilters, m_lFrameLoaders, and m_lTypes.
|
private |
return a reference to one of our internal sub container, which contains items of the requested type.
eType | specify, which sub container is needed outside. |
[css::uno::Exception] | if the required list does not exist. |
Definition at line 726 of file filtercache.cxx.
References E_CONTENTHANDLER, E_FILTER, E_FRAMELOADER, E_TYPE, eType, m_lContentHandlers, m_lFilters, m_lFrameLoaders, and m_lTypes.
Referenced by getItemNames(), getMatchingItemsByProps(), hasItem(), hasItems(), impl_getItem(), removeItem(), and setItem().
|
staticprivate |
TODO.
Definition at line 2003 of file filtercache.cxx.
References comphelper::containerToSequence(), impl_tokenizeString(), PROPNAME_DOCUMENTSERVICE, PROPNAME_FILEFORMATVERSION, PROPNAME_FILTERSERVICE, PROPNAME_FLAGS, PROPNAME_TEMPLATENAME, PROPNAME_TYPE, PROPNAME_UICOMPONENT, PROPNAME_USERDATA, and SAL_WARN.
Referenced by impl_readOldItem().
|
staticprivate |
TODO.
Definition at line 1978 of file filtercache.cxx.
References comphelper::containerToSequence(), impl_tokenizeString(), PROPNAME_CLIPBOARDFORMAT, PROPNAME_EXTENSIONS, PROPNAME_MEDIATYPE, PROPNAME_PREFERRED, and PROPNAME_URLPATTERN.
Referenced by impl_readOldItem().
|
private |
check if the specified OOo module is installed.
sModule | the long name of the module (e.g. "com.sun.star.text.TextDocument"). |
Definition at line 2195 of file filtercache.cxx.
References m_xModuleCfg.
Referenced by impl_getItem().
|
private |
load the underlying configuration into this cache.
@descr Which items should be read can be regulate by the parameter eRequiredState. That provides the possibility to load standard values on startup only and update this cache later on demand with all available information.
eRequiredState | indicates, which fill state this cache should have afterwards. |
css::uno::Exception |
Definition at line 1258 of file filtercache.cxx.
References E_CONTAINS_CONTENTHANDLERS, E_CONTAINS_FILTERS, E_CONTAINS_FRAMELOADERS, E_CONTAINS_STANDARD, E_CONTAINS_TYPES, E_CONTENTHANDLER, E_FILTER, E_FRAMELOADER, E_PROVIDER_FILTERS, E_PROVIDER_OTHERS, E_PROVIDER_TYPES, E_READ_ALL, E_READ_STANDARD, E_READ_UPDATE, impl_loadSet(), impl_openConfig(), impl_validateAndOptimize(), m_eFillState, m_lContentHandlers, m_lFilters, m_lFrameLoaders, m_lTypes, and SAL_INFO.
Referenced by load().
|
private |
read the specified container item from the given configuration set.
@descr It's not added to any internal structures here. That must be done outside this method.
xSet | provides access to the configuration set, which includes all items. |
eType | specify, which container item type must be read. |
sItem | means the internal name, which can be used to address the item properties relative to the given configuration set. |
eOption | regulate, which properties of the requested item should be read. See definition of EReadOption for further information. |
[css::uno::Exception] | if an unrecoverable error occurs inside this operation. |
Definition at line 1540 of file filtercache.cxx.
References E_CONTENTHANDLER, E_FILTER, E_FRAMELOADER, E_READ_ALL, E_READ_UPDATE, E_TYPE, eType, gentoken::i, impl_convertFlagNames2FlagField(), impl_readPatchUINames(), m_aStandardProps, m_aTypeProps, PROPNAME_FLAGS, PROPNAME_NAME, and PROPNAME_TYPES.
Referenced by impl_loadItemOnDemand(), and impl_loadSet().
|
private |
try to load the requested item on demand from the underlying configuration layer.
@descr The outside code has to be sure, that the item does not already exists inside this cache. Otherwise it will be loaded twice. This method doesn't check such constellations!
eType | specify the type of config item, which must be interpreted. Of course this information can be used to locate the right set at the given xConfig API object. |
sItem | the set node name of the requested item. |
[css::container::NoSuchElementException] | if the item does not exists inside the configuration layer too! |
[css::uno::Exception] | if an unrecoverable error occurs inside this operation. |
Definition at line 1637 of file filtercache.cxx.
References CFGSET_CONTENTHANDLERS, CFGSET_FILTERS, CFGSET_FRAMELOADERS, CFGSET_TYPES, E_CONTENTHANDLER, E_FILTER, E_FRAMELOADER, E_PROVIDER_FILTERS, E_PROVIDER_OTHERS, E_PROVIDER_TYPES, E_READ_ALL, E_TYPE, eType, impl_loadItem(), impl_openConfig(), m_lContentHandlers, m_lFilters, m_lFrameLoaders, and m_lTypes.
Referenced by hasItem(), impl_getItem(), refreshItem(), and removeItem().
|
private |
read the specified config set into the cache.
@descr This method provides the following mechanism for reading: a) read only standard properties of set items b) read anything c) read only optional properties and update already existing items of the specified cache
xConfig | API which provides access to the required configuration set. |
eType | specify the type of config item, which must be interpreted. Of course this information can be used to locate the right set at the given xConfig API object. |
eOption | regulate reading of standard/optional or all properties. |
pCache | points to the cache member, which should be filled or updated. |
[css::uno::Exception] | if an unrecoverable error occurs inside this operation. |
Definition at line 1356 of file filtercache.cxx.
References CFGSET_CONTENTHANDLERS, CFGSET_FILTERS, CFGSET_FRAMELOADERS, CFGSET_TYPES, E_CONTENTHANDLER, E_FILTER, E_FRAMELOADER, E_READ_ALL, E_READ_STANDARD, E_READ_UPDATE, E_TYPE, eType, ex, gentoken::i, and impl_loadItem().
Referenced by impl_load().
|
private |
return a valid configuration update access to the underlying configuration package, which is fix for this cache.
@descr It checks first, if the internal member m_xConfig already points to an open update access. If not - it opens a new one. Doing so this method can be called every time a configuration access is needed.
eProvider | specify the needed configuration provider. see EConfigProvider for further information ... |
css::uno::Exception |
Definition at line 756 of file filtercache.cxx.
References CFGPACKAGE_TD_FILTERS, CFGPACKAGE_TD_OLD, CFGPACKAGE_TD_OTHERS, CFGPACKAGE_TD_TYPES, E_FILTER, E_PROVIDER_FILTERS, E_PROVIDER_OLD, E_PROVIDER_OTHERS, E_PROVIDER_TYPES, E_TYPE, impl_createConfigAccess(), m_xConfigFilters, m_xConfigOthers, m_xConfigTypes, m_xFiltersChgListener, m_xTypesChglisteners, and SAL_INFO.
Referenced by flush(), getItemWithStateProps(), impl_load(), impl_loadItemOnDemand(), and impl_readOldFormat().
|
private |
TODO.
Definition at line 2049 of file filtercache.cxx.
References E_FILTER, E_PROVIDER_OLD, impl_openConfig(), impl_readOldItem(), m_lFilters, and m_lTypes.
Referenced by load().
|
private |
TODO.
css::uno::Exception |
Definition at line 2091 of file filtercache.cxx.
References E_FILTER, E_TYPE, eType, impl_interpretDataVal4Filter(), impl_interpretDataVal4Type(), impl_readPatchUINames(), impl_tokenizeString(), and PROPNAME_NAME.
Referenced by impl_readOldFormat().
|
private |
TODO.
css::uno::Exception |
Definition at line 1465 of file filtercache.cxx.
References comphelper::SequenceAsHashMap::end(), comphelper::SequenceAsHashMap::find(), comphelper::SequenceAsHashMap::getAsConstPropertyValueList(), LanguageTag::getFallback(), comphelper::SequenceAsHashMap::getUnpackedValueOrDefault(), m_sActLocale, pLocale, PROPNAME_NAME, PROPNAME_UINAME, PROPNAME_UINAMES, SAL_WARN, comphelper::sequenceToContainer(), and sName.
Referenced by impl_loadItem(), and impl_readOldItem().
|
staticprivate |
TODO.
css::uno::Exception |
Definition at line 1709 of file filtercache.cxx.
References E_CONTENTHANDLER, E_FILTER, E_FRAMELOADER, E_TYPE, comphelper::SequenceAsHashMap::end(), eType, comphelper::SequenceAsHashMap::find(), impl_savePatchUINames(), PROPNAME_CLIPBOARDFORMAT, PROPNAME_DETECTSERVICE, PROPNAME_DOCUMENTSERVICE, PROPNAME_EXTENSIONS, PROPNAME_FILEFORMATVERSION, PROPNAME_FILTERSERVICE, PROPNAME_FLAGS, PROPNAME_MEDIATYPE, PROPNAME_PREFERRED, PROPNAME_PREFERREDFILTER, PROPNAME_TEMPLATENAME, PROPNAME_TYPE, PROPNAME_TYPES, PROPNAME_UICOMPONENT, PROPNAME_UINAME, PROPNAME_URLPATTERN, and PROPNAME_USERDATA.
Referenced by impl_flushByList().
|
staticprivate |
TODO.
css::uno::Exception |
Definition at line 1515 of file filtercache.cxx.
References comphelper::SequenceAsHashMap::getUnpackedValueOrDefault(), gentoken::i, Name, PROPNAME_UINAMES, and Value.
Referenced by impl_saveItem().
|
private |
Definition at line 2178 of file filtercache.cxx.
References m_lContentHandlers, PROPNAME_TYPES, and sType.
Referenced by impl_validateAndOptimize().
|
private |
TODO.
Definition at line 2161 of file filtercache.cxx.
References m_lFrameLoaders, PROPNAME_TYPES, and sType.
Referenced by impl_validateAndOptimize().
|
staticprivate |
specify, which save operation is necessary for the specified item.
@desrc If an item of this cache will be added/removed or modified it will be changed inside memory only first. But we save its name inside a special list of changed items. If at least the method flush() is called, we use this list to check if the item was changed/added or removed. This method checks the exist state of the requested item inside our own cache and inside the underlying configuration layer to find out, if the item must be removed/added or modified inside the configuration layer.
xSet | points directly to the configuration set, where the item should resist (if it exists!). |
rList | points to our internal cache list, where the item should resist (if it exists!). |
sItem | the internal name of the item, which should be checked. |
An | exception if anything failed inside this operation. e.g. the given configuration set was not open. |
Definition at line 1236 of file filtercache.cxx.
References E_ITEM_ADDED, E_ITEM_CHANGED, E_ITEM_REMOVED, and E_ITEM_UNCHANGED.
Referenced by impl_flushByList().
|
staticprivate |
TODO.
Definition at line 2144 of file filtercache.cxx.
References o3tl::getToken(), and nToken.
Referenced by impl_interpretDataVal4Filter(), impl_interpretDataVal4Type(), and impl_readOldItem().
|
private |
validate the whole cache and create structures for optimized items access.
@descr Wrong cache items will be removed automatically. Wrong dependencies will be corrected automatically. If something could not be repaired - an exception is thrown. Further some optimized structures will be created. E.g.: a hash to map extensions to her types.
[css::uno::Exception] | if cache is invalid and could not be repaired. |
Definition at line 936 of file filtercache.cxx.
References CFGDIRECTKEY_DEFAULTFRAMELOADER, comphelper::containerToSequence(), E_CONTAINS_CONTENTHANDLERS, E_CONTAINS_FILTERS, E_CONTAINS_FRAMELOADERS, E_CONTAINS_STANDARD, comphelper::SequenceAsHashMap::end(), comphelper::SequenceAsHashMap::find(), getItemNames(), impl_getDirectCFGValue(), impl_searchContentHandlerForType(), impl_searchFrameLoaderForType(), m_eFillState, m_lExtensions2Types, m_lFilters, m_lFrameLoaders, m_lTypes, m_lURLPattern2Types, OUStringToOString(), PROPNAME_EXTENSIONS, PROPNAME_FLAGS, PROPNAME_NAME, PROPNAME_PREFERRED, PROPNAME_PREFERREDFILTER, PROPNAME_TYPE, PROPNAME_TYPES, PROPNAME_URLPATTERN, sType, and u.
Referenced by flush(), impl_load(), and takeOver().
bool filter::config::FilterCache::isFillState | ( | FilterCache::EFillState | eState | ) | const |
return the current fill state of this cache.
@descr This information can be used e.g. to start a search on top of this cache with a minimum on information ... and do it again, if some other cache items seems to be available after calling of "loadAll()" on this cache and first search does not had any valid results.
css::uno::Exception |
Definition at line 238 of file filtercache.cxx.
References m_aMutex, and m_eFillState.
void filter::config::FilterCache::load | ( | EFillState | eRequired | ) |
force special fill state of this cache.
@descr This method checks, if all requested items/properties already exist. Only missing information will be read. Otherwise this method does nothing!
This method must be called from every user of this cache every time it needs a filled cache. Normally we load only standard information into this cache on startup.
An | exception if the cache could not be filled really or seems to be invalid afterwards. But there is no reaction at all if this method does nothing inside, because the cache is already fully filled! |
Definition at line 199 of file filtercache.cxx.
References CFGDIRECTKEY_OFFICELOCALE, DEFAULT_OFFICELOCALE, E_CONTAINS_NOTHING, impl_getDirectCFGValue(), impl_load(), impl_readOldFormat(), m_aMutex, m_eFillState, and m_sActLocale.
Referenced by filter::config::BaseContainer::BaseContainer(), and filter::config::BaseContainer::impl_loadOnDemand().
void filter::config::FilterCache::refreshItem | ( | EItemType | eType, |
const OUString & | sItem | ||
) |
TODO document me ...
css::uno::Exception |
Definition at line 458 of file filtercache.cxx.
References eType, impl_loadItemOnDemand(), and m_aMutex.
Referenced by filter::config::CacheUpdateListener::changesOccurred().
void filter::config::FilterCache::removeItem | ( | EItemType | eType, |
const OUString & | sItem | ||
) |
TODO document me ...
css::uno::Exception |
Definition at line 410 of file filtercache.cxx.
References eType, impl_addItem2FlushList(), impl_getItemList(), impl_loadItemOnDemand(), and m_aMutex.
Referenced by filter::config::BaseContainer::removeByName().
|
static |
TODO document me.
css::uno::Exception |
Definition at line 564 of file filtercache.cxx.
References comphelper::SequenceAsHashMap::end(), comphelper::SequenceAsHashMap::erase(), comphelper::SequenceAsHashMap::find(), PROPNAME_FINALIZED, and PROPNAME_MANDATORY.
Referenced by setItem().
void filter::config::FilterCache::setItem | ( | EItemType | eType, |
const OUString & | sItem, | ||
const CacheItem & | aValue | ||
) |
TODO document me ...
css::uno::Exception |
Definition at line 430 of file filtercache.cxx.
References eType, impl_addItem2FlushList(), impl_getItemList(), m_aMutex, m_sActLocale, PROPNAME_NAME, removeStatePropsFromItem(), and filter::config::CacheItem::validateUINames().
Referenced by filter::config::BaseContainer::insertByName(), and filter::config::BaseContainer::replaceByName().
void filter::config::FilterCache::takeOver | ( | const FilterCache & | rClone | ) |
copy the cache content or rClone back to this instance.
Definition at line 151 of file filtercache.cxx.
References impl_validateAndOptimize(), m_aMutex, m_eFillState, m_lChangedContentHandlers, m_lChangedFilters, m_lChangedFrameLoaders, m_lChangedTypes, m_lContentHandlers, m_lFilters, m_lFrameLoaders, m_lTypes, and m_sActLocale.
Referenced by filter::config::BaseContainer::flush().
|
mutableprivate |
Definition at line 165 of file filtercache.hxx.
Referenced by clone(), detectFlatForURL(), flush(), getItem(), getItemNames(), getItemWithStateProps(), getMatchingItemsByProps(), hasItem(), hasItems(), isFillState(), load(), refreshItem(), removeItem(), setItem(), and takeOver().
|
private |
standard property names for filter config keyed by EReadOption
Definition at line 235 of file filtercache.hxx.
Referenced by FilterCache(), and impl_loadItem().
|
private |
type property names for filter config keyed by EReadOption
Definition at line 238 of file filtercache.hxx.
Referenced by FilterCache(), and impl_loadItem().
|
private |
contains status, which cache items/properties was already loaded from the underlying configuration.
@descr This information can be used to detect missing information and load it on demand.
Definition at line 225 of file filtercache.hxx.
Referenced by clone(), impl_load(), impl_validateAndOptimize(), isFillState(), load(), and takeOver().
|
private |
Definition at line 232 of file filtercache.hxx.
Referenced by clone(), impl_addItem2FlushList(), and takeOver().
|
private |
Definition at line 230 of file filtercache.hxx.
Referenced by clone(), flush(), impl_addItem2FlushList(), and takeOver().
|
private |
Definition at line 231 of file filtercache.hxx.
Referenced by clone(), impl_addItem2FlushList(), and takeOver().
|
private |
TODO document me ...
Definition at line 229 of file filtercache.hxx.
Referenced by clone(), flush(), impl_addItem2FlushList(), and takeOver().
|
mutableprivate |
contains all loaded content handler with its properties.
Definition at line 196 of file filtercache.hxx.
Referenced by clone(), impl_getItemList(), impl_load(), impl_loadItemOnDemand(), impl_searchContentHandlerForType(), and takeOver().
|
mutableprivate |
optimize mapping of URL extensions to a type representation, by using extensions as key and a list of internal type names as value.
Definition at line 202 of file filtercache.hxx.
Referenced by clone(), detectFlatForURL(), and impl_validateAndOptimize().
|
mutableprivate |
contains all loaded filters with its properties.
Definition at line 188 of file filtercache.hxx.
Referenced by clone(), flush(), impl_getItemList(), impl_load(), impl_loadItemOnDemand(), impl_readOldFormat(), impl_validateAndOptimize(), and takeOver().
|
mutableprivate |
contains all loaded frame loader with its properties.
Definition at line 192 of file filtercache.hxx.
Referenced by clone(), impl_getItemList(), impl_load(), impl_loadItemOnDemand(), impl_searchFrameLoaderForType(), impl_validateAndOptimize(), and takeOver().
|
mutableprivate |
contains all loaded types with its properties.
Definition at line 184 of file filtercache.hxx.
Referenced by clone(), flush(), impl_getItemList(), impl_load(), impl_loadItemOnDemand(), impl_readOldFormat(), impl_validateAndOptimize(), and takeOver().
|
mutableprivate |
optimize mapping of URL pattern to a type representation, by using patterns as key and a list of internal type names as value.
Definition at line 208 of file filtercache.hxx.
Referenced by clone(), detectFlatForURL(), and impl_validateAndOptimize().
|
private |
contains the current locale of the office and will be used to work with localized configuration values.
Definition at line 213 of file filtercache.hxx.
Referenced by clone(), impl_readPatchUINames(), load(), setItem(), and takeOver().
|
mutableprivate |
holds the used configuration provider alive, which provides access to the list of filters.
Definition at line 174 of file filtercache.hxx.
Referenced by impl_openConfig().
|
mutableprivate |
holds the used configuration provider alive, which provides access to the list of other values needed by our type detection framework.
Definition at line 180 of file filtercache.hxx.
Referenced by impl_openConfig().
|
mutableprivate |
holds the used configuration provider alive, which provides access to the list of types.
Definition at line 169 of file filtercache.hxx.
Referenced by impl_openConfig().
|
private |
Definition at line 244 of file filtercache.hxx.
Referenced by impl_openConfig(), and ~FilterCache().
|
private |
readonly access to the module configuration of OOo
Definition at line 241 of file filtercache.hxx.
Referenced by impl_isModuleInstalled().
|
private |
Definition at line 243 of file filtercache.hxx.
Referenced by impl_openConfig(), and ~FilterCache().