File indexing completed on 2024-04-28 04:58:10
0001 /* This file is part of the KDE project 0002 SPDX-FileCopyrightText: 2000 Simon Hausmann <hausmann@kde.org> 0003 SPDX-FileCopyrightText: 2000-2007 David Faure <faure@kde.org> 0004 0005 SPDX-License-Identifier: LGPL-2.0-or-later 0006 */ 0007 0008 #ifndef __konq_events_h__ 0009 #define __konq_events_h__ 0010 0011 #include <libkonq_export.h> 0012 #include <kfileitem.h> 0013 #include <kconfigbase.h> 0014 0015 #include <QList> 0016 #include <QtGlobal> 0017 0018 #if QT_VERSION_MAJOR < 6 0019 #include <kparts/event.h> 0020 #else 0021 #include <QEvent> 0022 #endif 0023 0024 0025 namespace KParts 0026 { 0027 class ReadOnlyPart; 0028 } 0029 0030 0031 #if QT_VERSION_MAJOR < 6 0032 class LIBKONQ_EXPORT KonqFileSelectionEvent : public KParts::Event 0033 #else 0034 class LIBKONQ_EXPORT KonqFileSelectionEvent : public QEvent 0035 #endif 0036 { 0037 public: 0038 KonqFileSelectionEvent(const KFileItemList &selection, KParts::ReadOnlyPart *part); 0039 ~KonqFileSelectionEvent() override; 0040 0041 KFileItemList selection() const 0042 { 0043 return m_selection; 0044 } 0045 0046 KParts::ReadOnlyPart *part() const 0047 { 0048 return m_part; 0049 } 0050 0051 static bool test(const QEvent *event); 0052 0053 private: 0054 #if QT_VERSION_MAJOR < 6 0055 Q_DISABLE_COPY(KonqFileSelectionEvent) 0056 static const char *const s_fileItemSelectionEventName; 0057 #endif 0058 0059 KFileItemList m_selection; 0060 KParts::ReadOnlyPart *m_part; 0061 }; 0062 0063 #if QT_VERSION_MAJOR < 6 0064 class LIBKONQ_EXPORT KonqFileMouseOverEvent : public KParts::Event 0065 #else 0066 class LIBKONQ_EXPORT KonqFileMouseOverEvent : public QEvent 0067 #endif 0068 { 0069 public: 0070 KonqFileMouseOverEvent(const KFileItem &item, KParts::ReadOnlyPart *part); 0071 ~KonqFileMouseOverEvent() override; 0072 0073 const KFileItem &item() const 0074 { 0075 return m_item; 0076 } 0077 KParts::ReadOnlyPart *part() const 0078 { 0079 return m_part; 0080 } 0081 0082 static bool test(const QEvent *event); 0083 0084 private: 0085 #if QT_VERSION_MAJOR < 6 0086 Q_DISABLE_COPY(KonqFileMouseOverEvent) 0087 static const char *const s_fileItemMouseOverEventName; 0088 #endif 0089 0090 KFileItem m_item; 0091 KParts::ReadOnlyPart *m_part; 0092 }; 0093 0094 #endif