![]() |
LeechCraft
0.6.70-13729-g7046a9d2a7
Modular cross-platform feature rich live environment.
|
A helper class to aid connecting FindNotification with Qt WebKit. More...
#include "findnotificationwk.h"
Public Member Functions | |
FindNotificationWk (ICoreProxy_ptr proxy, QWebView *near) | |
Constructs the find notification using the given proxy and near widget. More... | |
![]() | |
FindNotification (ICoreProxy_ptr proxy, QWidget *near) | |
Creates the search widget in parent layout of near. More... | |
~FindNotification () | |
void | SetEscCloses (bool close) |
Sets whether Esc closes the widget. More... | |
void | SetText (const QString &text) |
Sets the text in the find field. More... | |
QString | GetText () const |
Returns the currently entered text in the find field. More... | |
void | SetSuccessful (bool successful) |
Updates the widget to show whether the search has been successful. More... | |
FindFlags | GetFlags () const |
Returns the current find flags except the direction. More... | |
![]() | |
PageNotification (QWidget *parent) | |
Creates the widget embedding into the parent layout of the parent widget. More... | |
Static Public Member Functions | |
static QWebPage::FindFlags | ToPageFlags (FindFlags findFlags) |
Converts the given findFlags to WebKit find flags. More... | |
Protected Member Functions | |
void | handleNext (const QString &text, FindFlags flags) override |
Called each time the user requests a search. More... | |
void | reject () override |
Additional Inherited Members | |
![]() | |
enum | FindFlag { FindNoFlags = 0x0, FindCaseSensitively = 0x1, FindBackwards = 0x2, FindWrapsAround = 0x4 } |
![]() | |
void | findNext () |
Search for the next occurrence of the search text. More... | |
void | findPrevious () |
Search for the previous occurrence of the search text. More... | |
void | clear () |
Clears the text in the find field. More... | |
![]() |
A helper class to aid connecting FindNotification with Qt WebKit.
This class is basically a FindNotification providing an utility function ToPageFlags() to convert FindNotification::FindFlags to QWebPage::FindFlags.
FindNotificationWk takes care of all the search-related things and automatically handles the QWebView passed to its constructor in its handleNext() implementation. So, using this class is as simple as just instantiating an object, passing the needed QWebView instance to its constructor.
Definition at line 56 of file findnotificationwk.h.
LC::Util::FindNotificationWk::FindNotificationWk | ( | ICoreProxy_ptr | proxy, |
QWebView * | near | ||
) |
Constructs the find notification using the given proxy and near widget.
[in] | proxy | The core proxy to be used by this find notification. |
[in] | near | The web view near which to embed. |
Definition at line 38 of file findnotificationwk.cpp.
|
overrideprotectedvirtual |
Called each time the user requests a search.
Reimplement this function to perform the actual search.
[in] | text | The text to search for. |
[in] | flags | The flags to search with. |
Implements LC::Util::FindNotification.
Definition at line 78 of file findnotificationwk.cpp.
References LC::Util::FindNotification::SetSuccessful(), and ToPageFlags().
|
overrideprotectedvirtual |
Reimplemented from LC::Util::FindNotification.
Definition at line 94 of file findnotificationwk.cpp.
References LC::Util::FindNotification::reject().
|
static |
Converts the given findFlags to WebKit find flags.
[in] | findFlags | The find flags in terms of FindNotification. |
Definition at line 58 of file findnotificationwk.cpp.
References LC::Util::FindNotification::FindBackwards, LC::Util::FindNotification::FindCaseSensitively, and LC::Util::FindNotification::FindWrapsAround.
Referenced by handleNext().