Rev 23880 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
14539 | jghali | 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 | |||
33 | /** |
||
34 | * @brief Representation of a file node in the image cache tree |
||
35 | * @author Marcus Holland-Moritz |
||
36 | */ |
||
37 | class ScImageCacheFile : public QObject |
||
38 | { |
||
39 | Q_OBJECT |
||
40 | |||
41 | public: |
||
23880 | craig | 42 | ScImageCacheFile(const QString & name, ScImageCacheDir* parent = nullptr); |
24736 | jghali | 43 | ~ScImageCacheFile() = default; |
14539 | jghali | 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; |
||
24736 | jghali | 56 | ScImageCacheDir * const m_parent { nullptr }; |
14539 | jghali | 57 | QDateTime m_modified; |
24736 | jghali | 58 | qint64 m_size { 0 }; |
14539 | jghali | 59 | }; |
60 | |||
61 | #endif |