Warning, file /libraries/baloo-widgets/src/tagcheckbox.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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 <QWidget>
0011 
0012 #include "tagwidget_p.h"
0013 
0014 class QMouseEvent;
0015 class QLabel;
0016 
0017 namespace Baloo
0018 {
0019 class TagCheckBox : public QWidget
0020 {
0021     Q_OBJECT
0022 
0023 public:
0024     explicit TagCheckBox(const QString &tag, QWidget *parent = nullptr);
0025     ~TagCheckBox() override;
0026 
0027     QString tag() const
0028     {
0029         return m_tag;
0030     }
0031 
0032 Q_SIGNALS:
0033     void tagClicked(const QString &tag);
0034 
0035 protected:
0036     void leaveEvent(QEvent *event) override;
0037     bool eventFilter(QObject *watched, QEvent *event) override;
0038 
0039 private:
0040     QRect tagRect() const;
0041     void enableUrlHover(bool enabled);
0042 
0043     // two modes: checkbox and simple label
0044     QLabel *m_label = nullptr;
0045     QWidget *m_child = nullptr;
0046 
0047     QString m_tag;
0048     bool m_urlHover = false;
0049 };
0050 }
0051 
0052 #endif