File indexing completed on 2024-04-28 17:06:21
0001 /* 0002 SPDX-FileCopyrightText: 2002 Shie Erlich <erlich@users.sourceforge.net> 0003 SPDX-FileCopyrightText: 2002 Rafi Yanai <yanai@users.sourceforge.net> 0004 SPDX-FileCopyrightText: 2004-2022 Krusader Krew <https://krusader.org> 0005 0006 SPDX-License-Identifier: GPL-2.0-or-later 0007 */ 0008 0009 #ifndef KRPREVIEWPOPUP_H 0010 #define KRPREVIEWPOPUP_H 0011 0012 // QtCore 0013 #include <QUrl> 0014 // QtGui 0015 #include <QPixmap> 0016 // QtWidgets 0017 #include <QMenu> 0018 0019 #include <KIOCore/KFileItem> 0020 0021 class KrPreviewPopup : public QMenu 0022 { 0023 Q_OBJECT 0024 0025 public: 0026 KrPreviewPopup(); 0027 0028 void setUrls(const QList<QUrl> &urls); 0029 public slots: 0030 void addPreview(const KFileItem &file, const QPixmap &preview); 0031 void view(QAction *); 0032 0033 protected: 0034 void showEvent(QShowEvent *event) override; 0035 0036 QAction *prevNotAvailAction; 0037 QList<KFileItem> files; 0038 bool jobStarted; 0039 0040 private: 0041 static const int MAX_SIZE = 400; 0042 static const short MARGIN = 5; 0043 0044 class ProxyStyle; 0045 }; 0046 0047 #endif