• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2022 Marshall A. Greenblatt. All rights reserved.
2 //
3 // Redistribution and use in source and binary forms, with or without
4 // modification, are permitted provided that the following conditions are
5 // met:
6 //
7 //    * Redistributions of source code must retain the above copyright
8 // notice, this list of conditions and the following disclaimer.
9 //    * Redistributions in binary form must reproduce the above
10 // copyright notice, this list of conditions and the following disclaimer
11 // in the documentation and/or other materials provided with the
12 // distribution.
13 //    * Neither the name of Google Inc. nor the name Chromium Embedded
14 // Framework nor the names of its contributors may be used to endorse
15 // or promote products derived from this software without specific prior
16 // written permission.
17 //
18 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
21 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22 // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
23 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
24 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 //
30 // ---------------------------------------------------------------------------
31 //
32 // This file was generated by the CEF translator tool and should not edited
33 // by hand. See the translator.README.txt file in the tools directory for
34 // more information.
35 //
36 // $hash=f51b6a0dbf264fa43ea3199327a5adb1044bfc04$
37 //
38 
39 #ifndef CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_
40 #define CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_
41 #pragma once
42 
43 #include "include/capi/cef_base_capi.h"
44 #include "include/capi/cef_browser_capi.h"
45 #include "include/capi/cef_frame_capi.h"
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
51 ///
52 // Implement this structure to handle events related to browser load status. The
53 // functions of this structure will be called on the browser process UI thread
54 // or render process main thread (TID_RENDERER).
55 ///
56 typedef struct _cef_load_handler_t {
57   ///
58   // Base structure.
59   ///
60   cef_base_ref_counted_t base;
61 
62   ///
63   // Called when the loading state has changed. This callback will be executed
64   // twice -- once when loading is initiated either programmatically or by user
65   // action, and once when loading is terminated due to completion, cancellation
66   // of failure. It will be called before any calls to OnLoadStart and after all
67   // calls to OnLoadError and/or OnLoadEnd.
68   ///
69   void(CEF_CALLBACK* on_loading_state_change)(struct _cef_load_handler_t* self,
70                                               struct _cef_browser_t* browser,
71                                               int isLoading,
72                                               int canGoBack,
73                                               int canGoForward);
74 
75   ///
76   // Called after a navigation has been committed and before the browser begins
77   // loading contents in the frame. The |frame| value will never be NULL -- call
78   // the is_main() function to check if this frame is the main frame.
79   // |transition_type| provides information about the source of the navigation
80   // and an accurate value is only available in the browser process. Multiple
81   // frames may be loading at the same time. Sub-frames may start or continue
82   // loading after the main frame load has ended. This function will not be
83   // called for same page navigations (fragments, history state, etc.) or for
84   // navigations that fail or are canceled before commit. For notification of
85   // overall browser load status use OnLoadingStateChange instead.
86   ///
87   void(CEF_CALLBACK* on_load_start)(struct _cef_load_handler_t* self,
88                                     struct _cef_browser_t* browser,
89                                     struct _cef_frame_t* frame,
90                                     cef_transition_type_t transition_type);
91 
92   ///
93   // Called when the browser is done loading a frame. The |frame| value will
94   // never be NULL -- call the is_main() function to check if this frame is the
95   // main frame. Multiple frames may be loading at the same time. Sub-frames may
96   // start or continue loading after the main frame load has ended. This
97   // function will not be called for same page navigations (fragments, history
98   // state, etc.) or for navigations that fail or are canceled before commit.
99   // For notification of overall browser load status use OnLoadingStateChange
100   // instead.
101   ///
102   void(CEF_CALLBACK* on_load_end)(struct _cef_load_handler_t* self,
103                                   struct _cef_browser_t* browser,
104                                   struct _cef_frame_t* frame,
105                                   int httpStatusCode);
106 
107   ///
108   // Called when a navigation fails or is canceled. This function may be called
109   // by itself if before commit or in combination with OnLoadStart/OnLoadEnd if
110   // after commit. |errorCode| is the error code number, |errorText| is the
111   // error text and |failedUrl| is the URL that failed to load. See
112   // net\base\net_error_list.h for complete descriptions of the error codes.
113   ///
114   void(CEF_CALLBACK* on_load_error)(struct _cef_load_handler_t* self,
115                                     struct _cef_browser_t* browser,
116                                     struct _cef_frame_t* frame,
117                                     cef_errorcode_t errorCode,
118                                     const cef_string_t* errorText,
119                                     const cef_string_t* failedUrl);
120 } cef_load_handler_t;
121 
122 #ifdef __cplusplus
123 }
124 #endif
125 
126 #endif  // CEF_INCLUDE_CAPI_CEF_LOAD_HANDLER_CAPI_H_
127