File indexing completed on 2024-04-28 15:51:55

0001 /*
0002     SPDX-FileCopyrightText: 2007 Pino Toscano <pino@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef _OKULAR_PRESENTATIONSEARCHBAR_H_
0008 #define _OKULAR_PRESENTATIONSEARCHBAR_H_
0009 
0010 #include <qwidget.h>
0011 
0012 class SearchLineEdit;
0013 
0014 namespace Okular
0015 {
0016 class Document;
0017 }
0018 
0019 class PresentationSearchBar : public QWidget
0020 {
0021     Q_OBJECT
0022 
0023 public:
0024     PresentationSearchBar(Okular::Document *document, QWidget *anchor, QWidget *parent = nullptr);
0025     ~PresentationSearchBar() override;
0026 
0027     void forceSnap();
0028     void focusOnSearchEdit();
0029 
0030 protected:
0031     void resizeEvent(QResizeEvent *) override;
0032     bool eventFilter(QObject *, QEvent *) override;
0033 
0034 private:
0035     QWidget *m_handle;
0036     QWidget *m_anchor;
0037     QPoint m_point;
0038     bool m_snapped;
0039     QPoint m_drag;
0040 
0041     SearchLineEdit *m_search;
0042 };
0043 
0044 #endif