File indexing completed on 2024-05-05 04:19:16

0001 // vim: set tabstop=4 shiftwidth=4 expandtab:
0002 /*
0003 Gwenview: an image viewer
0004 Copyright 2008 Aurélien Gâteau <agateau@kde.org>
0005 
0006 This program is free software; you can redistribute it and/or
0007 modify it under the terms of the GNU General Public License
0008 as published by the Free Software Foundation; either version 2
0009 of the License, or (at your option) any later version.
0010 
0011 This program is distributed in the hope that it will be useful,
0012 but WITHOUT ANY WARRANTY; without even the implied warranty of
0013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0014 GNU General Public License for more details.
0015 
0016 You should have received a copy of the GNU General Public License
0017 along with this program; if not, write to the Free Software
0018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Cambridge, MA 02110-1301, USA.
0019 
0020 */
0021 #ifndef GVCORE_H
0022 #define GVCORE_H
0023 
0024 // Qt
0025 #include <QObject>
0026 
0027 // KF
0028 
0029 // Local
0030 
0031 class KJob;
0032 class QUrl;
0033 
0034 class QAbstractItemModel;
0035 class QPalette;
0036 class QString;
0037 
0038 namespace Gwenview
0039 {
0040 class AbstractSemanticInfoBackEnd;
0041 class MainWindow;
0042 class SortedDirModel;
0043 
0044 struct GvCorePrivate;
0045 class GvCore : public QObject
0046 {
0047     Q_OBJECT
0048 public:
0049     GvCore(MainWindow *mainWindow, SortedDirModel *);
0050     ~GvCore() override;
0051 
0052     enum PaletteType {
0053         NormalPalette = 0,
0054         NormalViewPalette,
0055         FullScreenPalette,
0056         FullScreenViewPalette,
0057     };
0058 
0059     QAbstractItemModel *recentFoldersModel() const;
0060     QAbstractItemModel *recentFilesModel() const;
0061     SortedDirModel *sortedDirModel() const;
0062     AbstractSemanticInfoBackEnd *semanticInfoBackEnd() const;
0063 
0064     void addUrlToRecentFolders(QUrl);
0065     void addUrlToRecentFiles(const QUrl &);
0066     void clearRecentFilesAndFolders();
0067 
0068     QPalette palette(PaletteType type) const;
0069     QString fullScreenPaletteName() const;
0070 
0071     void setTrackFileManagerSorting(bool enable);
0072     /// Whether the file listing should follow the filemanager (i.e dolphin) sorting for this folder, default to false
0073     bool trackFileManagerSorting();
0074 
0075 public Q_SLOTS:
0076     void saveAll();
0077     void save(const QUrl &);
0078     void saveAs(const QUrl &);
0079     void rotateLeft(const QUrl &);
0080     void rotateRight(const QUrl &);
0081     void setRating(const QUrl &, int);
0082 
0083 private Q_SLOTS:
0084     void slotConfigChanged();
0085     void slotSaveResult(KJob *);
0086 
0087 private:
0088     GvCorePrivate *const d;
0089     bool sortingTracksFileManager = false;
0090 };
0091 
0092 } // namespace
0093 
0094 #endif /* GVCORE_H */