1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
|
/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
/* gtkhtml-editor.h
*
* Copyright (C) 2008 Novell, Inc.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of version 2 of the GNU Lesser General Public
* License as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef GTKHTML_EDITOR_H
#define GTKHTML_EDITOR_H
#include <gtkhtml/gtkhtml.h>
#include <gtkhtml-editor-common.h>
#include <gtkhtml-editor-actions.h>
#include <gtkhtml-editor-widgets.h>
#include <gtkhtml-spell-checker.h>
#include <gtkhtml-spell-language.h>
#include <stdarg.h>
/* Standard GObject macros */
#define GTKHTML_TYPE_EDITOR \
(gtkhtml_editor_get_type ())
#define GTKHTML_EDITOR(obj) \
(G_TYPE_CHECK_INSTANCE_CAST \
((obj), GTKHTML_TYPE_EDITOR, GtkhtmlEditor))
#define GTKHTML_EDITOR_CLASS(cls) \
(G_TYPE_CHECK_CLASS_CAST \
((cls), GTKHTML_TYPE_EDITOR, GtkhtmlEditorClass))
#define GTKHTML_IS_EDITOR(obj) \
(G_TYPE_CHECK_INSTANCE_TYPE \
((obj), GTKHTML_TYPE_EDITOR))
#define GTKHTML_IS_EDITOR_CLASS(cls) \
(G_TYPE_CHECK_CLASS_TYPE \
((cls), GTKHTML_TYPE_EDITOR))
#define GTKHTML_EDITOR_GET_CLASS(obj) \
(G_TYPE_INSTANCE_GET_CLASS \
((obj), GTKHTML_TYPE_EDITOR, GtkhtmlEditorClass))
G_BEGIN_DECLS
typedef struct _GtkhtmlEditor GtkhtmlEditor;
typedef struct _GtkhtmlEditorClass GtkhtmlEditorClass;
typedef struct _GtkhtmlEditorPrivate GtkhtmlEditorPrivate;
struct _GtkhtmlEditor {
GtkWindow parent;
GtkWidget *vbox;
GtkhtmlEditorPrivate *priv;
};
struct _GtkhtmlEditorClass {
GtkWindowClass parent_class;
void (*cut_clipboard) (GtkhtmlEditor *editor);
void (*copy_clipboard) (GtkhtmlEditor *editor);
void (*paste_clipboard) (GtkhtmlEditor *editor);
void (*select_all) (GtkhtmlEditor *editor);
/* GtkHTML events */
void (*command_before) (GtkhtmlEditor *editor,
const gchar *command);
void (*command_after) (GtkhtmlEditor *editor,
const gchar *command);
gchar * (*image_uri) (GtkhtmlEditor *editor,
const gchar *uri);
void (*link_clicked) (GtkhtmlEditor *editor,
const gchar *uri);
void (*object_deleted) (GtkhtmlEditor *editor);
void (*uri_requested) (GtkhtmlEditor *editor,
const gchar *uri,
GtkHTMLStream *stream);
};
GType gtkhtml_editor_get_type (void);
GtkWidget * gtkhtml_editor_new (void);
GtkHTML * gtkhtml_editor_get_html (GtkhtmlEditor *editor);
GtkBuilder * gtkhtml_editor_get_builder (GtkhtmlEditor *editor);
GtkUIManager * gtkhtml_editor_get_ui_manager (GtkhtmlEditor *editor);
GtkAction * gtkhtml_editor_get_action (GtkhtmlEditor *editor,
const gchar *action_name);
GtkActionGroup *gtkhtml_editor_get_action_group (GtkhtmlEditor *editor,
const gchar *group_name);
GtkWidget * gtkhtml_editor_get_widget (GtkhtmlEditor *editor,
const gchar *widget_name);
GtkWidget * gtkhtml_editor_get_managed_widget
(GtkhtmlEditor *editor,
const gchar *widget_path);
gboolean gtkhtml_editor_get_changed (GtkhtmlEditor *editor);
void gtkhtml_editor_set_changed (GtkhtmlEditor *editor,
gboolean changed);
const gchar * gtkhtml_editor_get_filename (GtkhtmlEditor *editor);
void gtkhtml_editor_set_filename (GtkhtmlEditor *editor,
const gchar *filename);
gboolean gtkhtml_editor_get_html_mode (GtkhtmlEditor *editor);
void gtkhtml_editor_set_html_mode (GtkhtmlEditor *editor,
gboolean html_mode);
gboolean gtkhtml_editor_get_inline_spelling
(GtkhtmlEditor *editor);
void gtkhtml_editor_set_inline_spelling
(GtkhtmlEditor *editor,
gboolean inline_spelling);
gboolean gtkhtml_editor_get_magic_links (GtkhtmlEditor *editor);
void gtkhtml_editor_set_magic_links (GtkhtmlEditor *editor,
gboolean magic_links);
gboolean gtkhtml_editor_get_magic_smileys
(GtkhtmlEditor *editor);
void gtkhtml_editor_set_magic_smileys
(GtkhtmlEditor *editor,
gboolean magic_smileys);
GList * gtkhtml_editor_get_spell_languages
(GtkhtmlEditor *editor);
void gtkhtml_editor_set_spell_languages
(GtkhtmlEditor *editor,
GList *spell_languages);
/*****************************************************************************
* High-Level Editing Interface
*****************************************************************************/
gchar * gtkhtml_editor_get_text_html (GtkhtmlEditor *editor,
gsize *length);
gchar * gtkhtml_editor_get_text_plain (GtkhtmlEditor *editor,
gsize *length);
void gtkhtml_editor_set_text_html (GtkhtmlEditor *editor,
const gchar *text,
gssize length);
gboolean gtkhtml_editor_save (GtkhtmlEditor *editor,
const gchar *filename,
gboolean as_html,
GError **error);
const gchar * gtkhtml_editor_get_paragraph_data
(GtkhtmlEditor *editor,
const gchar *key);
gboolean gtkhtml_editor_set_paragraph_data
(GtkhtmlEditor *editor,
const gchar *key,
const gchar *value);
gboolean gtkhtml_editor_run_command (GtkhtmlEditor *editor,
const gchar *command);
gboolean gtkhtml_editor_is_paragraph_empty
(GtkhtmlEditor *editor);
gboolean gtkhtml_editor_is_previous_paragraph_empty
(GtkhtmlEditor *editor);
void gtkhtml_editor_insert_html (GtkhtmlEditor *editor,
const gchar *html_text);
void gtkhtml_editor_insert_image (GtkhtmlEditor *editor,
const gchar *image_uri);
void gtkhtml_editor_insert_text (GtkhtmlEditor *editor,
const gchar *plain_text);
gboolean gtkhtml_editor_search_by_data (GtkhtmlEditor *editor,
glong level,
const gchar *klass,
const gchar *key,
const gchar *value);
void gtkhtml_editor_freeze (GtkhtmlEditor *editor);
void gtkhtml_editor_thaw (GtkhtmlEditor *editor);
void gtkhtml_editor_undo_begin (GtkhtmlEditor *editor,
const gchar *undo_name,
const gchar *redo_name);
void gtkhtml_editor_undo_end (GtkhtmlEditor *editor);
gboolean gtkhtml_editor_has_undo (GtkhtmlEditor *editor);
void gtkhtml_editor_drop_undo (GtkhtmlEditor *editor);
G_END_DECLS
#endif /* GTKHTML_EDITOR_H */
|