| 1 | /* |
| 2 | |
| 3 | This file is part of the KDE project, module kfile. |
| 4 | SPDX-FileCopyrightText: 2000 Geert Jansen <jansen@kde.org> |
| 5 | SPDX-FileCopyrightText: 2000 Kurt Granroth <granroth@kde.org> |
| 6 | SPDX-FileCopyrightText: 1997 Christoph Neerfeld <chris@kde.org> |
| 7 | SPDX-FileCopyrightText: 2002 Carsten Pfeiffer <pfeiffer@kde.org> |
| 8 | SPDX-FileCopyrightText: 2021 Kai Uwe Broulik <kde@broulik.de> |
| 9 | |
| 10 | SPDX-License-Identifier: LGPL-2.0-only |
| 11 | */ |
| 12 | |
| 13 | #ifndef KICONDIALOG_P_H |
| 14 | #define KICONDIALOG_P_H |
| 15 | |
| 16 | #include <QFileDialog> |
| 17 | #include <QPointer> |
| 18 | #include <QSortFilterProxyModel> |
| 19 | |
| 20 | #include <kiconloader.h> |
| 21 | |
| 22 | #include "kicondialogmodel_p.h" |
| 23 | |
| 24 | #include "ui_kicondialog.h" |
| 25 | |
| 26 | class QLabel; |
| 27 | class QPushButton; |
| 28 | |
| 29 | class KIconDialog; |
| 30 | class KIconDialogSortFilterProxyModel; |
| 31 | |
| 32 | class KIconDialogPrivate |
| 33 | { |
| 34 | public: |
| 35 | KIconDialogPrivate(KIconDialog *qq); |
| 36 | |
| 37 | void init(); |
| 38 | void showIcons(); |
| 39 | bool selectIcon(const QString &iconName); |
| 40 | void setContext(KIconLoader::Context context); |
| 41 | void updatePlaceholderLabel(); |
| 42 | |
| 43 | void browse(); |
| 44 | |
| 45 | bool isSystemIconsContext() const; |
| 46 | |
| 47 | KIconDialog *q; |
| 48 | |
| 49 | KIconLoader *mpLoader; |
| 50 | |
| 51 | KIconDialogModel *model; |
| 52 | KIconDialogSortFilterProxyModel *proxyModel; |
| 53 | |
| 54 | int mGroupOrSize; |
| 55 | KIconLoader::Context mContext; |
| 56 | |
| 57 | QLabel *placeholderLabel; |
| 58 | QPushButton *browseButton; |
| 59 | |
| 60 | QAction *filterSymbolicAction; |
| 61 | QActionGroup *filterSymbolicGroup; |
| 62 | |
| 63 | bool m_bStrictIconSize = true; |
| 64 | bool m_bLockUser = false; |
| 65 | bool m_bLockCustomDir = false; |
| 66 | QString custom; |
| 67 | QString customLocation; |
| 68 | QString pendingSelectedIcon; |
| 69 | QPointer<QFileDialog> browseDialog; |
| 70 | |
| 71 | Ui::IconDialog ui; |
| 72 | }; |
| 73 | |
| 74 | #endif // KICONDIALOG_P_H |
| 75 | |