Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qabstractgeotilecache_p.h
Go to the documentation of this file.
1// Copyright (C) 2015 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3#ifndef QABSTRACTGEOTILECACHE_P_H
4#define QABSTRACTGEOTILECACHE_P_H
5
6//
7// W A R N I N G
8// -------------
9//
10// This file is not part of the Qt API. It exists purely as an
11// implementation detail. This header file may change from version to
12// version without notice, or even be removed.
13//
14// We mean it.
15//
16
17#include <QtLocation/private/qlocationglobal_p.h>
18
19#include <QtCore/QSharedPointer>
20#include <QtCore/QObject>
21#include <QtCore/QString>
22#include <QtGui/QImage>
23
24#include "qgeotilespec_p.h"
25
26
27QT_BEGIN_NAMESPACE
28
29class QGeoMappingManager;
30class QGeoMappingManagerEngine;
31
32class QGeoTile;
33class QAbstractGeoTileCache;
34
35class QThread;
36
37/* This is also used in the mapgeometry */
44
45class Q_LOCATION_EXPORT QAbstractGeoTileCache : public QObject
46{
47 Q_OBJECT
48public:
49 enum CostStrategy {
50 Unitary,
51 ByteSize
52 };
53
54 enum CacheArea {
55 DiskCache = 0x01,
56 MemoryCache = 0x02,
57 AllCaches = 0xFF
58 };
59 Q_DECLARE_FLAGS(CacheAreas, CacheArea)
60
61 virtual ~QAbstractGeoTileCache();
62
63 virtual void setMaxDiskUsage(int diskUsage);
64 virtual int maxDiskUsage() const;
65 virtual int diskUsage() const;
66
67 virtual void setMaxMemoryUsage(int memoryUsage);
68 virtual int maxMemoryUsage() const;
69 virtual int memoryUsage() const;
70
71 virtual void setMinTextureUsage(int textureUsage) = 0;
72 virtual void setExtraTextureUsage(int textureUsage) = 0;
73 virtual int maxTextureUsage() const = 0;
74 virtual int minTextureUsage() const = 0;
75 virtual int textureUsage() const = 0;
76 virtual void clearAll() = 0;
77 virtual void setCostStrategyDisk(CostStrategy costStrategy) = 0;
78 virtual CostStrategy costStrategyDisk() const = 0;
79 virtual void setCostStrategyMemory(CostStrategy costStrategy) = 0;
80 virtual CostStrategy costStrategyMemory() const = 0;
81 virtual void setCostStrategyTexture(CostStrategy costStrategy) = 0;
82 virtual CostStrategy costStrategyTexture() const = 0;
83
84 virtual QSharedPointer<QGeoTileTexture> get(const QGeoTileSpec &spec) = 0;
85
86 virtual void insert(const QGeoTileSpec &spec,
87 const QByteArray &bytes,
88 const QString &format,
89 QAbstractGeoTileCache::CacheAreas areas = QAbstractGeoTileCache::AllCaches) = 0;
90 virtual void handleError(const QGeoTileSpec &spec, const QString &errorString);
91 virtual void init() = 0;
92
93 static QString baseCacheDirectory();
94 static QString baseLocationCacheDirectory();
95
96protected:
97 QAbstractGeoTileCache(QObject *parent = nullptr);
98 virtual void printStats() = 0;
99
100 friend class QGeoTiledMappingManagerEngine;
101};
102
103Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractGeoTileCache::CacheAreas)
104
105QT_END_NAMESPACE
106
107#endif // QABSTRACTGEOTILECACHE_P_H