LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
IWebWidget Class Referenceabstract

Common interface for a web widget. More...

#include "iwebbrowser.h"

Public Member Functions

virtual ~IWebWidget ()=default
 
virtual void Load (const QUrl &url)=0
 Loads a given url. More...
 
virtual void SetHtml (const QString &html, const QUrl &base={})=0
 Sets the contents of the web widget to the specified html. More...
 
virtual void SetNavBarVisible (bool visible)=0
 Sets whether the navigation bar of the widget (where the address bar and reload/back/forward/etc buttons are) is visible. More...
 
virtual void SetEverythingElseVisible (bool visible)=0
 Shows or hides every other panel in the browser but navbar. More...
 
virtual QWidget * GetQWidget ()=0
 Returns the IWebWidget as a QWidget. More...
 
virtual void urlChanged (const QUrl &)=0
 Emitted when the URL rendered by the browser changes to @url. More...
 

Detailed Description

Common interface for a web widget.

A widget that is capable of showing/rendering web pages should implement this interface in order to communicate with other modules of LeechCraft.

Definition at line 23 of file iwebbrowser.h.

Constructor & Destructor Documentation

◆ ~IWebWidget()

virtual IWebWidget::~IWebWidget ( )
virtualdefault

Member Function Documentation

◆ GetQWidget()

virtual QWidget* IWebWidget::GetQWidget ( )
pure virtual

Returns the IWebWidget as a QWidget.

Returns
A widget corresponding to this IWebWidget.

◆ Load()

virtual void IWebWidget::Load ( const QUrl &  url)
pure virtual

Loads a given url.

The url should be UTF8-encoded.

Parameters
[in]urlThe url of the resource.

◆ SetEverythingElseVisible()

virtual void IWebWidget::SetEverythingElseVisible ( bool  visible)
pure virtual

Shows or hides every other panel in the browser but navbar.

If the IWebBrowser implementation has additional panels, toolbars, sidebars and similar stuff, it should be set visible according to the visible parameter.

Parameters
[in]visibleWhether additional stuff should be visible.

◆ SetHtml()

virtual void IWebWidget::SetHtml ( const QString &  html,
const QUrl &  base = {} 
)
pure virtual

Sets the contents of the web widget to the specified html.

External objects such as stylesheets or images referenced in the HTML document are located relative to the base.

Parameters
[in]htmlThe HTML with the new contents.
[in]baseBase address for resolution of external elements.

◆ SetNavBarVisible()

virtual void IWebWidget::SetNavBarVisible ( bool  visible)
pure virtual

Sets whether the navigation bar of the widget (where the address bar and reload/back/forward/etc buttons are) is visible.

If the widget doesn't have such bar this function does nothing.

Parameters
[in]visibleWhether to show or hide the navbar.

◆ urlChanged()

virtual void IWebWidget::urlChanged ( const QUrl &  )
pure virtual

Emitted when the URL rendered by the browser changes to @url.

Parameters
[out]urlThe new URL that the browser renders.

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