KCoreAddons

kautosavefile.h
1 /*
2  This file is part of the KDE libraries
3 
4  SPDX-FileCopyrightText: 2006 Jacob R Rideout <[email protected]>
5 
6  SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8 
9 #ifndef KAUTOSAVEFILE_H
10 #define KAUTOSAVEFILE_H
11 
12 #include <kcoreaddons_export.h>
13 
14 #include <QFile>
15 #include <QList>
16 #include <QUrl>
17 
18 class KAutoSaveFilePrivate;
118 class KCOREADDONS_EXPORT KAutoSaveFile : public QFile
119 {
120  Q_OBJECT
121 public:
131  explicit KAutoSaveFile(const QUrl &filename, QObject *parent = nullptr);
132 
140  explicit KAutoSaveFile(QObject *parent = nullptr);
141 
146  ~KAutoSaveFile() override;
147 
157  QUrl managedFile() const;
158 
166  void setManagedFile(const QUrl &filename);
167 
177  virtual void releaseLock();
178 
192  bool open(OpenMode openmode) override;
193 
214  static QList<KAutoSaveFile *> staleFiles(const QUrl &url,
215  const QString &applicationName =
216  QString());
217 
228  static QList<KAutoSaveFile *> allStaleFiles(const QString &applicationName =
229  QString());
230 
231 private:
233  friend class KAutoSaveFilePrivate;
234  KAutoSaveFilePrivate *const d;
235 };
236 
237 #endif // KAUTOSAVEFILE_H
Creates and manages a temporary "auto-save" file.
virtual bool open(QIODevice::OpenMode mode) override
Q_DISABLE_COPY(Class)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Aug 7 2020 23:00:04 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.