|
RADLib
RADical C++ application framework
|
WebKitGTK-backed browser window with tabs, history, downloads, and settings. More...
#include <RADWeb.h>
Inheritance diagram for RADWeb::RADWebBrowserWindow:
Collaboration diagram for RADWeb::RADWebBrowserWindow:Public Member Functions | |
| RADWebBrowserWindow () | |
| Creates an uninitialized browser window wrapper. More... | |
| ~RADWebBrowserWindow () override | |
| Destroys the browser window and native resources. More... | |
| void | setProfileDirectory (const std::string &directory) |
| Sets the persistent profile directory before create(). More... | |
| const std::string & | profileDirectory () const |
| Returns the configured profile directory. More... | |
| void | setEphemeralProfile (bool enabled) |
| Enables or disables ephemeral profile mode before create(). More... | |
| bool | ephemeralProfile () const |
| Returns true when using an ephemeral profile. More... | |
| bool | create (int width=1200, int height=800, const std::string &title="RADWeb Browser") |
| Creates the browser window with basic dimensions and title. More... | |
| bool | create (const RADWebWindowOptions &options) |
| Creates the browser window from a full options struct. More... | |
| bool | isCreated () const |
| Returns true once native WebKit/GTK objects are created. More... | |
| void | setNavigationBarVisible (bool visible) |
| Shows or hides the built-in navigation bar. More... | |
| bool | navigationBarVisible () const |
| Returns true when the navigation bar is visible. More... | |
| int | newTab (const std::string &url="about:blank", bool makeActive=true) |
| Opens url in a new tab and returns the tab id. More... | |
| bool | closeTab (int index) |
| Closes the tab at index. More... | |
| bool | duplicateTab (int index, bool makeActive=true) |
| Duplicates the tab at index. More... | |
| bool | moveTab (int fromIndex, int toIndex) |
| Moves a tab from one index to another. More... | |
| int | tabCount () const |
| Returns the number of open tabs. More... | |
| int | activeTabIndex () const |
| Returns the active tab index. More... | |
| RADWebTabInfo | activeTab () const |
| Returns a snapshot of the active tab. More... | |
| std::vector< RADWebTabInfo > | tabs () const |
| Returns snapshots of all tabs. More... | |
| bool | setActiveTab (int index) |
| Activates the tab at index. More... | |
| void | loadUrl (const std::string &url) |
| Loads url in the active tab. More... | |
| void | loadUrl (int tabIndex, const std::string &url) |
| Loads url in a specific tab. More... | |
| void | loadHtml (const std::string &html, const std::string &baseUri="about:blank") |
| Loads HTML into the active tab using baseUri for relative resources. More... | |
| void | evaluateJavaScript (const std::string &script) |
| Evaluates JavaScript in the active tab. More... | |
| void | show () |
| Shows the native browser window. More... | |
| void | close () |
| Closes the browser window. More... | |
| void | run () |
| Runs the GTK/WebKit event loop. More... | |
| void | quit () |
| Quits the GTK/WebKit event loop. More... | |
| bool | canGoBack () const |
| Returns true when the active tab can go back. More... | |
| bool | canGoForward () const |
| Returns true when the active tab can go forward. More... | |
| void | goBack () |
| Navigates the active tab backward. More... | |
| void | goForward () |
| Navigates the active tab forward. More... | |
| void | reload () |
| Reloads the active tab. More... | |
| void | stop () |
| Stops loading the active tab. More... | |
| void | focusUrlEntry () |
| Focuses the built-in URL entry. More... | |
| void | focusFindEntry () |
| Focuses the built-in find entry. More... | |
| void | showHistory () |
| Opens the history pane. More... | |
| void | showDownloads () |
| Opens the downloads pane. More... | |
| void | showBookmarks () |
| Opens the bookmarks pane. More... | |
| void | showSettings () |
| Opens the settings pane. More... | |
| void | showDevTools () |
| Opens WebKit developer tools for the active tab. More... | |
| void | setZoomLevel (double zoomLevel) |
| Sets active tab zoom level. More... | |
| double | zoomLevel () const |
| Returns active tab zoom level. More... | |
| void | searchText (const std::string &text, bool caseSensitive=false, bool wrap=true, unsigned maxMatchCount=1000) |
| Starts text search in the active page. More... | |
| void | searchNext () |
| Moves to the next search result. More... | |
| void | searchPrevious () |
| Moves to the previous search result. More... | |
| void | clearSearch () |
| Clears active search highlighting. More... | |
| void | setJavaScriptEnabled (bool enabled) |
| Enables or disables JavaScript. More... | |
| void | setImagesEnabled (bool enabled) |
| Enables or disables image loading. More... | |
| void | setDeveloperExtrasEnabled (bool enabled) |
| Enables or disables developer extras. More... | |
| void | setWebGlEnabled (bool enabled) |
| Enables or disables WebGL. More... | |
| void | setMediaPlaybackRequiresUserGesture (bool required) |
| Sets whether media playback requires user gesture. More... | |
| void | setHardwareAccelerationEnabled (bool enabled) |
| Enables or disables hardware acceleration requests. More... | |
| RADWebSettings | settings () const |
| Returns current browser settings. More... | |
| void | applySettings (const RADWebSettings &settings) |
| Applies settings to the browser/profile. More... | |
| void | setDownloadsDirectory (const std::string &directory) |
| Sets directory for future downloads. More... | |
| const std::string & | downloadsDirectory () const |
| Returns downloads directory. More... | |
| void | setPermissionPolicy (RADWebPermissionPolicy policy) |
| Sets default permission request policy. More... | |
| RADWebPermissionPolicy | permissionPolicy () const |
| Returns default permission request policy. More... | |
| void | rememberPermissionDecision (const std::string &origin, const std::string &permission, bool allowed) |
| Remembers an origin-specific permission decision. More... | |
| void | clearPermissionDecisions () |
| Clears remembered permission decisions. More... | |
| void | setCookiePolicy (RADWebCookiePolicy policy) |
| Sets WebKit cookie policy. More... | |
| RADWebCookiePolicy | cookiePolicy () const |
| Returns WebKit cookie policy. More... | |
| void | clearCookies () |
| Deletes cookies for the active profile. More... | |
| void | clearCache () |
| Clears WebKit cache data. More... | |
| void | setSessionRestoreEnabled (bool enabled) |
| Enables or disables session restore. More... | |
| bool | sessionRestoreEnabled () const |
| Returns true when session restore is enabled. More... | |
| bool | saveSession () |
| Saves current window tabs/session state. More... | |
| bool | restoreSession () |
| Restores previously saved session state. More... | |
| std::vector< RADWebHistoryItem > | history (size_t limit=100) const |
| Returns most recent history items up to limit. More... | |
| void | clearHistory () |
| Deletes all stored history. More... | |
| bool | addBookmark (const std::string &url, const std::string &title={}) |
| Adds a bookmark for url and optional title. More... | |
| bool | removeBookmark (int64_t id) |
| Removes a bookmark by id. More... | |
| std::vector< RADWebBookmark > | bookmarks () const |
| Returns all bookmarks. More... | |
| std::vector< RADWebDownloadInfo > | downloads (size_t limit=100) const |
| Returns recent downloads up to limit. More... | |
| bool | cancelDownload (int id) |
| Cancels an active download by id. More... | |
| bool | openDownload (int id) |
| Opens a downloaded file by id. More... | |
| bool | openDownloadsDirectory () |
| Opens the downloads directory in the system file manager. More... | |
| void | clearCompletedDownloads () |
| Removes completed downloads from the visible/download history list. More... | |
| std::string | uri () const |
| Returns current active tab URI. More... | |
| std::string | title () const |
| Returns current active tab title. More... | |
| void * | nativeWindow () const |
| Returns the native GTK window pointer for advanced integration. More... | |
| void * | nativeWebView () const |
| Returns the native WebKit web view pointer for advanced integration. More... | |
Public Member Functions inherited from RADCore::RADObject | |
| RADObject () | |
| Creates a RADObject bound to the current thread. More... | |
| virtual | ~RADObject () |
| Disconnects tracked event links and releases lifetime token. More... | |
| void | registerLink (const ConnectionRecord &record) |
| Registers a connection for cleanup when this object is destroyed. More... | |
| std::thread::id | threadId () const |
| Returns the thread id this object is currently associated with. More... | |
| EventLoop * | associatedEventLoop () const |
| Returns the associated event loop, if any. More... | |
| ThreadAffinity | threadAffinity () const |
| Returns both thread id and associated loop atomically. More... | |
| std::weak_ptr< void > | lifetimeToken () const |
| Returns a weak token used to drop queued callbacks after destruction. More... | |
| void | moveToThread (std::thread::id tId, EventLoop *loop=nullptr) |
| Moves the object's affinity to tId and optional loop. More... | |
Public Attributes | |
| RADCore::Event< void(std::string) > | loadStarted |
| Raised when the active tab starts loading url. More... | |
| RADCore::Event< void(std::string) > | loadFinished |
| Raised when the active tab finishes loading url. More... | |
| RADCore::Event< void(std::string, std::string) > | loadFailed |
| Raised with url and message when a load fails. More... | |
| RADCore::Event< void(std::string) > | titleChanged |
| Raised when active tab title changes. More... | |
| RADCore::Event< void(std::string) > | uriChanged |
| Raised when active tab URI changes. More... | |
| RADCore::Event< void(std::string) > | javaScriptFinished |
| Raised with result text when JavaScript evaluation succeeds. More... | |
| RADCore::Event< void(std::string) > | javaScriptFailed |
| Raised with message when JavaScript evaluation fails. More... | |
| RADCore::Event< void(std::string) > | errorOccurred |
| Raised for browser-level setup/runtime errors. More... | |
| RADCore::Event< void(int) > | tabAdded |
| Raised with tab id when a tab is added. More... | |
| RADCore::Event< void(int) > | tabClosed |
| Raised with tab id when a tab is closed. More... | |
| RADCore::Event< void(int) > | activeTabChanged |
| Raised with tab index when the active tab changes. More... | |
| RADCore::Event< void(RADWeb::RADWebDownloadInfo) > | downloadStarted |
| Raised when a download starts. More... | |
| RADCore::Event< void(RADWeb::RADWebDownloadInfo) > | downloadUpdated |
| Raised as download progress changes. More... | |
| RADCore::Event< void(RADWeb::RADWebDownloadInfo) > | downloadFinished |
| Raised when a download finishes. More... | |
| RADCore::Event< void(int, std::string) > | downloadFailed |
| Raised with id and message when a download fails. More... | |
| RADCore::Event< void(std::string, std::string) > | permissionRequested |
| Raised with origin and permission name when user policy is needed. More... | |
| RADCore::Event< void() > | historyChanged |
| Raised when history entries change. More... | |
| RADCore::Event< void() > | bookmarksChanged |
| Raised when bookmarks change. More... | |
| RADCore::Event< void() > | closed |
| Raised when the window closes. More... | |
WebKitGTK-backed browser window with tabs, history, downloads, and settings.
| RADWeb::RADWebBrowserWindow::RADWebBrowserWindow | ( | ) |
Creates an uninitialized browser window wrapper.
|
override |
Destroys the browser window and native resources.
| RADWebTabInfo RADWeb::RADWebBrowserWindow::activeTab | ( | ) | const |
Returns a snapshot of the active tab.
| int RADWeb::RADWebBrowserWindow::activeTabIndex | ( | ) | const |
Returns the active tab index.
| bool RADWeb::RADWebBrowserWindow::addBookmark | ( | const std::string & | url, |
| const std::string & | title = {} |
||
| ) |
Adds a bookmark for url and optional title.
| void RADWeb::RADWebBrowserWindow::applySettings | ( | const RADWebSettings & | settings | ) |
Applies settings to the browser/profile.
| std::vector<RADWebBookmark> RADWeb::RADWebBrowserWindow::bookmarks | ( | ) | const |
Returns all bookmarks.
| bool RADWeb::RADWebBrowserWindow::cancelDownload | ( | int | id | ) |
Cancels an active download by id.
| bool RADWeb::RADWebBrowserWindow::canGoBack | ( | ) | const |
Returns true when the active tab can go back.
| bool RADWeb::RADWebBrowserWindow::canGoForward | ( | ) | const |
Returns true when the active tab can go forward.
| void RADWeb::RADWebBrowserWindow::clearCache | ( | ) |
Clears WebKit cache data.
| void RADWeb::RADWebBrowserWindow::clearCompletedDownloads | ( | ) |
Removes completed downloads from the visible/download history list.
| void RADWeb::RADWebBrowserWindow::clearCookies | ( | ) |
Deletes cookies for the active profile.
| void RADWeb::RADWebBrowserWindow::clearHistory | ( | ) |
Deletes all stored history.
| void RADWeb::RADWebBrowserWindow::clearPermissionDecisions | ( | ) |
Clears remembered permission decisions.
| void RADWeb::RADWebBrowserWindow::clearSearch | ( | ) |
Clears active search highlighting.
| void RADWeb::RADWebBrowserWindow::close | ( | ) |
Closes the browser window.
| bool RADWeb::RADWebBrowserWindow::closeTab | ( | int | index | ) |
Closes the tab at index.
| RADWebCookiePolicy RADWeb::RADWebBrowserWindow::cookiePolicy | ( | ) | const |
Returns WebKit cookie policy.
| bool RADWeb::RADWebBrowserWindow::create | ( | const RADWebWindowOptions & | options | ) |
Creates the browser window from a full options struct.
| bool RADWeb::RADWebBrowserWindow::create | ( | int | width = 1200, |
| int | height = 800, |
||
| const std::string & | title = "RADWeb Browser" |
||
| ) |
Creates the browser window with basic dimensions and title.
| std::vector<RADWebDownloadInfo> RADWeb::RADWebBrowserWindow::downloads | ( | size_t | limit = 100 | ) | const |
Returns recent downloads up to limit.
| const std::string& RADWeb::RADWebBrowserWindow::downloadsDirectory | ( | ) | const |
Returns downloads directory.
| bool RADWeb::RADWebBrowserWindow::duplicateTab | ( | int | index, |
| bool | makeActive = true |
||
| ) |
Duplicates the tab at index.
| bool RADWeb::RADWebBrowserWindow::ephemeralProfile | ( | ) | const |
Returns true when using an ephemeral profile.
| void RADWeb::RADWebBrowserWindow::evaluateJavaScript | ( | const std::string & | script | ) |
Evaluates JavaScript in the active tab.
| void RADWeb::RADWebBrowserWindow::focusFindEntry | ( | ) |
Focuses the built-in find entry.
| void RADWeb::RADWebBrowserWindow::focusUrlEntry | ( | ) |
Focuses the built-in URL entry.
| void RADWeb::RADWebBrowserWindow::goBack | ( | ) |
Navigates the active tab backward.
| void RADWeb::RADWebBrowserWindow::goForward | ( | ) |
Navigates the active tab forward.
| std::vector<RADWebHistoryItem> RADWeb::RADWebBrowserWindow::history | ( | size_t | limit = 100 | ) | const |
Returns most recent history items up to limit.
| bool RADWeb::RADWebBrowserWindow::isCreated | ( | ) | const |
Returns true once native WebKit/GTK objects are created.
| void RADWeb::RADWebBrowserWindow::loadHtml | ( | const std::string & | html, |
| const std::string & | baseUri = "about:blank" |
||
| ) |
Loads HTML into the active tab using baseUri for relative resources.
| void RADWeb::RADWebBrowserWindow::loadUrl | ( | const std::string & | url | ) |
Loads url in the active tab.
| void RADWeb::RADWebBrowserWindow::loadUrl | ( | int | tabIndex, |
| const std::string & | url | ||
| ) |
Loads url in a specific tab.
| bool RADWeb::RADWebBrowserWindow::moveTab | ( | int | fromIndex, |
| int | toIndex | ||
| ) |
Moves a tab from one index to another.
| void* RADWeb::RADWebBrowserWindow::nativeWebView | ( | ) | const |
Returns the native WebKit web view pointer for advanced integration.
| void* RADWeb::RADWebBrowserWindow::nativeWindow | ( | ) | const |
Returns the native GTK window pointer for advanced integration.
| bool RADWeb::RADWebBrowserWindow::navigationBarVisible | ( | ) | const |
Returns true when the navigation bar is visible.
| int RADWeb::RADWebBrowserWindow::newTab | ( | const std::string & | url = "about:blank", |
| bool | makeActive = true |
||
| ) |
Opens url in a new tab and returns the tab id.
| bool RADWeb::RADWebBrowserWindow::openDownload | ( | int | id | ) |
Opens a downloaded file by id.
| bool RADWeb::RADWebBrowserWindow::openDownloadsDirectory | ( | ) |
Opens the downloads directory in the system file manager.
| RADWebPermissionPolicy RADWeb::RADWebBrowserWindow::permissionPolicy | ( | ) | const |
Returns default permission request policy.
| const std::string& RADWeb::RADWebBrowserWindow::profileDirectory | ( | ) | const |
Returns the configured profile directory.
| void RADWeb::RADWebBrowserWindow::quit | ( | ) |
Quits the GTK/WebKit event loop.
| void RADWeb::RADWebBrowserWindow::reload | ( | ) |
Reloads the active tab.
| void RADWeb::RADWebBrowserWindow::rememberPermissionDecision | ( | const std::string & | origin, |
| const std::string & | permission, | ||
| bool | allowed | ||
| ) |
Remembers an origin-specific permission decision.
| bool RADWeb::RADWebBrowserWindow::removeBookmark | ( | int64_t | id | ) |
Removes a bookmark by id.
| bool RADWeb::RADWebBrowserWindow::restoreSession | ( | ) |
Restores previously saved session state.
| void RADWeb::RADWebBrowserWindow::run | ( | ) |
Runs the GTK/WebKit event loop.
| bool RADWeb::RADWebBrowserWindow::saveSession | ( | ) |
Saves current window tabs/session state.
| void RADWeb::RADWebBrowserWindow::searchNext | ( | ) |
Moves to the next search result.
| void RADWeb::RADWebBrowserWindow::searchPrevious | ( | ) |
Moves to the previous search result.
| void RADWeb::RADWebBrowserWindow::searchText | ( | const std::string & | text, |
| bool | caseSensitive = false, |
||
| bool | wrap = true, |
||
| unsigned | maxMatchCount = 1000 |
||
| ) |
Starts text search in the active page.
| bool RADWeb::RADWebBrowserWindow::sessionRestoreEnabled | ( | ) | const |
Returns true when session restore is enabled.
| bool RADWeb::RADWebBrowserWindow::setActiveTab | ( | int | index | ) |
Activates the tab at index.
| void RADWeb::RADWebBrowserWindow::setCookiePolicy | ( | RADWebCookiePolicy | policy | ) |
Sets WebKit cookie policy.
| void RADWeb::RADWebBrowserWindow::setDeveloperExtrasEnabled | ( | bool | enabled | ) |
Enables or disables developer extras.
| void RADWeb::RADWebBrowserWindow::setDownloadsDirectory | ( | const std::string & | directory | ) |
Sets directory for future downloads.
| void RADWeb::RADWebBrowserWindow::setEphemeralProfile | ( | bool | enabled | ) |
Enables or disables ephemeral profile mode before create().
| void RADWeb::RADWebBrowserWindow::setHardwareAccelerationEnabled | ( | bool | enabled | ) |
Enables or disables hardware acceleration requests.
| void RADWeb::RADWebBrowserWindow::setImagesEnabled | ( | bool | enabled | ) |
Enables or disables image loading.
| void RADWeb::RADWebBrowserWindow::setJavaScriptEnabled | ( | bool | enabled | ) |
Enables or disables JavaScript.
| void RADWeb::RADWebBrowserWindow::setMediaPlaybackRequiresUserGesture | ( | bool | required | ) |
Sets whether media playback requires user gesture.
| void RADWeb::RADWebBrowserWindow::setNavigationBarVisible | ( | bool | visible | ) |
Shows or hides the built-in navigation bar.
| void RADWeb::RADWebBrowserWindow::setPermissionPolicy | ( | RADWebPermissionPolicy | policy | ) |
Sets default permission request policy.
| void RADWeb::RADWebBrowserWindow::setProfileDirectory | ( | const std::string & | directory | ) |
Sets the persistent profile directory before create().
| void RADWeb::RADWebBrowserWindow::setSessionRestoreEnabled | ( | bool | enabled | ) |
Enables or disables session restore.
| RADWebSettings RADWeb::RADWebBrowserWindow::settings | ( | ) | const |
Returns current browser settings.
| void RADWeb::RADWebBrowserWindow::setWebGlEnabled | ( | bool | enabled | ) |
Enables or disables WebGL.
| void RADWeb::RADWebBrowserWindow::setZoomLevel | ( | double | zoomLevel | ) |
Sets active tab zoom level.
| void RADWeb::RADWebBrowserWindow::show | ( | ) |
Shows the native browser window.
| void RADWeb::RADWebBrowserWindow::showBookmarks | ( | ) |
Opens the bookmarks pane.
| void RADWeb::RADWebBrowserWindow::showDevTools | ( | ) |
Opens WebKit developer tools for the active tab.
| void RADWeb::RADWebBrowserWindow::showDownloads | ( | ) |
Opens the downloads pane.
| void RADWeb::RADWebBrowserWindow::showHistory | ( | ) |
Opens the history pane.
| void RADWeb::RADWebBrowserWindow::showSettings | ( | ) |
Opens the settings pane.
| void RADWeb::RADWebBrowserWindow::stop | ( | ) |
Stops loading the active tab.
| int RADWeb::RADWebBrowserWindow::tabCount | ( | ) | const |
Returns the number of open tabs.
| std::vector<RADWebTabInfo> RADWeb::RADWebBrowserWindow::tabs | ( | ) | const |
Returns snapshots of all tabs.
| std::string RADWeb::RADWebBrowserWindow::title | ( | ) | const |
Returns current active tab title.
| std::string RADWeb::RADWebBrowserWindow::uri | ( | ) | const |
Returns current active tab URI.
| double RADWeb::RADWebBrowserWindow::zoomLevel | ( | ) | const |
Returns active tab zoom level.
| RADCore::Event<void (int) > RADWeb::RADWebBrowserWindow::activeTabChanged |
Raised with tab index when the active tab changes.
| RADCore::Event<void () > RADWeb::RADWebBrowserWindow::bookmarksChanged |
Raised when bookmarks change.
| RADCore::Event<void () > RADWeb::RADWebBrowserWindow::closed |
Raised when the window closes.
| RADCore::Event<void (int, std::string) > RADWeb::RADWebBrowserWindow::downloadFailed |
Raised with id and message when a download fails.
| RADCore::Event<void (RADWeb::RADWebDownloadInfo) > RADWeb::RADWebBrowserWindow::downloadFinished |
Raised when a download finishes.
| RADCore::Event<void (RADWeb::RADWebDownloadInfo) > RADWeb::RADWebBrowserWindow::downloadStarted |
Raised when a download starts.
| RADCore::Event<void (RADWeb::RADWebDownloadInfo) > RADWeb::RADWebBrowserWindow::downloadUpdated |
Raised as download progress changes.
| RADCore::Event<void (std::string) > RADWeb::RADWebBrowserWindow::errorOccurred |
Raised for browser-level setup/runtime errors.
| RADCore::Event<void () > RADWeb::RADWebBrowserWindow::historyChanged |
Raised when history entries change.
| RADCore::Event<void (std::string) > RADWeb::RADWebBrowserWindow::javaScriptFailed |
Raised with message when JavaScript evaluation fails.
| RADCore::Event<void (std::string) > RADWeb::RADWebBrowserWindow::javaScriptFinished |
Raised with result text when JavaScript evaluation succeeds.
| RADCore::Event<void (std::string, std::string) > RADWeb::RADWebBrowserWindow::loadFailed |
Raised with url and message when a load fails.
| RADCore::Event<void (std::string) > RADWeb::RADWebBrowserWindow::loadFinished |
Raised when the active tab finishes loading url.
| RADCore::Event<void (std::string) > RADWeb::RADWebBrowserWindow::loadStarted |
Raised when the active tab starts loading url.
| RADCore::Event<void (std::string, std::string) > RADWeb::RADWebBrowserWindow::permissionRequested |
Raised with origin and permission name when user policy is needed.
| RADCore::Event<void (int) > RADWeb::RADWebBrowserWindow::tabAdded |
Raised with tab id when a tab is added.
| RADCore::Event<void (int) > RADWeb::RADWebBrowserWindow::tabClosed |
Raised with tab id when a tab is closed.
| RADCore::Event<void (std::string) > RADWeb::RADWebBrowserWindow::titleChanged |
Raised when active tab title changes.
| RADCore::Event<void (std::string) > RADWeb::RADWebBrowserWindow::uriChanged |
Raised when active tab URI changes.