LibreOffice Module filter (master) 1
cacheupdatelistener.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19#pragma once
20
21#include "filtercache.hxx"
22#include <com/sun/star/util/XChangesListener.hpp>
24#include <mutex>
25
26
27namespace filter::config {
28
29
34class CacheUpdateListener : public ::cppu::WeakImplHelper< css::util::XChangesListener >
35{
36
37 // member
38
39 private:
40
41 std::mutex m_aMutex;
42
46
48 css::uno::Reference< css::uno::XInterface > m_xConfig;
49
55
56
57 // native interface
58
59 public:
60
61
62 // ctor/dtor
63
77 CacheUpdateListener(FilterCache &rFilterCache,
78 css::uno::Reference< css::uno::XInterface > xConfigAccess,
79 FilterCache::EItemType eConfigType);
80
81
84 virtual ~CacheUpdateListener() override;
85
86
89 void startListening();
90
91
94 void stopListening();
95
96
97 // uno interface
98
99 public:
100
101
102 // XChangesListener
103
104 virtual void SAL_CALL changesOccurred(const css::util::ChangesEvent& aEvent) override;
105
106
107 // lang.XEventListener
108 virtual void SAL_CALL disposing(const css::lang::EventObject& aEvent) override;
109};
110
111} // namespace filter::config
112
113/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
implements a listener, which will update the global filter cache, if the underlying configuration wa ...
css::uno::Reference< css::uno::XInterface > m_xConfig
holds the configuration access, where we listen alive.
virtual ~CacheUpdateListener() override
standard dtor.
FilterCache::EItemType m_eConfigType
every instance of this update listener listen on a special sub set of the filter configuration.
CacheUpdateListener(FilterCache &rFilterCache, css::uno::Reference< css::uno::XInterface > xConfigAccess, FilterCache::EItemType eConfigType)
initialize new instance of this class.
FilterCache & m_rCache
reference to the singleton(!) filter cache implementation, which should be updated by this thread.
virtual void SAL_CALL changesOccurred(const css::util::ChangesEvent &aEvent) override
virtual void SAL_CALL disposing(const css::lang::EventObject &aEvent) override
implements a cache, which contains all elements of our filter and type detection configuration.
Definition: filtercache.hxx:61
EItemType
identify the type of a container item.
Definition: filtercache.hxx:74