gtk-khtml.h
来自「khtml在gtk上的移植版本」· C头文件 代码 · 共 515 行 · 第 1/2 页
H
515 行
/* * Copyright (c) 2004 Nokia. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the * distribution. * * Neither the name of Nokia nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. */#include <glib.h>#include <glib-object.h>#ifndef __GTK_KHTML_H__#define __GTK_KHTML_H__/** * Gtk API for KHTML library. * * Straight C API to use KHTML library. * work in progress, suggestions and patches welcome. * * currently coding standards follow gtk coding standards * except for indenting (gnu style) * * current documentation written in doxygen format, but * may be chaged to glib/gtk format. */#ifdef __cplusplusextern "C" {#endif /* __cplusplus */#include <gtk/gtk.h>/* * Type checking and casting macros */#define GTK_TYPE_KHTML (gtk_khtml_get_type())#define GTK_KHTML(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), gtk_khtml_get_type(), GtkKHTML)#define GTK_KHTML_CONST(obj) G_TYPE_CHECK_INSTANCE_CAST((obj), gtk_khtml_get_type(), GtkKHTML const)#define GTK_KHTML_CLASS(klass) G_TYPE_CHECK_CLASS_CAST((klass), gtk_khtml_get_type(), GtkKHTMLClass)#define GTK_IS_KHTML(obj) G_TYPE_CHECK_INSTANCE_TYPE((obj), gtk_khtml_get_type ())#define GTK_KHTML_GET_CLASS(obj) G_TYPE_INSTANCE_GET_CLASS((obj), gtk_khtml_get_type(), GtkKHTMLClass)/* Private structure type */typedef struct _GtkKHTMLPrivate GtkKHTMLPrivate;/* * Main object structure */typedef struct _GtkKHTML GtkKHTML;struct _GtkKHTML { GtkBin __parent__; /*< private >*/ GtkKHTMLPrivate *_priv;};/** Rendering engine settings structure * Rendering engine settings structure. */typedef struct _GtkKHTMLSettings GtkKHTMLSettings;struct _GtkKHTMLSettings { gboolean javascript_enabled; gboolean java_enabled; gboolean plugins_enabled; gboolean autoload_images; gfloat minimum_font_size; gfloat default_font_size; gfloat default_fixed_font_size; const gchar* default_text_encoding; const gchar* serif_font_family; const gchar* sans_serif_font_family; const gchar* fixed_font_family; const gchar* standard_font_family; const gchar* cursive_font_family; const gchar* fantasy_font_family; /** Full url (including port) of the proxy to use. If NULL, empty (""), */ const gchar* http_proxy; };typedef struct _GtkKHTMLLoadStatus GtkKHTMLLoadStatus;/** Type of the status message. */typedef enum{ /** Report start loading a resource */ GTK_KHTML_LOADING_START, /** Report progress in loading a resource */ GTK_KHTML_LOADING, /** Report a successful resource load */ GTK_KHTML_LOADING_COMPLETE, /** Report an error in resource loading. */ GTK_KHTML_LOADING_ERROR } GtkKHTMLStatus;/** Status message. */struct _GtkKHTMLLoadStatus { /** Status of the loading process. */ GtkKHTMLStatus status; /** Number of files to download */ guint files; /** Number of files received with Content-Length set*/ guint filesWithSize; /** Number of files received */ guint ready; /** Bytes available for resource. */ guint size; /** Bytes received from resource. */ guint received; /** Total size of the resources including those that didn't have Content-Length set. */ guint totalSize; /** Bytes received total. */ guint totalReceived; /** Error code. */ gint statusCode;}; typedef struct _GtkKHTMLPromptArgs GtkKHTMLPromptArgs;/** Type of message prompt if message prompt was an alert (ok button), confirm (yes/no) or input (textfield, ok, cancel). */typedef enum{ /** alert (ok button)*/ GTK_KHTML_ALERT, /**confirm (yes/no)*/ GTK_KHTML_CONFIRM, /**or input (textfield, ok, cancel) */ GTK_KHTML_INPUT} GtkKHTMLPromptType;/** Structure used to pass arguments of javascript prompt messages */struct _GtkKHTMLPromptArgs{ /*<public>*/ /** Flag specifying if message prompt was an alert (ok button), confirm (yes/no) or * input (textfield, ok, cancel). */ GtkKHTMLPromptType type; /** The prompt message*/ const gchar* msg; /** default input text. * if type == GTK_KHTML_INPUT contains default input text to be shown in input field */ const gchar* default_input; /** text entered in the prompt textfield * should be set if type == GTK_KHTML_INPUT * string will be deallocated by signaller with g_free(). * ie. there's an ownership change. */ gchar* out_input; /** flag specifying if the button pressed was ok or cancel, yes or no * \TRUE means ok or yes * \FALSE means cancel or no */ gboolean out_ok_pressed; };typedef struct _GtkKHTMLAuthArgs GtkKHTMLAuthArgs;/** Structure used to pass arguments of javascript prompt messages */struct _GtkKHTMLAuthArgs{ /*< public >*/ /** realm of authentication */ const gchar* realm; /** Out parameter containing username from user. * string will be deallocated by caller with g_free(). * ie. there's an ownership change.*/ gchar* out_username; /** Out parameter containing password from user. * string will be deallocated by caller with g_free() * ie. there's an ownership change. */ gchar* out_password; /** flag specifying if the button pressed was ok or cancel * \TRUE means ok * \FALSE otherwise */ gboolean out_ok_pressed; }; /* * Class definition */typedef struct _GtkKHTMLClass GtkKHTMLClass;struct _GtkKHTMLClass { GtkBinClass __parent__; /*signals*/ /** Location change indication signal. * use \gtk_khtml_get_location() to get the url string * @emited when current page changes. * @param self the engine which sent the signal */ void (* location) (GtkKHTML * self); /** Title change indication signal. * use \gtk_khtml_get_title() to get the title string * @emited when title of current page changes. * @param self the engine which sent the signal */ void (* title) (GtkKHTML * self); /** Progress change indication signal. * FIXME: NOT EMITED AT THE MOMENT. * might change in the future
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?