File indexing completed on 2024-05-12 16:01:41

0001 /*
0002  *  SPDX-FileCopyrightText: 2013 Dmitry Kazakov <dimula73@gmail.com>
0003  *
0004  *  SPDX-License-Identifier: GPL-2.0-or-later
0005  */
0006 
0007 #ifndef __KIS_SAFE_DOCUMENT_LOADER_H
0008 #define __KIS_SAFE_DOCUMENT_LOADER_H
0009 
0010 #include <QObject>
0011 #include "kis_types.h"
0012 #include "kritaui_export.h"
0013 
0014 class KRITAUI_EXPORT KisSafeDocumentLoader : public QObject
0015 {
0016     Q_OBJECT
0017 public:
0018 
0019     KisSafeDocumentLoader(const QString &path = "", QObject *parent = 0);
0020     ~KisSafeDocumentLoader() override;
0021 
0022     void setPath(const QString &path);
0023     void reloadImage();
0024 private Q_SLOTS:
0025     void fileChanged(QString);
0026     void slotFileExistsStateChanged(const QString &path, bool fileExists);
0027     void fileChangedCompressed(bool sync = false);
0028     void delayedLoadStart();
0029 
0030 Q_SIGNALS:
0031     void loadingFinished(KisPaintDeviceSP paintDevice, qreal xRes, qreal yRes, const QSize &size);
0032     void loadingFailed();
0033     void fileExistsStateChanged(bool fileExists);
0034 
0035 private:
0036     struct Private;
0037     Private * const m_d;
0038 };
0039 
0040 #endif /* __KIS_SAFE_DOCUMENT_LOADER_H */