1 /* -*- mode: c++; c-basic-offset:4 -*-
2     view/searchbar.h
3 
4     This file is part of Kleopatra, the KDE keymanager
5     SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB
6 
7     SPDX-License-Identifier: GPL-2.0-or-later
8 */
9 
10 #pragma once
11 
12 #include <QWidget>
13 
14 #include <utils/pimpl_ptr.h>
15 
16 #include <memory>
17 
18 class QLineEdit;
19 
20 namespace Kleo
21 {
22 
23 class KeyFilter;
24 
25 class SearchBar : public QWidget
26 {
27     Q_OBJECT
28 public:
29     explicit SearchBar(QWidget *parent = nullptr, Qt::WindowFlags f = {});
30     ~SearchBar() override;
31 
32     const std::shared_ptr<KeyFilter> &keyFilter() const;
33 
34     QLineEdit *lineEdit() const;
35 
36     void updateClickMessage(const QString &shortcutStr);
37 
38 public Q_SLOTS:
39     void setStringFilter(const QString &text);
40     void setKeyFilter(const std::shared_ptr<Kleo::KeyFilter> &filter);
41 
42     void setChangeStringFilterEnabled(bool enable);
43     void setChangeKeyFilterEnabled(bool enable);
44 
45 Q_SIGNALS:
46     void stringFilterChanged(const QString &text);
47     void keyFilterChanged(const std::shared_ptr<Kleo::KeyFilter> &filter);
48 
49 private:
50     class Private;
51     kdtools::pimpl_ptr<Private> d;
52     Q_PRIVATE_SLOT(d, void slotKeyFilterChanged(int))
53     Q_PRIVATE_SLOT(d, void listNotCertifiedKeys())
54     Q_PRIVATE_SLOT(d, void showOrHideCertifyButton())
55 };
56 
57 }
58 
59