LeechCraft  0.6.70-15082-g543737046d
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 (const 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 (const ICoreProxy_ptr &proxy, QWidget *near)
 Creates the search widget in parent layout of near. More...
 
 ~FindNotification () override
 
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...
 
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...
 
- 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 findFlags) 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
}
 

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 38 of file findnotificationwk.h.

Constructor & Destructor Documentation

◆ FindNotificationWk()

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

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 58 of file findnotificationwk.h.

Member Function Documentation

◆ HandleNext()

void LC::Util::FindNotificationWk::HandleNext ( const QString &  text,
FindFlags  flags 
)
inlineoverrideprotectedvirtual

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 101 of file findnotificationwk.h.

◆ Reject()

void LC::Util::FindNotificationWk::Reject ( )
inlineoverrideprotectedvirtual

Reimplemented from LC::Util::FindNotification.

Definition at line 117 of file findnotificationwk.h.

◆ ToPageFlags()

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

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 81 of file findnotificationwk.h.


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