LeechCraft 0.6.70-18808-g3467692359
Modular cross-platform feature rich live environment.
Loading...
Searching...
No Matches
findnotification.h
Go to the documentation of this file.
1/**********************************************************************
2 * LeechCraft - modular cross-platform feature rich internet client.
3 * Copyright (C) 2006-2014 Georg Rudoy
4 *
5 * Distributed under the Boost Software License, Version 1.0.
6 * (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7 **********************************************************************/
8
9#pragma once
10
11#include <memory>
13#include "guiconfig.h"
14#include "pagenotification.h"
15
16class QShortcut;
17
18namespace Ui
19{
20 class FindNotification;
21}
22
23namespace LC::Util
24{
62 {
63 std::unique_ptr<Ui::FindNotification> Ui_;
64 QShortcut * const EscShortcut_;
65 public:
69 {
73
77
81
87 };
88 Q_DECLARE_FLAGS (FindFlags, FindFlag)
89
90
100 FindNotification (const ICoreProxy_ptr& proxy, QWidget *near);
101 ~FindNotification () override;
102
107 void SetEscCloses (bool close);
108
113 void SetFlags (FindFlags flags);
114
124 void SetText (const QString& text);
125
130 QString GetText () const;
131
137 void SetSuccessful (bool successful);
138
147 void FindNext ();
148
157 void FindPrevious ();
158
163 void Clear ();
164 private:
165 FindFlags GetDirectionlessFlags () const;
166 protected:
174 virtual void HandleNext (const QString& text, FindFlags flags) = 0;
175
176 virtual void Reject ();
177 };
178
179 Q_DECLARE_OPERATORS_FOR_FLAGS (FindNotification::FindFlags)
180}
A horizontal bar with typical widgets for text search.
void SetFlags(FindFlags flags)
Sets the flags and updates the widget visual state accordingly.
void SetEscCloses(bool close)
Sets whether Esc closes the widget.
void FindNext()
Search for the next occurrence of the search text.
virtual void HandleNext(const QString &text, FindFlags flags)=0
Called each time the user requests a search.
void SetText(const QString &text)
Sets the text in the find field.
void Clear()
Clears the text in the find field.
FindNotification(const ICoreProxy_ptr &proxy, QWidget *near)
Creates the search widget in parent layout of near.
void SetSuccessful(bool successful)
Updates the widget to show whether the search has been successful.
QString GetText() const
Returns the currently entered text in the find field.
void FindPrevious()
Search for the previous occurrence of the search text.
PageNotification(QWidget *parent)
Creates the widget embedding into the parent layout of the parent widget.
#define UTIL_GUI_API
Definition guiconfig.h:16
std::shared_ptr< ICoreProxy > ICoreProxy_ptr
Definition icoreproxy.h:177
Q_DECLARE_FLAGS(FitFlags, FitFlag)