]> git.sesse.net Git - casparcg/blob - dependencies64/cef/include/internal/cef_types.h
* Merged html producer and updated to latest CEF version (does not have satisfactory...
[casparcg] / dependencies64 / cef / include / internal / cef_types.h
1 // Copyright (c) 2014 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 #ifndef CEF_INCLUDE_INTERNAL_CEF_TYPES_H_
32 #define CEF_INCLUDE_INTERNAL_CEF_TYPES_H_
33 #pragma once
34
35 #include "include/base/cef_build.h"
36 #include "include/internal/cef_string.h"
37 #include "include/internal/cef_string_list.h"
38 #include "include/internal/cef_time.h"
39
40 // Bring in platform-specific definitions.
41 #if defined(OS_WIN)
42 #include "include/internal/cef_types_win.h"
43 #elif defined(OS_MACOSX)
44 #include "include/internal/cef_types_mac.h"
45 #elif defined(OS_LINUX)
46 #include "include/internal/cef_types_linux.h"
47 #endif
48
49 #include <limits.h>         // For UINT_MAX
50 #include <stddef.h>         // For size_t
51
52 // The NSPR system headers define 64-bit as |long| when possible, except on
53 // Mac OS X.  In order to not have typedef mismatches, we do the same on LP64.
54 //
55 // On Mac OS X, |long long| is used for 64-bit types for compatibility with
56 // <inttypes.h> format macros even in the LP64 model.
57 #if defined(__LP64__) && !defined(OS_MACOSX) && !defined(OS_OPENBSD)
58 typedef long                int64;  // NOLINT(runtime/int)
59 typedef unsigned long       uint64;  // NOLINT(runtime/int)
60 #else
61 typedef long long           int64;  // NOLINT(runtime/int)
62 typedef unsigned long long  uint64;  // NOLINT(runtime/int)
63 #endif
64
65 // TODO: Remove these type guards.  These are to avoid conflicts with
66 // obsolete/protypes.h in the Gecko SDK.
67 #ifndef _INT32
68 #define _INT32
69 typedef int                 int32;
70 #endif
71
72 // TODO: Remove these type guards.  These are to avoid conflicts with
73 // obsolete/protypes.h in the Gecko SDK.
74 #ifndef _UINT32
75 #define _UINT32
76 typedef unsigned int       uint32;
77 #endif
78
79 // UTF-16 character type
80 #ifndef char16
81 #if defined(WIN32)
82 typedef wchar_t             char16;
83 #else
84 typedef unsigned short      char16;
85 #endif
86 #endif
87
88 // 32-bit ARGB color value, not premultiplied. The color components are always
89 // in a known order. Equivalent to the SkColor type.
90 typedef uint32              cef_color_t;
91
92 // Return the alpha byte from a cef_color_t value.
93 #define CefColorGetA(color)      (((color) >> 24) & 0xFF)
94 // Return the red byte from a cef_color_t value.
95 #define CefColorGetR(color)      (((color) >> 16) & 0xFF)
96 // Return the green byte from a cef_color_t value.
97 #define CefColorGetG(color)      (((color) >>  8) & 0xFF)
98 // Return the blue byte from a cef_color_t value.
99 #define CefColorGetB(color)      (((color) >>  0) & 0xFF)
100
101 // Return an cef_color_t value with the specified byte component values.
102 #define CefColorSetARGB(a, r, g, b) \
103     static_cast<cef_color_t>( \
104         (static_cast<unsigned>(a) << 24) | \
105         (static_cast<unsigned>(r) << 16) | \
106         (static_cast<unsigned>(g) << 8) | \
107         (static_cast<unsigned>(b) << 0))
108
109 // Return an int64 value with the specified low and high int32 component values.
110 #define CefInt64Set(int32_low, int32_high) \
111     static_cast<int64>((static_cast<uint32>(int32_low)) | \
112         (static_cast<int64>(static_cast<int32>(int32_high))) << 32)
113
114 // Return the low int32 value from an int64 value.
115 #define CefInt64GetLow(int64_val) static_cast<int32>(int64_val)
116 // Return the high int32 value from an int64 value.
117 #define CefInt64GetHigh(int64_val) \
118     static_cast<int32>((static_cast<int64>(int64_val) >> 32) & 0xFFFFFFFFL)
119
120
121 #ifdef __cplusplus
122 extern "C" {
123 #endif
124
125 ///
126 // Log severity levels.
127 ///
128 typedef enum {
129   ///
130   // Default logging (currently INFO logging).
131   ///
132   LOGSEVERITY_DEFAULT,
133
134   ///
135   // Verbose logging.
136   ///
137   LOGSEVERITY_VERBOSE,
138
139   ///
140   // INFO logging.
141   ///
142   LOGSEVERITY_INFO,
143
144   ///
145   // WARNING logging.
146   ///
147   LOGSEVERITY_WARNING,
148
149   ///
150   // ERROR logging.
151   ///
152   LOGSEVERITY_ERROR,
153
154   ///
155   // Completely disable logging.
156   ///
157   LOGSEVERITY_DISABLE = 99
158 } cef_log_severity_t;
159
160 ///
161 // Represents the state of a setting.
162 ///
163 typedef enum {
164   ///
165   // Use the default state for the setting.
166   ///
167   STATE_DEFAULT = 0,
168
169   ///
170   // Enable or allow the setting.
171   ///
172   STATE_ENABLED,
173
174   ///
175   // Disable or disallow the setting.
176   ///
177   STATE_DISABLED,
178 } cef_state_t;
179
180 ///
181 // Initialization settings. Specify NULL or 0 to get the recommended default
182 // values. Many of these and other settings can also configured using command-
183 // line switches.
184 ///
185 typedef struct _cef_settings_t {
186   ///
187   // Size of this structure.
188   ///
189   size_t size;
190
191   ///
192   // Set to true (1) to use a single process for the browser and renderer. This
193   // run mode is not officially supported by Chromium and is less stable than
194   // the multi-process default. Also configurable using the "single-process"
195   // command-line switch.
196   ///
197   int single_process;
198
199   ///
200   // Set to true (1) to disable the sandbox for sub-processes. See
201   // cef_sandbox_win.h for requirements to enable the sandbox on Windows. Also
202   // configurable using the "no-sandbox" command-line switch.
203   ///
204   int no_sandbox;
205
206   ///
207   // The path to a separate executable that will be launched for sub-processes.
208   // By default the browser process executable is used. See the comments on
209   // CefExecuteProcess() for details. Also configurable using the
210   // "browser-subprocess-path" command-line switch.
211   ///
212   cef_string_t browser_subprocess_path;
213
214   ///
215   // Set to true (1) to have the browser process message loop run in a separate
216   // thread. If false (0) than the CefDoMessageLoopWork() function must be
217   // called from your application message loop. This option is only supported on
218   // Windows.
219   ///
220   int multi_threaded_message_loop;
221
222   ///
223   // Set to true (1) to enable windowless (off-screen) rendering support. Do not
224   // enable this value if the application does not use windowless rendering as
225   // it may reduce rendering performance on some systems.
226   ///
227   int windowless_rendering_enabled;
228
229   ///
230   // Set to true (1) to disable configuration of browser process features using
231   // standard CEF and Chromium command-line arguments. Configuration can still
232   // be specified using CEF data structures or via the
233   // CefApp::OnBeforeCommandLineProcessing() method.
234   ///
235   int command_line_args_disabled;
236
237   ///
238   // The location where cache data will be stored on disk. If empty then
239   // browsers will be created in "incognito mode" where in-memory caches are
240   // used for storage and no data is persisted to disk. HTML5 databases such as
241   // localStorage will only persist across sessions if a cache path is
242   // specified. Can be overridden for individual CefRequestContext instances via
243   // the CefRequestContextSettings.cache_path value.
244   ///
245   cef_string_t cache_path;
246
247   ///
248   // The location where user data such as spell checking dictionary files will
249   // be stored on disk. If empty then the default platform-specific user data
250   // directory will be used ("~/.cef_user_data" directory on Linux,
251   // "~/Library/Application Support/CEF/User Data" directory on Mac OS X,
252   // "Local Settings\Application Data\CEF\User Data" directory under the user
253   // profile directory on Windows).
254   ///
255   cef_string_t user_data_path;
256
257   ///
258   // To persist session cookies (cookies without an expiry date or validity
259   // interval) by default when using the global cookie manager set this value to
260   // true. Session cookies are generally intended to be transient and most Web
261   // browsers do not persist them. A |cache_path| value must also be specified
262   // to enable this feature. Also configurable using the
263   // "persist-session-cookies" command-line switch. Can be overridden for
264   // individual CefRequestContext instances via the
265   // CefRequestContextSettings.persist_session_cookies value.
266   ///
267   int persist_session_cookies;
268
269   ///
270   // Value that will be returned as the User-Agent HTTP header. If empty the
271   // default User-Agent string will be used. Also configurable using the
272   // "user-agent" command-line switch.
273   ///
274   cef_string_t user_agent;
275
276   ///
277   // Value that will be inserted as the product portion of the default
278   // User-Agent string. If empty the Chromium product version will be used. If
279   // |userAgent| is specified this value will be ignored. Also configurable
280   // using the "product-version" command-line switch.
281   ///
282   cef_string_t product_version;
283
284   ///
285   // The locale string that will be passed to WebKit. If empty the default
286   // locale of "en-US" will be used. This value is ignored on Linux where locale
287   // is determined using environment variable parsing with the precedence order:
288   // LANGUAGE, LC_ALL, LC_MESSAGES and LANG. Also configurable using the "lang"
289   // command-line switch.
290   ///
291   cef_string_t locale;
292
293   ///
294   // The directory and file name to use for the debug log. If empty, the
295   // default name of "debug.log" will be used and the file will be written
296   // to the application directory. Also configurable using the "log-file"
297   // command-line switch.
298   ///
299   cef_string_t log_file;
300
301   ///
302   // The log severity. Only messages of this severity level or higher will be
303   // logged. Also configurable using the "log-severity" command-line switch with
304   // a value of "verbose", "info", "warning", "error", "error-report" or
305   // "disable".
306   ///
307   cef_log_severity_t log_severity;
308
309   ///
310   // Custom flags that will be used when initializing the V8 JavaScript engine.
311   // The consequences of using custom flags may not be well tested. Also
312   // configurable using the "js-flags" command-line switch.
313   ///
314   cef_string_t javascript_flags;
315
316   ///
317   // The fully qualified path for the resources directory. If this value is
318   // empty the cef.pak and/or devtools_resources.pak files must be located in
319   // the module directory on Windows/Linux or the app bundle Resources directory
320   // on Mac OS X. Also configurable using the "resources-dir-path" command-line
321   // switch.
322   ///
323   cef_string_t resources_dir_path;
324
325   ///
326   // The fully qualified path for the locales directory. If this value is empty
327   // the locales directory must be located in the module directory. This value
328   // is ignored on Mac OS X where pack files are always loaded from the app
329   // bundle Resources directory. Also configurable using the "locales-dir-path"
330   // command-line switch.
331   ///
332   cef_string_t locales_dir_path;
333
334   ///
335   // Set to true (1) to disable loading of pack files for resources and locales.
336   // A resource bundle handler must be provided for the browser and render
337   // processes via CefApp::GetResourceBundleHandler() if loading of pack files
338   // is disabled. Also configurable using the "disable-pack-loading" command-
339   // line switch.
340   ///
341   int pack_loading_disabled;
342
343   ///
344   // Set to a value between 1024 and 65535 to enable remote debugging on the
345   // specified port. For example, if 8080 is specified the remote debugging URL
346   // will be http://localhost:8080. CEF can be remotely debugged from any CEF or
347   // Chrome browser window. Also configurable using the "remote-debugging-port"
348   // command-line switch.
349   ///
350   int remote_debugging_port;
351
352   ///
353   // The number of stack trace frames to capture for uncaught exceptions.
354   // Specify a positive value to enable the CefRenderProcessHandler::
355   // OnUncaughtException() callback. Specify 0 (default value) and
356   // OnUncaughtException() will not be called. Also configurable using the
357   // "uncaught-exception-stack-size" command-line switch.
358   ///
359   int uncaught_exception_stack_size;
360
361   ///
362   // By default CEF V8 references will be invalidated (the IsValid() method will
363   // return false) after the owning context has been released. This reduces the
364   // need for external record keeping and avoids crashes due to the use of V8
365   // references after the associated context has been released.
366   //
367   // CEF currently offers two context safety implementations with different
368   // performance characteristics. The default implementation (value of 0) uses a
369   // map of hash values and should provide better performance in situations with
370   // a small number contexts. The alternate implementation (value of 1) uses a
371   // hidden value attached to each context and should provide better performance
372   // in situations with a large number of contexts.
373   //
374   // If you need better performance in the creation of V8 references and you
375   // plan to manually track context lifespan you can disable context safety by
376   // specifying a value of -1.
377   //
378   // Also configurable using the "context-safety-implementation" command-line
379   // switch.
380   ///
381   int context_safety_implementation;
382
383   ///
384   // Set to true (1) to ignore errors related to invalid SSL certificates.
385   // Enabling this setting can lead to potential security vulnerabilities like
386   // "man in the middle" attacks. Applications that load content from the
387   // internet should not enable this setting. Also configurable using the
388   // "ignore-certificate-errors" command-line switch. Can be overridden for
389   // individual CefRequestContext instances via the
390   // CefRequestContextSettings.ignore_certificate_errors value.
391   ///
392   int ignore_certificate_errors;
393
394   ///
395   // Opaque background color used for accelerated content. By default the
396   // background color will be white. Only the RGB compontents of the specified
397   // value will be used. The alpha component must greater than 0 to enable use
398   // of the background color but will be otherwise ignored.
399   ///
400   cef_color_t background_color;
401
402   ///
403   // Comma delimited ordered list of language codes without any whitespace that
404   // will be used in the "Accept-Language" HTTP header. May be overridden on a
405   // per-browser basis using the CefBrowserSettings.accept_language_list value.
406   // If both values are empty then "en-US,en" will be used. Can be overridden
407   // for individual CefRequestContext instances via the
408   // CefRequestContextSettings.accept_language_list value.
409   ///
410   cef_string_t accept_language_list;
411 } cef_settings_t;
412
413 ///
414 // Request context initialization settings. Specify NULL or 0 to get the
415 // recommended default values.
416 ///
417 typedef struct _cef_request_context_settings_t {
418   ///
419   // Size of this structure.
420   ///
421   size_t size;
422
423   ///
424   // The location where cache data will be stored on disk. If empty then
425   // browsers will be created in "incognito mode" where in-memory caches are
426   // used for storage and no data is persisted to disk. HTML5 databases such as
427   // localStorage will only persist across sessions if a cache path is
428   // specified. To share the global browser cache and related configuration set
429   // this value to match the CefSettings.cache_path value.
430   ///
431   cef_string_t cache_path;
432
433   ///
434   // To persist session cookies (cookies without an expiry date or validity
435   // interval) by default when using the global cookie manager set this value to
436   // true. Session cookies are generally intended to be transient and most Web
437   // browsers do not persist them. Can be set globally using the
438   // CefSettings.persist_session_cookies value. This value will be ignored if
439   // |cache_path| is empty or if it matches the CefSettings.cache_path value.
440   ///
441   int persist_session_cookies;
442
443   ///
444   // Set to true (1) to ignore errors related to invalid SSL certificates.
445   // Enabling this setting can lead to potential security vulnerabilities like
446   // "man in the middle" attacks. Applications that load content from the
447   // internet should not enable this setting. Can be set globally using the
448   // CefSettings.ignore_certificate_errors value. This value will be ignored if
449   // |cache_path| matches the CefSettings.cache_path value.
450   ///
451   int ignore_certificate_errors;
452
453   ///
454   // Comma delimited ordered list of language codes without any whitespace that
455   // will be used in the "Accept-Language" HTTP header. Can be set globally
456   // using the CefSettings.accept_language_list value or overridden on a per-
457   // browser basis using the CefBrowserSettings.accept_language_list value. If
458   // all values are empty then "en-US,en" will be used. This value will be
459   // ignored if |cache_path| matches the CefSettings.cache_path value.
460   ///
461   cef_string_t accept_language_list;
462 } cef_request_context_settings_t;
463
464 ///
465 // Browser initialization settings. Specify NULL or 0 to get the recommended
466 // default values. The consequences of using custom values may not be well
467 // tested. Many of these and other settings can also configured using command-
468 // line switches.
469 ///
470 typedef struct _cef_browser_settings_t {
471   ///
472   // Size of this structure.
473   ///
474   size_t size;
475
476   ///
477   // The maximum rate in frames per second (fps) that CefRenderHandler::OnPaint
478   // will be called for a windowless browser. The actual fps may be lower if
479   // the browser cannot generate frames at the requested rate. The minimum
480   // value is 1 and the maximum value is 60 (default 30).
481   ///
482   int windowless_frame_rate;
483
484   // The below values map to WebPreferences settings.
485
486   ///
487   // Font settings.
488   ///
489   cef_string_t standard_font_family;
490   cef_string_t fixed_font_family;
491   cef_string_t serif_font_family;
492   cef_string_t sans_serif_font_family;
493   cef_string_t cursive_font_family;
494   cef_string_t fantasy_font_family;
495   int default_font_size;
496   int default_fixed_font_size;
497   int minimum_font_size;
498   int minimum_logical_font_size;
499
500   ///
501   // Default encoding for Web content. If empty "ISO-8859-1" will be used. Also
502   // configurable using the "default-encoding" command-line switch.
503   ///
504   cef_string_t default_encoding;
505
506   ///
507   // Controls the loading of fonts from remote sources. Also configurable using
508   // the "disable-remote-fonts" command-line switch.
509   ///
510   cef_state_t remote_fonts;
511
512   ///
513   // Controls whether JavaScript can be executed. Also configurable using the
514   // "disable-javascript" command-line switch.
515   ///
516   cef_state_t javascript;
517
518   ///
519   // Controls whether JavaScript can be used for opening windows. Also
520   // configurable using the "disable-javascript-open-windows" command-line
521   // switch.
522   ///
523   cef_state_t javascript_open_windows;
524
525   ///
526   // Controls whether JavaScript can be used to close windows that were not
527   // opened via JavaScript. JavaScript can still be used to close windows that
528   // were opened via JavaScript or that have no back/forward history. Also
529   // configurable using the "disable-javascript-close-windows" command-line
530   // switch.
531   ///
532   cef_state_t javascript_close_windows;
533
534   ///
535   // Controls whether JavaScript can access the clipboard. Also configurable
536   // using the "disable-javascript-access-clipboard" command-line switch.
537   ///
538   cef_state_t javascript_access_clipboard;
539
540   ///
541   // Controls whether DOM pasting is supported in the editor via
542   // execCommand("paste"). The |javascript_access_clipboard| setting must also
543   // be enabled. Also configurable using the "disable-javascript-dom-paste"
544   // command-line switch.
545   ///
546   cef_state_t javascript_dom_paste;
547
548   ///
549   // Controls whether the caret position will be drawn. Also configurable using
550   // the "enable-caret-browsing" command-line switch.
551   ///
552   cef_state_t caret_browsing;
553
554   ///
555   // Controls whether the Java plugin will be loaded. Also configurable using
556   // the "disable-java" command-line switch.
557   ///
558   cef_state_t java;
559
560   ///
561   // Controls whether any plugins will be loaded. Also configurable using the
562   // "disable-plugins" command-line switch.
563   ///
564   cef_state_t plugins;
565
566   ///
567   // Controls whether file URLs will have access to all URLs. Also configurable
568   // using the "allow-universal-access-from-files" command-line switch.
569   ///
570   cef_state_t universal_access_from_file_urls;
571
572   ///
573   // Controls whether file URLs will have access to other file URLs. Also
574   // configurable using the "allow-access-from-files" command-line switch.
575   ///
576   cef_state_t file_access_from_file_urls;
577
578   ///
579   // Controls whether web security restrictions (same-origin policy) will be
580   // enforced. Disabling this setting is not recommend as it will allow risky
581   // security behavior such as cross-site scripting (XSS). Also configurable
582   // using the "disable-web-security" command-line switch.
583   ///
584   cef_state_t web_security;
585
586   ///
587   // Controls whether image URLs will be loaded from the network. A cached image
588   // will still be rendered if requested. Also configurable using the
589   // "disable-image-loading" command-line switch.
590   ///
591   cef_state_t image_loading;
592
593   ///
594   // Controls whether standalone images will be shrunk to fit the page. Also
595   // configurable using the "image-shrink-standalone-to-fit" command-line
596   // switch.
597   ///
598   cef_state_t image_shrink_standalone_to_fit;
599
600   ///
601   // Controls whether text areas can be resized. Also configurable using the
602   // "disable-text-area-resize" command-line switch.
603   ///
604   cef_state_t text_area_resize;
605
606   ///
607   // Controls whether the tab key can advance focus to links. Also configurable
608   // using the "disable-tab-to-links" command-line switch.
609   ///
610   cef_state_t tab_to_links;
611
612   ///
613   // Controls whether local storage can be used. Also configurable using the
614   // "disable-local-storage" command-line switch.
615   ///
616   cef_state_t local_storage;
617
618   ///
619   // Controls whether databases can be used. Also configurable using the
620   // "disable-databases" command-line switch.
621   ///
622   cef_state_t databases;
623
624   ///
625   // Controls whether the application cache can be used. Also configurable using
626   // the "disable-application-cache" command-line switch.
627   ///
628   cef_state_t application_cache;
629
630   ///
631   // Controls whether WebGL can be used. Note that WebGL requires hardware
632   // support and may not work on all systems even when enabled. Also
633   // configurable using the "disable-webgl" command-line switch.
634   ///
635   cef_state_t webgl;
636
637   ///
638   // Opaque background color used for the browser before a document is loaded
639   // and when no document color is specified. By default the background color
640   // will be the same as CefSettings.background_color. Only the RGB compontents
641   // of the specified value will be used. The alpha component must greater than
642   // 0 to enable use of the background color but will be otherwise ignored.
643   ///
644   cef_color_t background_color;
645
646   ///
647   // Comma delimited ordered list of language codes without any whitespace that
648   // will be used in the "Accept-Language" HTTP header. May be set globally
649   // using the CefBrowserSettings.accept_language_list value. If both values are
650   // empty then "en-US,en" will be used.
651   ///
652   cef_string_t accept_language_list;
653 } cef_browser_settings_t;
654
655 ///
656 // Return value types.
657 ///
658 typedef enum {
659   ///
660   // Cancel immediately.
661   ///
662   RV_CANCEL = 0,
663
664   ///
665   // Continue immediately.
666   ///
667   RV_CONTINUE,
668
669   ///
670   // Continue asynchronously (usually via a callback).
671   ///
672   RV_CONTINUE_ASYNC,
673 } cef_return_value_t;
674
675 ///
676 // URL component parts.
677 ///
678 typedef struct _cef_urlparts_t {
679   ///
680   // The complete URL specification.
681   ///
682   cef_string_t spec;
683
684   ///
685   // Scheme component not including the colon (e.g., "http").
686   ///
687   cef_string_t scheme;
688
689   ///
690   // User name component.
691   ///
692   cef_string_t username;
693
694   ///
695   // Password component.
696   ///
697   cef_string_t password;
698
699   ///
700   // Host component. This may be a hostname, an IPv4 address or an IPv6 literal
701   // surrounded by square brackets (e.g., "[2001:db8::1]").
702   ///
703   cef_string_t host;
704
705   ///
706   // Port number component.
707   ///
708   cef_string_t port;
709
710   ///
711   // Origin contains just the scheme, host, and port from a URL. Equivalent to
712   // clearing any username and password, replacing the path with a slash, and
713   // clearing everything after that. This value will be empty for non-standard
714   // URLs.
715   ///
716   cef_string_t origin;
717
718   ///
719   // Path component including the first slash following the host.
720   ///
721   cef_string_t path;
722
723   ///
724   // Query string component (i.e., everything following the '?').
725   ///
726   cef_string_t query;
727 } cef_urlparts_t;
728
729 ///
730 // Cookie information.
731 ///
732 typedef struct _cef_cookie_t {
733   ///
734   // The cookie name.
735   ///
736   cef_string_t name;
737
738   ///
739   // The cookie value.
740   ///
741   cef_string_t value;
742
743   ///
744   // If |domain| is empty a host cookie will be created instead of a domain
745   // cookie. Domain cookies are stored with a leading "." and are visible to
746   // sub-domains whereas host cookies are not.
747   ///
748   cef_string_t domain;
749
750   ///
751   // If |path| is non-empty only URLs at or below the path will get the cookie
752   // value.
753   ///
754   cef_string_t path;
755
756   ///
757   // If |secure| is true the cookie will only be sent for HTTPS requests.
758   ///
759   int secure;
760
761   ///
762   // If |httponly| is true the cookie will only be sent for HTTP requests.
763   ///
764   int httponly;
765
766   ///
767   // The cookie creation date. This is automatically populated by the system on
768   // cookie creation.
769   ///
770   cef_time_t creation;
771
772   ///
773   // The cookie last access date. This is automatically populated by the system
774   // on access.
775   ///
776   cef_time_t last_access;
777
778   ///
779   // The cookie expiration date is only valid if |has_expires| is true.
780   ///
781   int has_expires;
782   cef_time_t expires;
783 } cef_cookie_t;
784
785 ///
786 // Process termination status values.
787 ///
788 typedef enum {
789   ///
790   // Non-zero exit status.
791   ///
792   TS_ABNORMAL_TERMINATION,
793
794   ///
795   // SIGKILL or task manager kill.
796   ///
797   TS_PROCESS_WAS_KILLED,
798
799   ///
800   // Segmentation fault.
801   ///
802   TS_PROCESS_CRASHED,
803 } cef_termination_status_t;
804
805 ///
806 // Path key values.
807 ///
808 typedef enum {
809   ///
810   // Current directory.
811   ///
812   PK_DIR_CURRENT,
813
814   ///
815   // Directory containing PK_FILE_EXE.
816   ///
817   PK_DIR_EXE,
818
819   ///
820   // Directory containing PK_FILE_MODULE.
821   ///
822   PK_DIR_MODULE,
823
824   ///
825   // Temporary directory.
826   ///
827   PK_DIR_TEMP,
828
829   ///
830   // Path and filename of the current executable.
831   ///
832   PK_FILE_EXE,
833
834   ///
835   // Path and filename of the module containing the CEF code (usually the libcef
836   // module).
837   ///
838   PK_FILE_MODULE,
839
840   ///
841   // "Local Settings\Application Data" directory under the user profile
842   // directory on Windows.
843   ///
844   PK_LOCAL_APP_DATA,
845
846   ///
847   // "Application Data" directory under the user profile directory on Windows
848   // and "~/Library/Application Support" directory on Mac OS X.
849   ///
850   PK_USER_DATA,
851 } cef_path_key_t;
852
853 ///
854 // Storage types.
855 ///
856 typedef enum {
857   ST_LOCALSTORAGE = 0,
858   ST_SESSIONSTORAGE,
859 } cef_storage_type_t;
860
861 ///
862 // Supported error code values. See net\base\net_error_list.h for complete
863 // descriptions of the error codes.
864 ///
865 typedef enum {
866   ERR_NONE = 0,
867   ERR_FAILED = -2,
868   ERR_ABORTED = -3,
869   ERR_INVALID_ARGUMENT = -4,
870   ERR_INVALID_HANDLE = -5,
871   ERR_FILE_NOT_FOUND = -6,
872   ERR_TIMED_OUT = -7,
873   ERR_FILE_TOO_BIG = -8,
874   ERR_UNEXPECTED = -9,
875   ERR_ACCESS_DENIED = -10,
876   ERR_NOT_IMPLEMENTED = -11,
877   ERR_CONNECTION_CLOSED = -100,
878   ERR_CONNECTION_RESET = -101,
879   ERR_CONNECTION_REFUSED = -102,
880   ERR_CONNECTION_ABORTED = -103,
881   ERR_CONNECTION_FAILED = -104,
882   ERR_NAME_NOT_RESOLVED = -105,
883   ERR_INTERNET_DISCONNECTED = -106,
884   ERR_SSL_PROTOCOL_ERROR = -107,
885   ERR_ADDRESS_INVALID = -108,
886   ERR_ADDRESS_UNREACHABLE = -109,
887   ERR_SSL_CLIENT_AUTH_CERT_NEEDED = -110,
888   ERR_TUNNEL_CONNECTION_FAILED = -111,
889   ERR_NO_SSL_VERSIONS_ENABLED = -112,
890   ERR_SSL_VERSION_OR_CIPHER_MISMATCH = -113,
891   ERR_SSL_RENEGOTIATION_REQUESTED = -114,
892   ERR_CERT_COMMON_NAME_INVALID = -200,
893   ERR_CERT_DATE_INVALID = -201,
894   ERR_CERT_AUTHORITY_INVALID = -202,
895   ERR_CERT_CONTAINS_ERRORS = -203,
896   ERR_CERT_NO_REVOCATION_MECHANISM = -204,
897   ERR_CERT_UNABLE_TO_CHECK_REVOCATION = -205,
898   ERR_CERT_REVOKED = -206,
899   ERR_CERT_INVALID = -207,
900   ERR_CERT_END = -208,
901   ERR_INVALID_URL = -300,
902   ERR_DISALLOWED_URL_SCHEME = -301,
903   ERR_UNKNOWN_URL_SCHEME = -302,
904   ERR_TOO_MANY_REDIRECTS = -310,
905   ERR_UNSAFE_REDIRECT = -311,
906   ERR_UNSAFE_PORT = -312,
907   ERR_INVALID_RESPONSE = -320,
908   ERR_INVALID_CHUNKED_ENCODING = -321,
909   ERR_METHOD_NOT_SUPPORTED = -322,
910   ERR_UNEXPECTED_PROXY_AUTH = -323,
911   ERR_EMPTY_RESPONSE = -324,
912   ERR_RESPONSE_HEADERS_TOO_BIG = -325,
913   ERR_CACHE_MISS = -400,
914   ERR_INSECURE_RESPONSE = -501,
915 } cef_errorcode_t;
916
917 ///
918 // The manner in which a link click should be opened.
919 ///
920 typedef enum {
921   WOD_UNKNOWN,
922   WOD_SUPPRESS_OPEN,
923   WOD_CURRENT_TAB,
924   WOD_SINGLETON_TAB,
925   WOD_NEW_FOREGROUND_TAB,
926   WOD_NEW_BACKGROUND_TAB,
927   WOD_NEW_POPUP,
928   WOD_NEW_WINDOW,
929   WOD_SAVE_TO_DISK,
930   WOD_OFF_THE_RECORD,
931   WOD_IGNORE_ACTION
932 } cef_window_open_disposition_t;
933
934 ///
935 // "Verb" of a drag-and-drop operation as negotiated between the source and
936 // destination. These constants match their equivalents in WebCore's
937 // DragActions.h and should not be renumbered.
938 ///
939 typedef enum {
940     DRAG_OPERATION_NONE    = 0,
941     DRAG_OPERATION_COPY    = 1,
942     DRAG_OPERATION_LINK    = 2,
943     DRAG_OPERATION_GENERIC = 4,
944     DRAG_OPERATION_PRIVATE = 8,
945     DRAG_OPERATION_MOVE    = 16,
946     DRAG_OPERATION_DELETE  = 32,
947     DRAG_OPERATION_EVERY   = UINT_MAX
948 } cef_drag_operations_mask_t;
949
950 ///
951 // V8 access control values.
952 ///
953 typedef enum {
954   V8_ACCESS_CONTROL_DEFAULT               = 0,
955   V8_ACCESS_CONTROL_ALL_CAN_READ          = 1,
956   V8_ACCESS_CONTROL_ALL_CAN_WRITE         = 1 << 1,
957   V8_ACCESS_CONTROL_PROHIBITS_OVERWRITING = 1 << 2
958 } cef_v8_accesscontrol_t;
959
960 ///
961 // V8 property attribute values.
962 ///
963 typedef enum {
964   V8_PROPERTY_ATTRIBUTE_NONE       = 0,       // Writeable, Enumerable,
965                                               //   Configurable
966   V8_PROPERTY_ATTRIBUTE_READONLY   = 1 << 0,  // Not writeable
967   V8_PROPERTY_ATTRIBUTE_DONTENUM   = 1 << 1,  // Not enumerable
968   V8_PROPERTY_ATTRIBUTE_DONTDELETE = 1 << 2   // Not configurable
969 } cef_v8_propertyattribute_t;
970
971 ///
972 // Post data elements may represent either bytes or files.
973 ///
974 typedef enum {
975   PDE_TYPE_EMPTY  = 0,
976   PDE_TYPE_BYTES,
977   PDE_TYPE_FILE,
978 } cef_postdataelement_type_t;
979
980 ///
981 // Resource type for a request.
982 ///
983 typedef enum {
984   ///
985   // Top level page.
986   ///
987   RT_MAIN_FRAME = 0,
988
989   ///
990   // Frame or iframe.
991   ///
992   RT_SUB_FRAME,
993
994   ///
995   // CSS stylesheet.
996   ///
997   RT_STYLESHEET,
998
999   ///
1000   // External script.
1001   ///
1002   RT_SCRIPT,
1003
1004   ///
1005   // Image (jpg/gif/png/etc).
1006   ///
1007   RT_IMAGE,
1008
1009   ///
1010   // Font.
1011   ///
1012   RT_FONT_RESOURCE,
1013
1014   ///
1015   // Some other subresource. This is the default type if the actual type is
1016   // unknown.
1017   ///
1018   RT_SUB_RESOURCE,
1019
1020   ///
1021   // Object (or embed) tag for a plugin, or a resource that a plugin requested.
1022   ///
1023   RT_OBJECT,
1024
1025   ///
1026   // Media resource.
1027   ///
1028   RT_MEDIA,
1029
1030   ///
1031   // Main resource of a dedicated worker.
1032   ///
1033   RT_WORKER,
1034
1035   ///
1036   // Main resource of a shared worker.
1037   ///
1038   RT_SHARED_WORKER,
1039
1040   ///
1041   // Explicitly requested prefetch.
1042   ///
1043   RT_PREFETCH,
1044
1045   ///
1046   // Favicon.
1047   ///
1048   RT_FAVICON,
1049
1050   ///
1051   // XMLHttpRequest.
1052   ///
1053   RT_XHR,
1054
1055   ///
1056   // A request for a <ping>
1057   ///
1058   RT_PING,
1059
1060   ///
1061   // Main resource of a service worker.
1062   ///
1063   RT_SERVICE_WORKER,
1064 } cef_resource_type_t;
1065
1066 ///
1067 // Transition type for a request. Made up of one source value and 0 or more
1068 // qualifiers.
1069 ///
1070 typedef enum {
1071   ///
1072   // Source is a link click or the JavaScript window.open function. This is
1073   // also the default value for requests like sub-resource loads that are not
1074   // navigations.
1075   ///
1076   TT_LINK = 0,
1077
1078   ///
1079   // Source is some other "explicit" navigation action such as creating a new
1080   // browser or using the LoadURL function. This is also the default value
1081   // for navigations where the actual type is unknown.
1082   ///
1083   TT_EXPLICIT = 1,
1084
1085   ///
1086   // Source is a subframe navigation. This is any content that is automatically
1087   // loaded in a non-toplevel frame. For example, if a page consists of several
1088   // frames containing ads, those ad URLs will have this transition type.
1089   // The user may not even realize the content in these pages is a separate
1090   // frame, so may not care about the URL.
1091   ///
1092   TT_AUTO_SUBFRAME = 3,
1093
1094   ///
1095   // Source is a subframe navigation explicitly requested by the user that will
1096   // generate new navigation entries in the back/forward list. These are
1097   // probably more important than frames that were automatically loaded in
1098   // the background because the user probably cares about the fact that this
1099   // link was loaded.
1100   ///
1101   TT_MANUAL_SUBFRAME = 4,
1102
1103   ///
1104   // Source is a form submission by the user. NOTE: In some situations
1105   // submitting a form does not result in this transition type. This can happen
1106   // if the form uses a script to submit the contents.
1107   ///
1108   TT_FORM_SUBMIT = 7,
1109
1110   ///
1111   // Source is a "reload" of the page via the Reload function or by re-visiting
1112   // the same URL. NOTE: This is distinct from the concept of whether a
1113   // particular load uses "reload semantics" (i.e. bypasses cached data).
1114   ///
1115   TT_RELOAD = 8,
1116
1117   ///
1118   // General mask defining the bits used for the source values.
1119   ///
1120   TT_SOURCE_MASK = 0xFF,
1121
1122   // Qualifiers.
1123   // Any of the core values above can be augmented by one or more qualifiers.
1124   // These qualifiers further define the transition.
1125
1126   ///
1127   // Attempted to visit a URL but was blocked.
1128   ///
1129   TT_BLOCKED_FLAG = 0x00800000,
1130
1131   ///
1132   // Used the Forward or Back function to navigate among browsing history.
1133   ///
1134   TT_FORWARD_BACK_FLAG = 0x01000000,
1135
1136   ///
1137   // The beginning of a navigation chain.
1138   ///
1139   TT_CHAIN_START_FLAG = 0x10000000,
1140
1141   ///
1142   // The last transition in a redirect chain.
1143   ///
1144   TT_CHAIN_END_FLAG = 0x20000000,
1145
1146   ///
1147   // Redirects caused by JavaScript or a meta refresh tag on the page.
1148   ///
1149   TT_CLIENT_REDIRECT_FLAG = 0x40000000,
1150
1151   ///
1152   // Redirects sent from the server by HTTP headers.
1153   ///
1154   TT_SERVER_REDIRECT_FLAG = 0x80000000,
1155
1156   ///
1157   // Used to test whether a transition involves a redirect.
1158   ///
1159   TT_IS_REDIRECT_MASK = 0xC0000000,
1160
1161   ///
1162   // General mask defining the bits used for the qualifiers.
1163   ///
1164   TT_QUALIFIER_MASK = 0xFFFFFF00,
1165 } cef_transition_type_t;
1166
1167 ///
1168 // Flags used to customize the behavior of CefURLRequest.
1169 ///
1170 typedef enum {
1171   ///
1172   // Default behavior.
1173   ///
1174   UR_FLAG_NONE                      = 0,
1175
1176   ///
1177   // If set the cache will be skipped when handling the request.
1178   ///
1179   UR_FLAG_SKIP_CACHE                = 1 << 0,
1180
1181   ///
1182   // If set user name, password, and cookies may be sent with the request, and
1183   // cookies may be saved from the response.
1184   ///
1185   UR_FLAG_ALLOW_CACHED_CREDENTIALS  = 1 << 1,
1186
1187   ///
1188   // If set upload progress events will be generated when a request has a body.
1189   ///
1190   UR_FLAG_REPORT_UPLOAD_PROGRESS    = 1 << 3,
1191
1192   ///
1193   // If set the headers sent and received for the request will be recorded.
1194   ///
1195   UR_FLAG_REPORT_RAW_HEADERS        = 1 << 5,
1196
1197   ///
1198   // If set the CefURLRequestClient::OnDownloadData method will not be called.
1199   ///
1200   UR_FLAG_NO_DOWNLOAD_DATA          = 1 << 6,
1201
1202   ///
1203   // If set 5XX redirect errors will be propagated to the observer instead of
1204   // automatically re-tried. This currently only applies for requests
1205   // originated in the browser process.
1206   ///
1207   UR_FLAG_NO_RETRY_ON_5XX           = 1 << 7,
1208 } cef_urlrequest_flags_t;
1209
1210 ///
1211 // Flags that represent CefURLRequest status.
1212 ///
1213 typedef enum {
1214   ///
1215   // Unknown status.
1216   ///
1217   UR_UNKNOWN = 0,
1218
1219   ///
1220   // Request succeeded.
1221   ///
1222   UR_SUCCESS,
1223
1224   ///
1225   // An IO request is pending, and the caller will be informed when it is
1226   // completed.
1227   ///
1228   UR_IO_PENDING,
1229
1230   ///
1231   // Request was canceled programatically.
1232   ///
1233   UR_CANCELED,
1234
1235   ///
1236   // Request failed for some reason.
1237   ///
1238   UR_FAILED,
1239 } cef_urlrequest_status_t;
1240
1241 ///
1242 // Structure representing a point.
1243 ///
1244 typedef struct _cef_point_t {
1245   int x;
1246   int y;
1247 } cef_point_t;
1248
1249 ///
1250 // Structure representing a rectangle.
1251 ///
1252 typedef struct _cef_rect_t {
1253   int x;
1254   int y;
1255   int width;
1256   int height;
1257 } cef_rect_t;
1258
1259 ///
1260 // Structure representing a size.
1261 ///
1262 typedef struct _cef_size_t {
1263   int width;
1264   int height;
1265 } cef_size_t;
1266
1267 ///
1268 // Existing process IDs.
1269 ///
1270 typedef enum {
1271   ///
1272   // Browser process.
1273   ///
1274   PID_BROWSER,
1275   ///
1276   // Renderer process.
1277   ///
1278   PID_RENDERER,
1279 } cef_process_id_t;
1280
1281 ///
1282 // Existing thread IDs.
1283 ///
1284 typedef enum {
1285 // BROWSER PROCESS THREADS -- Only available in the browser process.
1286
1287   ///
1288   // The main thread in the browser. This will be the same as the main
1289   // application thread if CefInitialize() is called with a
1290   // CefSettings.multi_threaded_message_loop value of false.
1291   ///
1292   TID_UI,
1293
1294   ///
1295   // Used to interact with the database.
1296   ///
1297   TID_DB,
1298
1299   ///
1300   // Used to interact with the file system.
1301   ///
1302   TID_FILE,
1303
1304   ///
1305   // Used for file system operations that block user interactions.
1306   // Responsiveness of this thread affects users.
1307   ///
1308   TID_FILE_USER_BLOCKING,
1309
1310   ///
1311   // Used to launch and terminate browser processes.
1312   ///
1313   TID_PROCESS_LAUNCHER,
1314
1315   ///
1316   // Used to handle slow HTTP cache operations.
1317   ///
1318   TID_CACHE,
1319
1320   ///
1321   // Used to process IPC and network messages.
1322   ///
1323   TID_IO,
1324
1325 // RENDER PROCESS THREADS -- Only available in the render process.
1326
1327   ///
1328   // The main thread in the renderer. Used for all WebKit and V8 interaction.
1329   ///
1330   TID_RENDERER,
1331 } cef_thread_id_t;
1332
1333 ///
1334 // Supported value types.
1335 ///
1336 typedef enum {
1337   VTYPE_INVALID = 0,
1338   VTYPE_NULL,
1339   VTYPE_BOOL,
1340   VTYPE_INT,
1341   VTYPE_DOUBLE,
1342   VTYPE_STRING,
1343   VTYPE_BINARY,
1344   VTYPE_DICTIONARY,
1345   VTYPE_LIST,
1346 } cef_value_type_t;
1347
1348 ///
1349 // Supported JavaScript dialog types.
1350 ///
1351 typedef enum {
1352   JSDIALOGTYPE_ALERT = 0,
1353   JSDIALOGTYPE_CONFIRM,
1354   JSDIALOGTYPE_PROMPT,
1355 } cef_jsdialog_type_t;
1356
1357 ///
1358 // Screen information used when window rendering is disabled. This structure is
1359 // passed as a parameter to CefRenderHandler::GetScreenInfo and should be filled
1360 // in by the client.
1361 ///
1362 typedef struct _cef_screen_info_t {
1363   ///
1364   // Device scale factor. Specifies the ratio between physical and logical
1365   // pixels.
1366   ///
1367   float device_scale_factor;
1368
1369   ///
1370   // The screen depth in bits per pixel.
1371   ///
1372   int depth;
1373
1374   ///
1375   // The bits per color component. This assumes that the colors are balanced
1376   // equally.
1377   ///
1378   int depth_per_component;
1379
1380   ///
1381   // This can be true for black and white printers.
1382   ///
1383   int is_monochrome;
1384
1385   ///
1386   // This is set from the rcMonitor member of MONITORINFOEX, to whit:
1387   //   "A RECT structure that specifies the display monitor rectangle,
1388   //   expressed in virtual-screen coordinates. Note that if the monitor
1389   //   is not the primary display monitor, some of the rectangle's
1390   //   coordinates may be negative values."
1391   //
1392   // The |rect| and |available_rect| properties are used to determine the
1393   // available surface for rendering popup views.
1394   ///
1395   cef_rect_t rect;
1396
1397   ///
1398   // This is set from the rcWork member of MONITORINFOEX, to whit:
1399   //   "A RECT structure that specifies the work area rectangle of the
1400   //   display monitor that can be used by applications, expressed in
1401   //   virtual-screen coordinates. Windows uses this rectangle to
1402   //   maximize an application on the monitor. The rest of the area in
1403   //   rcMonitor contains system windows such as the task bar and side
1404   //   bars. Note that if the monitor is not the primary display monitor,
1405   //   some of the rectangle's coordinates may be negative values".
1406   //
1407   // The |rect| and |available_rect| properties are used to determine the
1408   // available surface for rendering popup views.
1409   ///
1410   cef_rect_t available_rect;
1411 } cef_screen_info_t;
1412
1413 ///
1414 // Supported menu IDs. Non-English translations can be provided for the
1415 // IDS_MENU_* strings in CefResourceBundleHandler::GetLocalizedString().
1416 ///
1417 typedef enum {
1418   // Navigation.
1419   MENU_ID_BACK                = 100,
1420   MENU_ID_FORWARD             = 101,
1421   MENU_ID_RELOAD              = 102,
1422   MENU_ID_RELOAD_NOCACHE      = 103,
1423   MENU_ID_STOPLOAD            = 104,
1424
1425   // Editing.
1426   MENU_ID_UNDO                = 110,
1427   MENU_ID_REDO                = 111,
1428   MENU_ID_CUT                 = 112,
1429   MENU_ID_COPY                = 113,
1430   MENU_ID_PASTE               = 114,
1431   MENU_ID_DELETE              = 115,
1432   MENU_ID_SELECT_ALL          = 116,
1433
1434   // Miscellaneous.
1435   MENU_ID_FIND                = 130,
1436   MENU_ID_PRINT               = 131,
1437   MENU_ID_VIEW_SOURCE         = 132,
1438
1439   // Spell checking word correction suggestions.
1440   MENU_ID_SPELLCHECK_SUGGESTION_0        = 200,
1441   MENU_ID_SPELLCHECK_SUGGESTION_1        = 201,
1442   MENU_ID_SPELLCHECK_SUGGESTION_2        = 202,
1443   MENU_ID_SPELLCHECK_SUGGESTION_3        = 203,
1444   MENU_ID_SPELLCHECK_SUGGESTION_4        = 204,
1445   MENU_ID_SPELLCHECK_SUGGESTION_LAST     = 204,
1446   MENU_ID_NO_SPELLING_SUGGESTIONS        = 205,
1447   MENU_ID_ADD_TO_DICTIONARY              = 206,
1448
1449   // All user-defined menu IDs should come between MENU_ID_USER_FIRST and
1450   // MENU_ID_USER_LAST to avoid overlapping the Chromium and CEF ID ranges
1451   // defined in the tools/gritsettings/resource_ids file.
1452   MENU_ID_USER_FIRST          = 26500,
1453   MENU_ID_USER_LAST           = 28500,
1454 } cef_menu_id_t;
1455
1456 ///
1457 // Mouse button types.
1458 ///
1459 typedef enum {
1460   MBT_LEFT   = 0,
1461   MBT_MIDDLE,
1462   MBT_RIGHT,
1463 } cef_mouse_button_type_t;
1464
1465 ///
1466 // Structure representing mouse event information.
1467 ///
1468 typedef struct _cef_mouse_event_t {
1469   ///
1470   // X coordinate relative to the left side of the view.
1471   ///
1472   int x;
1473
1474   ///
1475   // Y coordinate relative to the top side of the view.
1476   ///
1477   int y;
1478
1479   ///
1480   // Bit flags describing any pressed modifier keys. See
1481   // cef_event_flags_t for values.
1482   ///
1483   uint32 modifiers;
1484 } cef_mouse_event_t;
1485
1486 ///
1487 // Paint element types.
1488 ///
1489 typedef enum {
1490   PET_VIEW  = 0,
1491   PET_POPUP,
1492 } cef_paint_element_type_t;
1493
1494 ///
1495 // Supported event bit flags.
1496 ///
1497 typedef enum {
1498   EVENTFLAG_NONE                = 0,
1499   EVENTFLAG_CAPS_LOCK_ON        = 1 << 0,
1500   EVENTFLAG_SHIFT_DOWN          = 1 << 1,
1501   EVENTFLAG_CONTROL_DOWN        = 1 << 2,
1502   EVENTFLAG_ALT_DOWN            = 1 << 3,
1503   EVENTFLAG_LEFT_MOUSE_BUTTON   = 1 << 4,
1504   EVENTFLAG_MIDDLE_MOUSE_BUTTON = 1 << 5,
1505   EVENTFLAG_RIGHT_MOUSE_BUTTON  = 1 << 6,
1506   // Mac OS-X command key.
1507   EVENTFLAG_COMMAND_DOWN        = 1 << 7,
1508   EVENTFLAG_NUM_LOCK_ON         = 1 << 8,
1509   EVENTFLAG_IS_KEY_PAD          = 1 << 9,
1510   EVENTFLAG_IS_LEFT             = 1 << 10,
1511   EVENTFLAG_IS_RIGHT            = 1 << 11,
1512 } cef_event_flags_t;
1513
1514 ///
1515 // Supported menu item types.
1516 ///
1517 typedef enum {
1518   MENUITEMTYPE_NONE,
1519   MENUITEMTYPE_COMMAND,
1520   MENUITEMTYPE_CHECK,
1521   MENUITEMTYPE_RADIO,
1522   MENUITEMTYPE_SEPARATOR,
1523   MENUITEMTYPE_SUBMENU,
1524 } cef_menu_item_type_t;
1525
1526 ///
1527 // Supported context menu type flags.
1528 ///
1529 typedef enum {
1530   ///
1531   // No node is selected.
1532   ///
1533   CM_TYPEFLAG_NONE        = 0,
1534   ///
1535   // The top page is selected.
1536   ///
1537   CM_TYPEFLAG_PAGE        = 1 << 0,
1538   ///
1539   // A subframe page is selected.
1540   ///
1541   CM_TYPEFLAG_FRAME       = 1 << 1,
1542   ///
1543   // A link is selected.
1544   ///
1545   CM_TYPEFLAG_LINK        = 1 << 2,
1546   ///
1547   // A media node is selected.
1548   ///
1549   CM_TYPEFLAG_MEDIA       = 1 << 3,
1550   ///
1551   // There is a textual or mixed selection that is selected.
1552   ///
1553   CM_TYPEFLAG_SELECTION   = 1 << 4,
1554   ///
1555   // An editable element is selected.
1556   ///
1557   CM_TYPEFLAG_EDITABLE    = 1 << 5,
1558 } cef_context_menu_type_flags_t;
1559
1560 ///
1561 // Supported context menu media types.
1562 ///
1563 typedef enum {
1564   ///
1565   // No special node is in context.
1566   ///
1567   CM_MEDIATYPE_NONE,
1568   ///
1569   // An image node is selected.
1570   ///
1571   CM_MEDIATYPE_IMAGE,
1572   ///
1573   // A video node is selected.
1574   ///
1575   CM_MEDIATYPE_VIDEO,
1576   ///
1577   // An audio node is selected.
1578   ///
1579   CM_MEDIATYPE_AUDIO,
1580   ///
1581   // A file node is selected.
1582   ///
1583   CM_MEDIATYPE_FILE,
1584   ///
1585   // A plugin node is selected.
1586   ///
1587   CM_MEDIATYPE_PLUGIN,
1588 } cef_context_menu_media_type_t;
1589
1590 ///
1591 // Supported context menu media state bit flags.
1592 ///
1593 typedef enum {
1594   CM_MEDIAFLAG_NONE                  = 0,
1595   CM_MEDIAFLAG_ERROR                 = 1 << 0,
1596   CM_MEDIAFLAG_PAUSED                = 1 << 1,
1597   CM_MEDIAFLAG_MUTED                 = 1 << 2,
1598   CM_MEDIAFLAG_LOOP                  = 1 << 3,
1599   CM_MEDIAFLAG_CAN_SAVE              = 1 << 4,
1600   CM_MEDIAFLAG_HAS_AUDIO             = 1 << 5,
1601   CM_MEDIAFLAG_HAS_VIDEO             = 1 << 6,
1602   CM_MEDIAFLAG_CONTROL_ROOT_ELEMENT  = 1 << 7,
1603   CM_MEDIAFLAG_CAN_PRINT             = 1 << 8,
1604   CM_MEDIAFLAG_CAN_ROTATE            = 1 << 9,
1605 } cef_context_menu_media_state_flags_t;
1606
1607 ///
1608 // Supported context menu edit state bit flags.
1609 ///
1610 typedef enum {
1611   CM_EDITFLAG_NONE            = 0,
1612   CM_EDITFLAG_CAN_UNDO        = 1 << 0,
1613   CM_EDITFLAG_CAN_REDO        = 1 << 1,
1614   CM_EDITFLAG_CAN_CUT         = 1 << 2,
1615   CM_EDITFLAG_CAN_COPY        = 1 << 3,
1616   CM_EDITFLAG_CAN_PASTE       = 1 << 4,
1617   CM_EDITFLAG_CAN_DELETE      = 1 << 5,
1618   CM_EDITFLAG_CAN_SELECT_ALL  = 1 << 6,
1619   CM_EDITFLAG_CAN_TRANSLATE   = 1 << 7,
1620 } cef_context_menu_edit_state_flags_t;
1621
1622 ///
1623 // Key event types.
1624 ///
1625 typedef enum {
1626   ///
1627   // Notification that a key transitioned from "up" to "down".
1628   ///
1629   KEYEVENT_RAWKEYDOWN = 0,
1630
1631   ///
1632   // Notification that a key was pressed. This does not necessarily correspond
1633   // to a character depending on the key and language. Use KEYEVENT_CHAR for
1634   // character input.
1635   ///
1636   KEYEVENT_KEYDOWN,
1637
1638   ///
1639   // Notification that a key was released.
1640   ///
1641   KEYEVENT_KEYUP,
1642
1643   ///
1644   // Notification that a character was typed. Use this for text input. Key
1645   // down events may generate 0, 1, or more than one character event depending
1646   // on the key, locale, and operating system.
1647   ///
1648   KEYEVENT_CHAR
1649 } cef_key_event_type_t;
1650
1651 ///
1652 // Structure representing keyboard event information.
1653 ///
1654 typedef struct _cef_key_event_t {
1655   ///
1656   // The type of keyboard event.
1657   ///
1658   cef_key_event_type_t type;
1659
1660   ///
1661   // Bit flags describing any pressed modifier keys. See
1662   // cef_event_flags_t for values.
1663   ///
1664   uint32 modifiers;
1665
1666   ///
1667   // The Windows key code for the key event. This value is used by the DOM
1668   // specification. Sometimes it comes directly from the event (i.e. on
1669   // Windows) and sometimes it's determined using a mapping function. See
1670   // WebCore/platform/chromium/KeyboardCodes.h for the list of values.
1671   ///
1672   int windows_key_code;
1673
1674   ///
1675   // The actual key code genenerated by the platform.
1676   ///
1677   int native_key_code;
1678
1679   ///
1680   // Indicates whether the event is considered a "system key" event (see
1681   // http://msdn.microsoft.com/en-us/library/ms646286(VS.85).aspx for details).
1682   // This value will always be false on non-Windows platforms.
1683   ///
1684   int is_system_key;
1685
1686   ///
1687   // The character generated by the keystroke.
1688   ///
1689   char16 character;
1690
1691   ///
1692   // Same as |character| but unmodified by any concurrently-held modifiers
1693   // (except shift). This is useful for working out shortcut keys.
1694   ///
1695   char16 unmodified_character;
1696
1697   ///
1698   // True if the focus is currently on an editable field on the page. This is
1699   // useful for determining if standard key events should be intercepted.
1700   ///
1701   int focus_on_editable_field;
1702 } cef_key_event_t;
1703
1704 ///
1705 // Focus sources.
1706 ///
1707 typedef enum {
1708   ///
1709   // The source is explicit navigation via the API (LoadURL(), etc).
1710   ///
1711   FOCUS_SOURCE_NAVIGATION = 0,
1712   ///
1713   // The source is a system-generated focus event.
1714   ///
1715   FOCUS_SOURCE_SYSTEM,
1716 } cef_focus_source_t;
1717
1718 ///
1719 // Navigation types.
1720 ///
1721 typedef enum {
1722   NAVIGATION_LINK_CLICKED = 0,
1723   NAVIGATION_FORM_SUBMITTED,
1724   NAVIGATION_BACK_FORWARD,
1725   NAVIGATION_RELOAD,
1726   NAVIGATION_FORM_RESUBMITTED,
1727   NAVIGATION_OTHER,
1728 } cef_navigation_type_t;
1729
1730 ///
1731 // Supported XML encoding types. The parser supports ASCII, ISO-8859-1, and
1732 // UTF16 (LE and BE) by default. All other types must be translated to UTF8
1733 // before being passed to the parser. If a BOM is detected and the correct
1734 // decoder is available then that decoder will be used automatically.
1735 ///
1736 typedef enum {
1737   XML_ENCODING_NONE = 0,
1738   XML_ENCODING_UTF8,
1739   XML_ENCODING_UTF16LE,
1740   XML_ENCODING_UTF16BE,
1741   XML_ENCODING_ASCII,
1742 } cef_xml_encoding_type_t;
1743
1744 ///
1745 // XML node types.
1746 ///
1747 typedef enum {
1748   XML_NODE_UNSUPPORTED = 0,
1749   XML_NODE_PROCESSING_INSTRUCTION,
1750   XML_NODE_DOCUMENT_TYPE,
1751   XML_NODE_ELEMENT_START,
1752   XML_NODE_ELEMENT_END,
1753   XML_NODE_ATTRIBUTE,
1754   XML_NODE_TEXT,
1755   XML_NODE_CDATA,
1756   XML_NODE_ENTITY_REFERENCE,
1757   XML_NODE_WHITESPACE,
1758   XML_NODE_COMMENT,
1759 } cef_xml_node_type_t;
1760
1761 ///
1762 // Popup window features.
1763 ///
1764 typedef struct _cef_popup_features_t {
1765   int x;
1766   int xSet;
1767   int y;
1768   int ySet;
1769   int width;
1770   int widthSet;
1771   int height;
1772   int heightSet;
1773
1774   int menuBarVisible;
1775   int statusBarVisible;
1776   int toolBarVisible;
1777   int locationBarVisible;
1778   int scrollbarsVisible;
1779   int resizable;
1780
1781   int fullscreen;
1782   int dialog;
1783   cef_string_list_t additionalFeatures;
1784 } cef_popup_features_t;
1785
1786 ///
1787 // DOM document types.
1788 ///
1789 typedef enum {
1790   DOM_DOCUMENT_TYPE_UNKNOWN = 0,
1791   DOM_DOCUMENT_TYPE_HTML,
1792   DOM_DOCUMENT_TYPE_XHTML,
1793   DOM_DOCUMENT_TYPE_PLUGIN,
1794 } cef_dom_document_type_t;
1795
1796 ///
1797 // DOM event category flags.
1798 ///
1799 typedef enum {
1800   DOM_EVENT_CATEGORY_UNKNOWN = 0x0,
1801   DOM_EVENT_CATEGORY_UI = 0x1,
1802   DOM_EVENT_CATEGORY_MOUSE = 0x2,
1803   DOM_EVENT_CATEGORY_MUTATION = 0x4,
1804   DOM_EVENT_CATEGORY_KEYBOARD = 0x8,
1805   DOM_EVENT_CATEGORY_TEXT = 0x10,
1806   DOM_EVENT_CATEGORY_COMPOSITION = 0x20,
1807   DOM_EVENT_CATEGORY_DRAG = 0x40,
1808   DOM_EVENT_CATEGORY_CLIPBOARD = 0x80,
1809   DOM_EVENT_CATEGORY_MESSAGE = 0x100,
1810   DOM_EVENT_CATEGORY_WHEEL = 0x200,
1811   DOM_EVENT_CATEGORY_BEFORE_TEXT_INSERTED = 0x400,
1812   DOM_EVENT_CATEGORY_OVERFLOW = 0x800,
1813   DOM_EVENT_CATEGORY_PAGE_TRANSITION = 0x1000,
1814   DOM_EVENT_CATEGORY_POPSTATE = 0x2000,
1815   DOM_EVENT_CATEGORY_PROGRESS = 0x4000,
1816   DOM_EVENT_CATEGORY_XMLHTTPREQUEST_PROGRESS = 0x8000,
1817 } cef_dom_event_category_t;
1818
1819 ///
1820 // DOM event processing phases.
1821 ///
1822 typedef enum {
1823   DOM_EVENT_PHASE_UNKNOWN = 0,
1824   DOM_EVENT_PHASE_CAPTURING,
1825   DOM_EVENT_PHASE_AT_TARGET,
1826   DOM_EVENT_PHASE_BUBBLING,
1827 } cef_dom_event_phase_t;
1828
1829 ///
1830 // DOM node types.
1831 ///
1832 typedef enum {
1833   DOM_NODE_TYPE_UNSUPPORTED = 0,
1834   DOM_NODE_TYPE_ELEMENT,
1835   DOM_NODE_TYPE_ATTRIBUTE,
1836   DOM_NODE_TYPE_TEXT,
1837   DOM_NODE_TYPE_CDATA_SECTION,
1838   DOM_NODE_TYPE_PROCESSING_INSTRUCTIONS,
1839   DOM_NODE_TYPE_COMMENT,
1840   DOM_NODE_TYPE_DOCUMENT,
1841   DOM_NODE_TYPE_DOCUMENT_TYPE,
1842   DOM_NODE_TYPE_DOCUMENT_FRAGMENT,
1843 } cef_dom_node_type_t;
1844
1845 ///
1846 // Supported file dialog modes.
1847 ///
1848 typedef enum {
1849   ///
1850   // Requires that the file exists before allowing the user to pick it.
1851   ///
1852   FILE_DIALOG_OPEN = 0,
1853
1854   ///
1855   // Like Open, but allows picking multiple files to open.
1856   ///
1857   FILE_DIALOG_OPEN_MULTIPLE,
1858
1859   ///
1860   // Like Open, but selects a folder to open.
1861   ///
1862   FILE_DIALOG_OPEN_FOLDER,
1863
1864   ///
1865   // Allows picking a nonexistent file, and prompts to overwrite if the file
1866   // already exists.
1867   ///
1868   FILE_DIALOG_SAVE,
1869
1870   ///
1871   // General mask defining the bits used for the type values.
1872   ///
1873   FILE_DIALOG_TYPE_MASK = 0xFF,
1874
1875   // Qualifiers.
1876   // Any of the type values above can be augmented by one or more qualifiers.
1877   // These qualifiers further define the dialog behavior.
1878
1879   ///
1880   // Prompt to overwrite if the user selects an existing file with the Save
1881   // dialog.
1882   ///
1883   FILE_DIALOG_OVERWRITEPROMPT_FLAG = 0x01000000,
1884
1885   ///
1886   // Do not display read-only files.
1887   ///
1888   FILE_DIALOG_HIDEREADONLY_FLAG = 0x02000000,
1889 } cef_file_dialog_mode_t;
1890
1891 ///
1892 // Geoposition error codes.
1893 ///
1894 typedef enum {
1895   GEOPOSITON_ERROR_NONE = 0,
1896   GEOPOSITON_ERROR_PERMISSION_DENIED,
1897   GEOPOSITON_ERROR_POSITION_UNAVAILABLE,
1898   GEOPOSITON_ERROR_TIMEOUT,
1899 } cef_geoposition_error_code_t;
1900
1901 ///
1902 // Structure representing geoposition information. The properties of this
1903 // structure correspond to those of the JavaScript Position object although
1904 // their types may differ.
1905 ///
1906 typedef struct _cef_geoposition_t {
1907   ///
1908   // Latitude in decimal degrees north (WGS84 coordinate frame).
1909   ///
1910   double latitude;
1911
1912   ///
1913   // Longitude in decimal degrees west (WGS84 coordinate frame).
1914   ///
1915   double longitude;
1916
1917   ///
1918   // Altitude in meters (above WGS84 datum).
1919   ///
1920   double altitude;
1921
1922   ///
1923   // Accuracy of horizontal position in meters.
1924   ///
1925   double accuracy;
1926
1927   ///
1928   // Accuracy of altitude in meters.
1929   ///
1930   double altitude_accuracy;
1931
1932   ///
1933   // Heading in decimal degrees clockwise from true north.
1934   ///
1935   double heading;
1936
1937   ///
1938   // Horizontal component of device velocity in meters per second.
1939   ///
1940   double speed;
1941
1942   ///
1943   // Time of position measurement in milliseconds since Epoch in UTC time. This
1944   // is taken from the host computer's system clock.
1945   ///
1946   cef_time_t timestamp;
1947
1948   ///
1949   // Error code, see enum above.
1950   ///
1951   cef_geoposition_error_code_t error_code;
1952
1953   ///
1954   // Human-readable error message.
1955   ///
1956   cef_string_t error_message;
1957 } cef_geoposition_t;
1958
1959 ///
1960 // Print job color mode values.
1961 ///
1962 typedef enum {
1963   COLOR_MODEL_UNKNOWN,
1964   COLOR_MODEL_GRAY,
1965   COLOR_MODEL_COLOR,
1966   COLOR_MODEL_CMYK,
1967   COLOR_MODEL_CMY,
1968   COLOR_MODEL_KCMY,
1969   COLOR_MODEL_CMY_K,  // CMY_K represents CMY+K.
1970   COLOR_MODEL_BLACK,
1971   COLOR_MODEL_GRAYSCALE,
1972   COLOR_MODEL_RGB,
1973   COLOR_MODEL_RGB16,
1974   COLOR_MODEL_RGBA,
1975   COLOR_MODEL_COLORMODE_COLOR,  // Used in samsung printer ppds.
1976   COLOR_MODEL_COLORMODE_MONOCHROME,  // Used in samsung printer ppds.
1977   COLOR_MODEL_HP_COLOR_COLOR,  // Used in HP color printer ppds.
1978   COLOR_MODEL_HP_COLOR_BLACK,  // Used in HP color printer ppds.
1979   COLOR_MODEL_PRINTOUTMODE_NORMAL,  // Used in foomatic ppds.
1980   COLOR_MODEL_PRINTOUTMODE_NORMAL_GRAY,  // Used in foomatic ppds.
1981   COLOR_MODEL_PROCESSCOLORMODEL_CMYK,  // Used in canon printer ppds.
1982   COLOR_MODEL_PROCESSCOLORMODEL_GREYSCALE,  // Used in canon printer ppds.
1983   COLOR_MODEL_PROCESSCOLORMODEL_RGB,  // Used in canon printer ppds
1984 } cef_color_model_t;
1985
1986 ///
1987 // Print job duplex mode values.
1988 ///
1989 typedef enum {
1990   DUPLEX_MODE_UNKNOWN = -1,
1991   DUPLEX_MODE_SIMPLEX,
1992   DUPLEX_MODE_LONG_EDGE,
1993   DUPLEX_MODE_SHORT_EDGE,
1994 } cef_duplex_mode_t;
1995
1996 ///
1997 // Structure representing a print job page range.
1998 ///
1999 typedef struct _cef_page_range_t {
2000   int from;
2001   int to;
2002 } cef_page_range_t;
2003
2004 ///
2005 // Cursor type values.
2006 ///
2007 typedef enum {
2008   CT_POINTER = 0,
2009   CT_CROSS,
2010   CT_HAND,
2011   CT_IBEAM,
2012   CT_WAIT,
2013   CT_HELP,
2014   CT_EASTRESIZE,
2015   CT_NORTHRESIZE,
2016   CT_NORTHEASTRESIZE,
2017   CT_NORTHWESTRESIZE,
2018   CT_SOUTHRESIZE,
2019   CT_SOUTHEASTRESIZE,
2020   CT_SOUTHWESTRESIZE,
2021   CT_WESTRESIZE,
2022   CT_NORTHSOUTHRESIZE,
2023   CT_EASTWESTRESIZE,
2024   CT_NORTHEASTSOUTHWESTRESIZE,
2025   CT_NORTHWESTSOUTHEASTRESIZE,
2026   CT_COLUMNRESIZE,
2027   CT_ROWRESIZE,
2028   CT_MIDDLEPANNING,
2029   CT_EASTPANNING,
2030   CT_NORTHPANNING,
2031   CT_NORTHEASTPANNING,
2032   CT_NORTHWESTPANNING,
2033   CT_SOUTHPANNING,
2034   CT_SOUTHEASTPANNING,
2035   CT_SOUTHWESTPANNING,
2036   CT_WESTPANNING,
2037   CT_MOVE,
2038   CT_VERTICALTEXT,
2039   CT_CELL,
2040   CT_CONTEXTMENU,
2041   CT_ALIAS,
2042   CT_PROGRESS,
2043   CT_NODROP,
2044   CT_COPY,
2045   CT_NONE,
2046   CT_NOTALLOWED,
2047   CT_ZOOMIN,
2048   CT_ZOOMOUT,
2049   CT_GRAB,
2050   CT_GRABBING,
2051   CT_CUSTOM,
2052 } cef_cursor_type_t;
2053
2054 ///
2055 // Structure representing cursor information. |buffer| will be
2056 // |size.width|*|size.height|*4 bytes in size and represents a BGRA image with
2057 // an upper-left origin.
2058 ///
2059 typedef struct _cef_cursor_info_t {
2060   cef_point_t hotspot;
2061   float image_scale_factor;
2062   void* buffer;
2063   cef_size_t size;
2064 } cef_cursor_info_t;
2065
2066 ///
2067 // URI unescape rules passed to CefURIDecode().
2068 ///
2069 typedef enum {
2070   ///
2071   // Don't unescape anything at all.
2072   ///
2073   UU_NONE = 0,
2074
2075   ///
2076   // Don't unescape anything special, but all normal unescaping will happen.
2077   // This is a placeholder and can't be combined with other flags (since it's
2078   // just the absence of them). All other unescape rules imply "normal" in
2079   // addition to their special meaning. Things like escaped letters, digits,
2080   // and most symbols will get unescaped with this mode.
2081   ///
2082   UU_NORMAL = 1,
2083
2084   ///
2085   // Convert %20 to spaces. In some places where we're showing URLs, we may
2086   // want this. In places where the URL may be copied and pasted out, then
2087   // you wouldn't want this since it might not be interpreted in one piece
2088   // by other applications.
2089   ///
2090   UU_SPACES = 2,
2091
2092   ///
2093   // Unescapes various characters that will change the meaning of URLs,
2094   // including '%', '+', '&', '/', '#'. If we unescaped these characters, the
2095   // resulting URL won't be the same as the source one. This flag is used when
2096   // generating final output like filenames for URLs where we won't be
2097   // interpreting as a URL and want to do as much unescaping as possible.
2098   ///
2099   UU_URL_SPECIAL_CHARS = 4,
2100
2101   ///
2102   // Unescapes control characters such as %01. This INCLUDES NULLs. This is
2103   // used for rare cases such as data: URL decoding where the result is binary
2104   // data. This flag also unescapes BiDi control characters.
2105   //
2106   // DO NOT use CONTROL_CHARS if the URL is going to be displayed in the UI
2107   // for security reasons.
2108   ///
2109   UU_CONTROL_CHARS = 8,
2110
2111   ///
2112   // URL queries use "+" for space. This flag controls that replacement.
2113   ///
2114   UU_REPLACE_PLUS_WITH_SPACE = 16,
2115 } cef_uri_unescape_rule_t;
2116
2117 #ifdef __cplusplus
2118 }
2119 #endif
2120
2121 #endif  // CEF_INCLUDE_INTERNAL_CEF_TYPES_H_