File indexing completed on 2024-03-24 15:32:58

0001 /* vi: ts=8 sts=4 sw=4
0002 
0003     This file is part of the KDE project, module kfile.
0004     SPDX-FileCopyrightText: 2000 Geert Jansen <jansen@kde.org>
0005     SPDX-FileCopyrightText: 2000 Kurt Granroth <granroth@kde.org>
0006     SPDX-FileCopyrightText: 1997 Christoph Neerfeld <chris@kde.org>
0007     SPDX-FileCopyrightText: 2002 Carsten Pfeiffer <pfeiffer@kde.org>
0008     SPDX-FileCopyrightText: 2021 Kai Uwe Broulik <kde@broulik.de>
0009 
0010     SPDX-License-Identifier: LGPL-2.0-only
0011 */
0012 
0013 #ifndef KICONDIALOG_P_H
0014 #define KICONDIALOG_P_H
0015 
0016 #include <QFileDialog>
0017 #include <QPointer>
0018 #include <QSortFilterProxyModel>
0019 
0020 #include "kicondialogmodel_p.h"
0021 
0022 #include "ui_kicondialog.h"
0023 
0024 class QLabel;
0025 class QPushButton;
0026 
0027 class KIconDialog;
0028 
0029 class KIconDialogPrivate
0030 {
0031 public:
0032     KIconDialogPrivate(KIconDialog *qq)
0033         : q(qq)
0034         , model(new KIconDialogModel(qq))
0035         , proxyModel(new QSortFilterProxyModel(qq))
0036     {
0037         proxyModel->setSourceModel(model);
0038         proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
0039     }
0040 
0041     void init();
0042     void showIcons();
0043     bool selectIcon(const QString &iconName);
0044     void setContext(KIconLoader::Context context);
0045     void updatePlaceholderLabel();
0046 
0047     void browse();
0048 
0049     bool isSystemIconsContext() const;
0050 
0051     KIconDialog *q;
0052 
0053     KIconDialogModel *model;
0054     QSortFilterProxyModel *proxyModel;
0055 
0056     int mGroupOrSize;
0057     KIconLoader::Context mContext;
0058 
0059     QLabel *placeholderLabel;
0060     QPushButton *browseButton;
0061 
0062     KIconLoader *mpLoader;
0063 
0064     bool m_bStrictIconSize = true;
0065     bool m_bLockUser = false;
0066     bool m_bLockCustomDir = false;
0067     QString custom;
0068     QString customLocation;
0069     QString pendingSelectedIcon;
0070     QPointer<QFileDialog> browseDialog;
0071 
0072     Ui::IconDialog ui;
0073 };
0074 
0075 #endif // KICONDIALOG_P_H