File indexing completed on 2024-12-08 04:19:12

0001 /*
0002     SPDX-FileCopyrightText: 2012 Frederik Gladhorn <gladhorn@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #ifndef QACCESSIBILITYCLIENT_REGISTRYCACHE_P_H
0008 #define QACCESSIBILITYCLIENT_REGISTRYCACHE_P_H
0009 
0010 #include "qaccessibilityclient_export.h"
0011 #include "accessibleobject.h"
0012 
0013 namespace QAccessibleClient {
0014 
0015 class Registry;
0016 
0017 // Private API. May be gone or changed anytime soon.
0018 class QACCESSIBILITYCLIENT_EXPORT RegistryPrivateCacheApi
0019 {
0020 public:
0021     enum CacheType {
0022         NoCache, ///< Disable any caching.
0023         WeakCache, ///< Cache only objects in use and free them as long as no-one holds a reference to them any longer.
0024     };
0025 
0026     explicit RegistryPrivateCacheApi(Registry *registry);
0027 
0028     CacheType cacheType() const;
0029     void setCacheType(CacheType type);
0030 
0031     AccessibleObject clientCacheObject(const QString &id) const;
0032     QStringList clientCacheObjects() const;
0033     void clearClientCache();
0034 
0035 private:
0036     Registry *const m_registry;
0037 };
0038 
0039 }
0040 
0041 #endif