Molybden API
Loading...
Searching...
No Matches
navigation_delegates.hpp
1// Copyright (c) 2000-2023 TeamDev Ltd. All rights reserved.
2// TeamDev PROPRIETARY and CONFIDENTIAL.
3// Use is subject to license terms.
4
5#ifndef MOLYBDEN_NAVIGATION_DELEGATES_HPP
6#define MOLYBDEN_NAVIGATION_DELEGATES_HPP
7
8#include <memory>
9#include <string>
10
11#include "molybden/base/delegate.hpp"
12#include "molybden/base/delegate_action.hpp"
13#include "molybden/network/http_status_code.hpp"
14#include "molybden/network/network.hpp"
15
16namespace molybden {
17
18class Navigation;
19
27 std::shared_ptr<Navigation> navigation;
28
32 std::string url;
33
39
44};
45
50 public:
51 explicit StartNavigationAction(
52 std::unique_ptr<rpc::internal::Callback> callback);
53
57 void start();
58
62 void ignore();
63};
64
72 std::shared_ptr<Navigation> navigation;
73
77 std::string url;
78
82 HttpStatusCode http_status_code;
83};
84
89 public:
91 std::unique_ptr<rpc::internal::Callback> callback);
92
96 void showPage(const std::string& html);
97
102};
103
111 std::shared_ptr<Navigation> navigation;
112
116 std::string url;
117
121 NetError error;
122};
123
128 public:
129 explicit ShowNetErrorPageAction(
130 std::unique_ptr<rpc::internal::Callback> callback);
131
136 void showPage(const std::string& html);
137
142};
143
217
218} // namespace molybden
219
220#endif // MOLYBDEN_NAVIGATION_DELEGATES_HPP
The base API that implements classes which represent delegate's action.
Definition delegate_action.hpp:18
Delegates allow you to make decisions that affect the application behavior.
Definition delegate.hpp:30
Objects implement this interface to get notified about changes in Navigation and to provide necessary...
Definition navigation_delegates.hpp:148
Delegate< StartNavigationArgs, StartNavigationAction > onStartNavigation
Invoked when navigation to a resource is about to start.
Definition navigation_delegates.hpp:166
Delegate< ShowHttpErrorPageArgs, ShowHttpErrorPageAction > onShowHttpErrorPage
Invoked when a network error web page is about to display, because the web server sends an empty HTTP...
Definition navigation_delegates.hpp:191
Delegate< ShowNetErrorPageArgs, ShowNetErrorPageAction > onShowNetErrorPage
Invoked when a network error web page is about to display, because the required web resource cannot b...
Definition navigation_delegates.hpp:215
The NavigationDelegates::onShowHttpErrorPage action.
Definition navigation_delegates.hpp:88
void showPage(const std::string &html)
Tells the browser to display a custom error page with the given HTML.
void showDefaultPage()
Tells the browser that it should display the default error page.
The NavigationDelegates::onShowNetErrorPage action.
Definition navigation_delegates.hpp:127
void showDefaultPage()
Tells the browser to show the default network error page.
void showPage(const std::string &html)
Tells the browser to display a custom network error page with the given HTML.
The NavigationDelegates::onStartNavigation action.
Definition navigation_delegates.hpp:49
void start()
Tells the browser that it should continue the navigation request.
void ignore()
Tells the browser that the navigation request should be ignored.
The NavigationDelegates::onShowHttpErrorPage action arguments.
Definition navigation_delegates.hpp:68
HttpStatusCode http_status_code
The error code of the failed request.
Definition navigation_delegates.hpp:82
std::shared_ptr< Navigation > navigation
The navigation instance initiated this action.
Definition navigation_delegates.hpp:72
std::string url
The URL of the unreachable navigation request.
Definition navigation_delegates.hpp:77
The NavigationDelegates::onShowNetErrorPage action arguments.
Definition navigation_delegates.hpp:107
std::string url
The URL of the unreachable navigation request.
Definition navigation_delegates.hpp:116
std::shared_ptr< Navigation > navigation
The navigation instance initiated this action.
Definition navigation_delegates.hpp:111
NetError error
The network error of the failed navigation request.
Definition navigation_delegates.hpp:121
The NavigationDelegates::onStartNavigation action arguments.
Definition navigation_delegates.hpp:23
std::string url
The navigation request URL.
Definition navigation_delegates.hpp:32
bool is_redirect
Indicates if the request is the result of redirection caused by another request.
Definition navigation_delegates.hpp:38
bool is_main_frame
Indicates if the navigation request URL belongs to the main frame.
Definition navigation_delegates.hpp:43
std::shared_ptr< Navigation > navigation
The navigation instance initiated this action.
Definition navigation_delegates.hpp:27