| 1 | // Copyright (C) 2020 The Qt Company Ltd. |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QABSTRACTFILEICONPROVIDER_H |
| 5 | #define QABSTRACTFILEICONPROVIDER_H |
| 6 | |
| 7 | #include <QtGui/qtguiglobal.h> |
| 8 | #include <QtCore/qfileinfo.h> |
| 9 | #include <QtCore/qscopedpointer.h> |
| 10 | #include <QtGui/qicon.h> |
| 11 | |
| 12 | QT_BEGIN_NAMESPACE |
| 13 | |
| 14 | class QAbstractFileIconProviderPrivate; |
| 15 | |
| 16 | class Q_GUI_EXPORT QAbstractFileIconProvider |
| 17 | { |
| 18 | public: |
| 19 | enum IconType { Computer, Desktop, Trashcan, Network, Drive, Folder, File }; |
| 20 | enum Option { |
| 21 | DontUseCustomDirectoryIcons = 0x00000001 |
| 22 | }; |
| 23 | Q_DECLARE_FLAGS(Options, Option) |
| 24 | |
| 25 | QAbstractFileIconProvider(); |
| 26 | virtual ~QAbstractFileIconProvider(); |
| 27 | |
| 28 | virtual QIcon icon(IconType) const; |
| 29 | virtual QIcon icon(const QFileInfo &) const; |
| 30 | virtual QString type(const QFileInfo &) const; |
| 31 | |
| 32 | virtual void setOptions(Options); |
| 33 | virtual Options options() const; |
| 34 | |
| 35 | protected: |
| 36 | QAbstractFileIconProvider(QAbstractFileIconProviderPrivate &dd); |
| 37 | QScopedPointer<QAbstractFileIconProviderPrivate> d_ptr; |
| 38 | |
| 39 | private: |
| 40 | Q_DECLARE_PRIVATE(QAbstractFileIconProvider) |
| 41 | Q_DISABLE_COPY(QAbstractFileIconProvider) |
| 42 | }; |
| 43 | |
| 44 | Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractFileIconProvider::Options) |
| 45 | |
| 46 | QT_END_NAMESPACE |
| 47 | |
| 48 | #endif // QABSTRACTFILEICONPROVIDER_H |
| 49 |
