21 #ifndef SCIMAGECACHEPROXY_H
22 #define SCIMAGECACHEPROXY_H
25 #include "scribusapi.h"
56 bool enabled()
const {
return m_isEnabled; }
66 bool load(QImage & image);
72 bool save(
const QImage & image);
81 void addMetadata(
const QString & key,
const QString & value);
85 void addModifier(
const QString & key,
const QString & value);
89 void delModifier(
const QString & key);
94 bool canUseCachedImage()
const;
99 void addInfo(
const QString & key,
const QString & value);
103 QString getInfo(
const QString & key)
const;
110 static QString getBaseName(
const QString & metafile);
117 static bool getRefCount(
const QString & reffile,
int & refcount);
124 static bool fixRefCount(
const QString & reffile,
int refcount);
136 static bool removeCacheEntry(
const QString & metafile,
bool haveMasterLock =
false);
140 typedef QMap<QString, QString> MetaMap;
142 const QString m_filename;
143 const bool m_isEnabled;
144 mutable QString m_metanameCache;
149 static QString imageFile(
const QString & base);
150 static QString referenceFile(
const QString & base);
152 static bool createCacheDir();
153 static QString addDirLevels(QString name);
155 const QString & metaName()
const;
156 QString imageBaseName(
const QImage & image)
const;
158 bool loadMetadata(MetaMap *meta, MetaMap *mod, MetaMap *info, QString *base)
const;
160 static bool loadMetadata(
ScLockedFile *file, MetaMap *meta, MetaMap *mod, MetaMap *info, QString *base);
161 static bool loadMetadata(
const QString & fn, MetaMap *meta, MetaMap *mod, MetaMap *info, QString *base);
162 static void saveMetadata(
ScLockedFile *file,
const MetaMap & map,
const MetaMap & mod,
const MetaMap & info,
const QString & base);
164 static bool getRefCountAbs(
const QString & reffile,
int & refcount);
165 static bool loadRef(
ScLockedFile *file,
int & refcount);
168 static bool unrefImage(
ScLockedFile *file,
const QString & imageName);
static const QString imageSuffix
Cache image file suffix.
Definition: scimagecacheproxy.h:44
Base class for locked file access.
Definition: sclockedfile.h:37
static const QString referenceSuffix
Reference file suffix.
Definition: scimagecacheproxy.h:43
bool enabled() const
Check if the image cache is enabled.
Definition: scimagecacheproxy.h:56
Scribus image cache manager.
Definition: scimagecachemanager.h:39
Scribus image cache proxy.
Definition: scimagecacheproxy.h:39
static const QString metaSuffix
Meta file suffix.
Definition: scimagecacheproxy.h:42
const QString & getFilename() const
Get original image file name.
Definition: scimagecacheproxy.h:60