File indexing completed on 2024-06-23 05:14:23

0001 /* -*- mode: c++; c-basic-offset:4 -*-
0002     view/searchbar.h
0003 
0004     This file is part of Kleopatra, the KDE keymanager
0005     SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 #pragma once
0011 
0012 #include <QWidget>
0013 
0014 #include <utils/pimpl_ptr.h>
0015 
0016 #include <memory>
0017 
0018 class QLineEdit;
0019 
0020 namespace Kleo
0021 {
0022 
0023 class KeyFilter;
0024 
0025 class SearchBar : public QWidget
0026 {
0027     Q_OBJECT
0028 public:
0029     explicit SearchBar(QWidget *parent = nullptr, Qt::WindowFlags f = {});
0030     ~SearchBar() override;
0031 
0032     const std::shared_ptr<KeyFilter> &keyFilter() const;
0033 
0034     QLineEdit *lineEdit() const;
0035 
0036     void updateClickMessage(const QString &shortcutStr);
0037 
0038 public Q_SLOTS:
0039     void setStringFilter(const QString &text);
0040     void setKeyFilter(const std::shared_ptr<Kleo::KeyFilter> &filter);
0041 
0042     void setChangeStringFilterEnabled(bool enable);
0043     void setChangeKeyFilterEnabled(bool enable);
0044 
0045 Q_SIGNALS:
0046     void stringFilterChanged(const QString &text);
0047     void keyFilterChanged(const std::shared_ptr<Kleo::KeyFilter> &filter);
0048 
0049 private:
0050     class Private;
0051     kdtools::pimpl_ptr<Private> d;
0052     Q_PRIVATE_SLOT(d, void showOrHideCertifyButton())
0053 };
0054 
0055 }