LeechCraft 0.6.70-16373-g319c272718
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
118 void SetText (const QString& text);
119
124 QString GetText () const;
125
131 void SetSuccessful (bool successful);
132
140 FindFlags GetFlags () const;
141
150 void FindNext ();
151
160 void FindPrevious ();
161
166 void Clear ();
167 protected:
175 virtual void HandleNext (const QString& text, FindFlags flags) = 0;
176
177 virtual void Reject ();
178 };
179}
A horizontal bar with typical widgets for text search.
FindFlags GetFlags() const
Returns the current find flags except the direction.
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:181
Q_DECLARE_FLAGS(FitFlags, FitFlag)