LeechCraft  0.6.70-13729-g7046a9d2a7
Modular cross-platform feature rich live environment.
LC::Util::FindNotificationWk Class Reference

A helper class to aid connecting FindNotification with Qt WebKit. More...

#include "findnotificationwk.h"

+ Inheritance diagram for LC::Util::FindNotificationWk:
+ Collaboration diagram for LC::Util::FindNotificationWk:

Public Member Functions

 FindNotificationWk (ICoreProxy_ptr proxy, QWebView *near)
 Constructs the find notification using the given proxy and near widget. More...
 
- Public Member Functions inherited from LC::Util::FindNotification
 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...
 
- Public Member Functions inherited from LC::Util::PageNotification
 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

- Public Types inherited from LC::Util::FindNotification
enum  FindFlag {
  FindNoFlags = 0x0,
  FindCaseSensitively = 0x1,
  FindBackwards = 0x2,
  FindWrapsAround = 0x4
}
 
- Public Slots inherited from LC::Util::FindNotification
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...
 
- Protected Slots inherited from LC::Util::FindNotification

Detailed Description

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.

Constructor & Destructor Documentation

◆ FindNotificationWk()

LC::Util::FindNotificationWk::FindNotificationWk ( ICoreProxy_ptr  proxy,
QWebView *  near 
)

Constructs the find notification using the given proxy and near widget.

Parameters
[in]proxyThe core proxy to be used by this find notification.
[in]nearThe web view near which to embed.
See also
FindNotification

Definition at line 38 of file findnotificationwk.cpp.

Member Function Documentation

◆ handleNext()

void LC::Util::FindNotificationWk::handleNext ( const QString &  text,
FindFlags  flags 
)
overrideprotectedvirtual

Called each time the user requests a search.

Reimplement this function to perform the actual search.

Parameters
[in]textThe text to search for.
[in]flagsThe flags to search with.

Implements LC::Util::FindNotification.

Definition at line 78 of file findnotificationwk.cpp.

References LC::Util::FindNotification::SetSuccessful(), and ToPageFlags().

+ Here is the call graph for this function:

◆ reject()

void LC::Util::FindNotificationWk::reject ( )
overrideprotectedvirtual

Reimplemented from LC::Util::FindNotification.

Definition at line 94 of file findnotificationwk.cpp.

References LC::Util::FindNotification::reject().

+ Here is the call graph for this function:

◆ ToPageFlags()

QWebPage::FindFlags LC::Util::FindNotificationWk::ToPageFlags ( FindFlags  findFlags)
static

Converts the given findFlags to WebKit find flags.

Parameters
[in]findFlagsThe find flags in terms of FindNotification.
Returns
The find flags in terms of WebKit.

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().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: