Scribus
Open source desktop publishing at your fingertips
scimagecachefile.h
1 /*
2 For general Scribus (>=1.3.2) copyright and licensing information please refer
3 to the COPYING file provided with the program. Following this notice may exist
4 a copyright and/or license notice that predates the release of Scribus 1.3.2
5 for which a new license (GPL+exception) is in place.
6 */
7 /***************************************************************************
8  copyright : (C) 2010 by Marcus Holland-Moritz
9  email : scribus@mhxnet.de
10 ***************************************************************************/
11 
12 /***************************************************************************
13 * *
14 * This program is free software; you can redistribute it and/or modify *
15 * it under the terms of the GNU General Public License as published by *
16 * the Free Software Foundation; either version 2 of the License, or *
17 * (at your option) any later version. *
18 * *
19 ***************************************************************************/
20 
21 #ifndef SCIMAGECACHEFILE_H
22 #define SCIMAGECACHEFILE_H
23 
24 #include <QObject>
25 #include <QDateTime>
26 #include <QFileInfo>
27 #include <QString>
28 
29 #include "scribusapi.h"
30 
31 class ScImageCacheDir;
32 
37 class ScImageCacheFile : public QObject
38 {
39  Q_OBJECT
40 
41 public:
42  ScImageCacheFile(const QString & name, ScImageCacheDir *parent = 0);
44 
45  QString path(bool relative = false) const;
46  qint64 size() const;
47  const QDateTime & modified() const { return m_modified; };
48  bool exists() const;
49  bool hasChanged(const QFileInfo & info) const;
50  bool hasChanged() const;
51  bool update(const QFileInfo & info);
52  bool update();
53 
54 private:
55  const QString m_name;
56  ScImageCacheDir * const m_parent;
57  QDateTime m_modified;
58  qint64 m_size;
59 };
60 
61 #endif
Representation of a directory node in the image cache tree.
Definition: scimagecachedir.h:38
Representation of a file node in the image cache tree.
Definition: scimagecachefile.h:37