File indexing completed on 2024-05-12 15:59:14
0001 /* This file is part of the KDE project 0002 * SPDX-FileCopyrightText: 2012 Boudewijn Rempt <boud@kogmbh.com> 0003 * 0004 * SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 #ifndef RECENTFILEMANAGER_H 0007 #define RECENTFILEMANAGER_H 0008 0009 #include <QObject> 0010 0011 #include "krita_sketch_export.h" 0012 0013 /** 0014 * @brief The RecentFileManager class keeps track of recent files 0015 */ 0016 class KRITA_SKETCH_EXPORT RecentFileManager : public QObject 0017 { 0018 Q_OBJECT 0019 public: 0020 explicit RecentFileManager(QObject *parent = 0); 0021 ~RecentFileManager(); 0022 0023 /// @return the size of the recent files list 0024 int size(); 0025 0026 /// @return the recent file at position index or an empty string 0027 QString recentFile(int index) const; 0028 0029 /// @return the recent filename at position index or an empty string 0030 QString recentFileName(int index) const; 0031 0032 /// @return the list of filenames without their paths 0033 QStringList recentFileNames() const; 0034 0035 /// @return the list of recent files with their paths 0036 QStringList recentFiles() const; 0037 0038 0039 Q_SIGNALS: 0040 0041 void recentFilesListChanged(); 0042 0043 public Q_SLOTS: 0044 0045 0046 /// add the given filename to the front of the list of recent filenames 0047 void addRecent(const QString &_url); 0048 0049 private: 0050 class Private; 0051 Private* d; 0052 0053 }; 0054 0055 #endif // FILEMANAGER_H