File indexing completed on 2024-04-14 04:35:09

0001 /*
0002     SPDX-FileCopyrightText: 2010 Sebastian Trueg <trueg@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #ifndef _BALOO_TAG_CHECKBOX_H_
0008 #define _BALOO_TAG_CHECKBOX_H_
0009 
0010 #include <QLabel>
0011 
0012 namespace Baloo
0013 {
0014 class TagCheckBox : public QLabel
0015 {
0016     Q_OBJECT
0017 
0018 public:
0019     explicit TagCheckBox(const QString &tag, QWidget *parent = nullptr);
0020     ~TagCheckBox() override;
0021 
0022     QString tag() const
0023     {
0024         return m_tag;
0025     }
0026 
0027 Q_SIGNALS:
0028     void tagClicked(const QString &tag);
0029 
0030 protected:
0031     bool eventFilter(QObject *watched, QEvent *event) override;
0032 
0033 private:
0034     void enableUrlHover(bool enabled);
0035 
0036     QString m_tag;
0037     bool m_urlHover = false;
0038 };
0039 }
0040 
0041 #endif