CFx SDK Documentation 2026 SP0
Loading...
Searching...
No Matches
CFxWebView Class Referenceabstract

#include <FxWebWidgetInterfaces.h>

Public Types

enum  FxWebAction {
  NoWebAction = -1 , Back , Forward , Stop ,
  Reload , Cut , Copy , Paste ,
  Undo , Redo , SelectAll , ReloadAndBypassCache ,
  PasteAndMatchStyle , OpenLinkInThisWindow , OpenLinkInNewWindow , OpenLinkInNewTab ,
  CopyLinkToClipboard , DownloadLinkToDisk , CopyImageToClipboard , CopyImageUrlToClipboard ,
  DownloadImageToDisk , CopyMediaUrlToClipboard , ToggleMediaControls , ToggleMediaLoop ,
  ToggleMediaPlayPause , ToggleMediaMute , DownloadMediaToDisk , InspectElement ,
  ExitFullScreen , RequestClose , Unselect , SavePage ,
  OpenLinkInNewBackgroundTab , ViewSource , WebActionCount
}
 
enum  FxFindFlag {
  FindBackward = 1 , FindCaseSensitively = 2 , FindWrapsAroundDocument = 4 , HighlightAllOccurrences = 8 ,
  FindAtWordBeginningsOnly = 16 , TreatMedialCapitalAsWordBeginning = 32 , FindBeginsInSelection = 64
}
 
enum  FxWebAttribute {
  AutoLoadImages , JavascriptEnabled , JavascriptCanOpenWindows , JavascriptCanAccessClipboard ,
  LinksIncludedInFocusChain , LocalStorageEnabled , LocalContentCanAccessRemoteUrls , XSSAuditingEnabled ,
  SpatialNavigationEnabled , LocalContentCanAccessFileUrls , HyperlinkAuditingEnabled , ScrollAnimatorEnabled ,
  ErrorPageEnabled , PluginsEnabled , FullScreenSupportEnabled , ScreenCaptureEnabled ,
  WebGLEnabled , Accelerated2dCanvasEnabled , AutoLoadIconsForPage , TouchIconsEnabled ,
  FocusOnNavigationEnabled , PrintElementBackgrounds , AllowRunningInsecureContent
}
 
enum  FxPersistentCookiesPolicy { NoPersistentCookies , AllowPersistentCookies , ForcePersistentCookies }
 

Public Member Functions

 CFxWebView (CFxWebWidgetManager *pManager)
 
virtual ~CFxWebView ()
 
virtual QWidget * GetWidget ()=0
 
virtual const QWidget * GetWidget () const =0
 
virtual void Load (const CFxString &sURL)
 
virtual void Load (const QString &sURL)=0
 
virtual void Load (const QUrl &url)=0
 
virtual void Load (const QNetworkRequest &request, QNetworkAccessManager::Operation operation=QNetworkAccessManager::GetOperation, const QByteArray &body=QByteArray())=0
 
virtual void SetHtml (const QString &html, const QUrl &baseUrl=QUrl())=0
 
virtual void SetContent (const QByteArray &data, const QString &sMimeType=QString(), const QUrl &baseUrl=QUrl())=0
 
virtual QString GetTitle () const =0
 
virtual void SetURL (const CFxString &sURL)
 
virtual void SetURL (const QUrl &url)=0
 
virtual void SetURL (const QString &sURL)=0
 
virtual QUrl GetURL () const =0
 
virtual QIcon GetIcon () const =0
 
virtual bool HasSelection () const =0
 
virtual QString GetSelectedText () const =0
 
virtual QAction * GetPageAction (FxWebAction eAction) const =0
 
virtual void TriggerPageAction (FxWebAction eAction, bool bChecked=false)=0
 
virtual double GetZoomFactor () const =0
 
virtual void SetZoomFactor (double dFactor)=0
 
virtual void FindText (const QString &subString, FxFindFlag options=(FxFindFlag) 0, const std::function< void(bool)> &resultCallback=std::function< void(bool)>())=0
 
virtual void SetDefaultUserAgentString (const QString &userAgentString)=0
 
virtual QString GetDefaultUserAgentString ()=0
 
virtual void DoStop ()=0
 
virtual void DoBack ()=0
 
virtual void DoForward ()=0
 
virtual void DoReload ()=0
 
virtual bool CanGoBack () const =0
 
virtual bool CanGoForward () const =0
 
virtual void SetSettingsAttribute (FxWebAttribute eAttribute, bool bEnable)=0
 
virtual void SetPersistentCookiesPolicyForDefaultProfile (FxPersistentCookiesPolicy ePolicy)=0
 
virtual void SetPersistCookies (bool bEnable)=0
 
virtual QObject * GetCookieStoreForDefaultProfile ()=0
 
virtual void SetCookieForDefaultProfile (QNetworkCookie *pCookie)=0
 
virtual void EvaluateJavascript (const QString &script)=0
 
virtual void LoadQWebChannel ()=0
 
virtual void ClearCookies ()=0
 
virtual bool ConnectToLinkClickedSignal (std::function< void(const QUrl &)> slot)=0
 
virtual bool ConnectToGeometryChangeRequestedSignal (std::function< void(const QRect &)> slot)=0
 
virtual bool ConnectToLoadFinishedSignal (std::function< void(bool)> slot)=0
 
virtual bool ConnectToLoadStartedSignal (std::function< void(void)> slot)=0
 
virtual bool ConnectToLoadProgressSignal (std::function< void(int progress)> slot)=0
 
virtual bool ConnectToContentsSizeChangedSignal (std::function< void(const QSizeF &)> slot)=0
 
virtual bool ConnectToUrlChangedSignal (std::function< void(const QUrl &)> slot)=0
 

Static Public Member Functions

static CFxWebViewCreate ()
 

Protected Attributes

CFxWebWidgetManager * m_pManager
 

Detailed Description

Description: The special wrapper for QWebView and QWebEngineView widgets. It prevents direct linkage to QWebKit/QWebEngine module and loads required modules on demand. QWebView/QWebEngineView widget can be created using CFxWebWidgetManager::GetManager()->CreateView() method. Library: DDKERNEL

Definition at line 46 of file FxWebWidgetInterfaces.h.

Member Enumeration Documentation

◆ FxFindFlag

Description: Wrapper for QWebPage::FindFlag enum

Enumerator
FindBackward 
FindCaseSensitively 
FindWrapsAroundDocument 
HighlightAllOccurrences 
FindAtWordBeginningsOnly 
TreatMedialCapitalAsWordBeginning 
FindBeginsInSelection 

Definition at line 111 of file FxWebWidgetInterfaces.h.

◆ FxPersistentCookiesPolicy

Description: Wrapper for QWebEngineProfile::PersistentCookiesPolicy enum

Enumerator
NoPersistentCookies 
AllowPersistentCookies 
ForcePersistentCookies 

Definition at line 155 of file FxWebWidgetInterfaces.h.

◆ FxWebAction

Description: Wrapper for QWebPage::WebAction enum

Enumerator
NoWebAction 
Back 
Forward 
Stop 
Reload 
Cut 
Copy 
Paste 
Undo 
Redo 
SelectAll 
ReloadAndBypassCache 
PasteAndMatchStyle 
OpenLinkInThisWindow 
OpenLinkInNewWindow 
OpenLinkInNewTab 
CopyLinkToClipboard 
DownloadLinkToDisk 
CopyImageToClipboard 
CopyImageUrlToClipboard 
DownloadImageToDisk 
CopyMediaUrlToClipboard 
ToggleMediaControls 
ToggleMediaLoop 
ToggleMediaPlayPause 
ToggleMediaMute 
DownloadMediaToDisk 
InspectElement 
ExitFullScreen 
RequestClose 
Unselect 
SavePage 
OpenLinkInNewBackgroundTab 
ViewSource 
WebActionCount 

Definition at line 62 of file FxWebWidgetInterfaces.h.

◆ FxWebAttribute

Description: Wrapper for QWebSettings::WebAttribute enum

Enumerator
AutoLoadImages 
JavascriptEnabled 
JavascriptCanOpenWindows 
JavascriptCanAccessClipboard 
LinksIncludedInFocusChain 
LocalStorageEnabled 
LocalContentCanAccessRemoteUrls 
XSSAuditingEnabled 
SpatialNavigationEnabled 
LocalContentCanAccessFileUrls 
HyperlinkAuditingEnabled 
ScrollAnimatorEnabled 
ErrorPageEnabled 
PluginsEnabled 
FullScreenSupportEnabled 
ScreenCaptureEnabled 
WebGLEnabled 
Accelerated2dCanvasEnabled 
AutoLoadIconsForPage 
TouchIconsEnabled 
FocusOnNavigationEnabled 
PrintElementBackgrounds 
AllowRunningInsecureContent 

Definition at line 125 of file FxWebWidgetInterfaces.h.

Constructor & Destructor Documentation

◆ CFxWebView()

CFxWebView::CFxWebView ( CFxWebWidgetManager * pManager)

◆ ~CFxWebView()

virtual CFxWebView::~CFxWebView ( )
virtual

Member Function Documentation

◆ CanGoBack()

virtual bool CFxWebView::CanGoBack ( ) const
pure virtual

Description: Returns true if there is an item preceding the current item in the history; otherwise returns false.

◆ CanGoForward()

virtual bool CFxWebView::CanGoForward ( ) const
pure virtual

Description: Returns true if we have an item to go forward to; otherwise returns false.

◆ ClearCookies()

virtual void CFxWebView::ClearCookies ( )
pure virtual

Description: Deletes all the cookies in the cookie store.

◆ ConnectToContentsSizeChangedSignal()

virtual bool CFxWebView::ConnectToContentsSizeChangedSignal ( std::function< void(const QSizeF &)> slot)
pure virtual

Description: Calls the provided callback when the size of the page contents changes.

◆ ConnectToGeometryChangeRequestedSignal()

virtual bool CFxWebView::ConnectToGeometryChangeRequestedSignal ( std::function< void(const QRect &)> slot)
pure virtual

Description: Calls the provided callback when the document wants to change the position and size of the page.

◆ ConnectToLinkClickedSignal()

virtual bool CFxWebView::ConnectToLinkClickedSignal ( std::function< void(const QUrl &)> slot)
pure virtual

Description: Calls the provided callback when a link was clicked.

◆ ConnectToLoadFinishedSignal()

virtual bool CFxWebView::ConnectToLoadFinishedSignal ( std::function< void(bool)> slot)
pure virtual

Description: Calls the provided callback when the page finishes loading content. The bool parameter will indicate whether the load was successful or any error occurred.

◆ ConnectToLoadProgressSignal()

virtual bool CFxWebView::ConnectToLoadProgressSignal ( std::function< void(int progress)> slot)
pure virtual

Description: Calls the provided callback when the global progress status changes. The current value is provided by progress and scales from 0 to 100.

◆ ConnectToLoadStartedSignal()

virtual bool CFxWebView::ConnectToLoadStartedSignal ( std::function< void(void)> slot)
pure virtual

Description: Calls the provided callback when a page starts loading content.

◆ ConnectToUrlChangedSignal()

virtual bool CFxWebView::ConnectToUrlChangedSignal ( std::function< void(const QUrl &)> slot)
pure virtual

Description: Calls the provided callback when the page URL is changed.

◆ Create()

static CFxWebView * CFxWebView::Create ( )
static

Description: Creates a new instance of CFxWebView The ownership is transfered to the caller

◆ DoBack()

virtual void CFxWebView::DoBack ( )
pure virtual

Description: Loads the previous document in the list of documents built by navigating links. Does nothing if there is no previous document.

◆ DoForward()

virtual void CFxWebView::DoForward ( )
pure virtual

Description: Loads the next document in the list of documents built by navigating links. Does nothing if there is no next document.

◆ DoReload()

virtual void CFxWebView::DoReload ( )
pure virtual

Description: Reloads the current document.

◆ DoStop()

virtual void CFxWebView::DoStop ( )
pure virtual

Description: Stops loading the document.

◆ EvaluateJavascript()

virtual void CFxWebView::EvaluateJavascript ( const QString & script)
pure virtual

Description: Runs the provided JavaScript code.

◆ FindText()

virtual void CFxWebView::FindText ( const QString & subString,
FxFindFlag options = (FxFindFlag) 0,
const std::function< void(bool)> & resultCallback = std::function< void(bool)>() )
pure virtual

Description: Finds the specified string, subString, in the page, using the given options. To clear the selection, just pass an empty string. resultCallback must take a boolean parameter.It will be called with a value of true if subString was found; otherwise the callback value will be false.

◆ GetCookieStoreForDefaultProfile()

virtual QObject * CFxWebView::GetCookieStoreForDefaultProfile ( )
pure virtual

Description: Returns the cookie store for the default profile.

◆ GetDefaultUserAgentString()

virtual QString CFxWebView::GetDefaultUserAgentString ( )
pure virtual

Description: Get default user agent string.

◆ GetIcon()

virtual QIcon CFxWebView::GetIcon ( ) const
pure virtual

Description: Returns the icon associated with the page currently viewed.

◆ GetPageAction()

virtual QAction * CFxWebView::GetPageAction ( FxWebAction eAction) const
pure virtual

Description: Returns a QAction for the specified FxWebAction action.

◆ GetSelectedText()

virtual QString CFxWebView::GetSelectedText ( ) const
pure virtual

Description: Returns the text currently selected.

◆ GetTitle()

virtual QString CFxWebView::GetTitle ( ) const
pure virtual

Description: Returns the title of the page as defined by the HTML <title> element.

◆ GetURL()

virtual QUrl CFxWebView::GetURL ( ) const
pure virtual

Description: Returns the URL of the web page currently viewed.

◆ GetWidget() [1/2]

virtual const QWidget * CFxWebView::GetWidget ( ) const
pure virtual

◆ GetWidget() [2/2]

virtual QWidget * CFxWebView::GetWidget ( )
pure virtual

Description: Returns a pointer to QWebView/QWebEngine widget

◆ GetZoomFactor()

virtual double CFxWebView::GetZoomFactor ( ) const
pure virtual

Description: Returns the zoom factor for the view. Valid values are within the range from 0.25 to 5.0. The default factor is 1.0.

◆ HasSelection()

virtual bool CFxWebView::HasSelection ( ) const
pure virtual

Description: Returns whether this page contains selected content or not.

◆ Load() [1/4]

virtual void CFxWebView::Load ( const CFxString & sURL)
virtual

Description: Methods of QWebView/QWebEngine interface: Description: Loads the specified url and displays it. Arguments:

Parameters
sURL

◆ Load() [2/4]

virtual void CFxWebView::Load ( const QNetworkRequest & request,
QNetworkAccessManager::Operation operation = QNetworkAccessManager::GetOperation,
const QByteArray & body = QByteArray() )
pure virtual

Description: Issues the specified request and loads the response. Supports Get and Post operations.

◆ Load() [3/4]

virtual void CFxWebView::Load ( const QString & sURL)
pure virtual

◆ Load() [4/4]

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

◆ LoadQWebChannel()

virtual void CFxWebView::LoadQWebChannel ( )
pure virtual

Description: Runs qtwebchannel/qwebchannel.js on the current page.

◆ SetContent()

virtual void CFxWebView::SetContent ( const QByteArray & data,
const QString & sMimeType = QString(),
const QUrl & baseUrl = QUrl() )
pure virtual

Description: Sets the content of the web view to data. If the mimeType argument is empty, it is assumed that the content is text/plain,charset=US-ASCII. External objects referenced in the content are located relative to baseUrl. For external objects to be loaded, baseUrl cannot be empty.

◆ SetCookieForDefaultProfile()

virtual void CFxWebView::SetCookieForDefaultProfile ( QNetworkCookie * pCookie)
pure virtual

Description: Adds cookie to the cookie store for the default profile.

◆ SetDefaultUserAgentString()

virtual void CFxWebView::SetDefaultUserAgentString ( const QString & userAgentString)
pure virtual

Description: Set default user agent string. If the passed user agent string is empty, the default user agent string is cleared and the sent string depends on the underlying implementation.

◆ SetHtml()

virtual void CFxWebView::SetHtml ( const QString & html,
const QUrl & baseUrl = QUrl() )
pure virtual

Description: Sets the content of the web view to the specified html content. External objects (stylesheets, images) referenced in the HTML document are located relative to baseUrl.

◆ SetPersistCookies()

virtual void CFxWebView::SetPersistCookies ( bool bEnable)
pure virtual

Description: Sets the policy for persistent cookies to ForcePersistentCookies

◆ SetPersistentCookiesPolicyForDefaultProfile()

virtual void CFxWebView::SetPersistentCookiesPolicyForDefaultProfile ( FxPersistentCookiesPolicy ePolicy)
pure virtual

Description: Sets the policy for persistent cookies for default profile to ePolicy.

◆ SetSettingsAttribute()

virtual void CFxWebView::SetSettingsAttribute ( FxWebAttribute eAttribute,
bool bEnable )
pure virtual

Description: Enables or disables the specified attribute feature depending on the value of bEnable.

◆ SetURL() [1/3]

virtual void CFxWebView::SetURL ( const CFxString & sURL)
virtual

Description: Loads the specified url and displays it. Emits urlChanged signal. Arguments:

Parameters
sURL

◆ SetURL() [2/3]

virtual void CFxWebView::SetURL ( const QString & sURL)
pure virtual

◆ SetURL() [3/3]

virtual void CFxWebView::SetURL ( const QUrl & url)
pure virtual

◆ SetZoomFactor()

virtual void CFxWebView::SetZoomFactor ( double dFactor)
pure virtual

Description: Sets the zoom factor for the view. Valid values are within the range from 0.25 to 5.0. The default factor is 1.0.

◆ TriggerPageAction()

virtual void CFxWebView::TriggerPageAction ( FxWebAction eAction,
bool bChecked = false )
pure virtual

Description: This function can be called to trigger the specified action. If action is a checkable action, then checked specifies whether the action is toggled or not.

Member Data Documentation

◆ m_pManager

CFxWebWidgetManager* CFxWebView::m_pManager
protected

Definition at line 368 of file FxWebWidgetInterfaces.h.


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