pidgin/gtkimhtml.h

changeset 26378
e85d894af8a5
parent 25900
0be61f1b3dd1
child 26727
b8885bab55ab
equal deleted inserted replaced
26377:9124a345ed3a 26378:e85d894af8a5
58 typedef struct _GtkIMHtmlScalable GtkIMHtmlScalable; 58 typedef struct _GtkIMHtmlScalable GtkIMHtmlScalable;
59 typedef struct _GtkIMHtmlImage GtkIMHtmlImage; 59 typedef struct _GtkIMHtmlImage GtkIMHtmlImage;
60 typedef struct _GtkIMHtmlAnimation GtkIMHtmlAnimation; 60 typedef struct _GtkIMHtmlAnimation GtkIMHtmlAnimation;
61 typedef struct _GtkIMHtmlHr GtkIMHtmlHr; 61 typedef struct _GtkIMHtmlHr GtkIMHtmlHr;
62 typedef struct _GtkIMHtmlFuncs GtkIMHtmlFuncs; 62 typedef struct _GtkIMHtmlFuncs GtkIMHtmlFuncs;
63
64 /**
65 * @since 2.6.0
66 */
67 typedef struct _GtkIMHtmlLink GtkIMHtmlLink;
63 68
64 typedef enum { 69 typedef enum {
65 GTK_IMHTML_BOLD = 1 << 0, 70 GTK_IMHTML_BOLD = 1 << 0,
66 GTK_IMHTML_ITALIC = 1 << 1, 71 GTK_IMHTML_ITALIC = 1 << 1,
67 GTK_IMHTML_UNDERLINE = 1 << 2, 72 GTK_IMHTML_UNDERLINE = 1 << 2,
154 void (*clear_format)(GtkIMHtml *); 159 void (*clear_format)(GtkIMHtml *);
155 void (*update_format)(GtkIMHtml *); 160 void (*update_format)(GtkIMHtml *);
156 gboolean (*message_send)(GtkIMHtml *); 161 gboolean (*message_send)(GtkIMHtml *);
157 void (*undo)(GtkIMHtml *); 162 void (*undo)(GtkIMHtml *);
158 void (*redo)(GtkIMHtml *); 163 void (*redo)(GtkIMHtml *);
164 GList *protocols; /* List of GtkIMHtmlProtocol's */
159 }; 165 };
160 166
161 struct _GtkIMHtmlFontDetail { 167 struct _GtkIMHtmlFontDetail {
162 gushort size; 168 gushort size;
163 gchar *face; 169 gchar *face;
883 * @param smiley The smiley to destroy 889 * @param smiley The smiley to destroy
884 * 890 *
885 * @since 2.5.0 891 * @since 2.5.0
886 */ 892 */
887 void gtk_imhtml_smiley_destroy(GtkIMHtmlSmiley *smiley); 893 void gtk_imhtml_smiley_destroy(GtkIMHtmlSmiley *smiley);
894
895 /**
896 * Register a protocol with the GtkIMHtml widget. Registering a protocol would
897 * allow certain text to be clickable.
898 *
899 * @param name The name of the protocol (e.g. http://)
900 * @param activate The callback to trigger when the protocol text is clicked.
901 * Removes any current protocol definition if @c NULL. The
902 * callback should return @c TRUE if the link was activated
903 * properly, @c FALSE otherwise.
904 * @param context_menu The callback to trigger when the context menu is popped
905 * up on the protocol text. The callback should return
906 * @c TRUE if the request for context menu was processed
907 * successfully, @c FALSE otherwise.
908 *
909 * @return @c TRUE if the protocol was successfully registered (or unregistered, when #activate is @c NULL)
910 *
911 * @since 2.6.0
912 */
913 gboolean gtk_imhtml_class_register_protocol(const char *name,
914 gboolean (*activate)(GtkIMHtml *imhtml, GtkIMHtmlLink *link),
915 gboolean (*context_menu)(GtkIMHtml *imhtml, GtkIMHtmlLink *link, GtkWidget *menu));
916
917 /**
918 * Get the URL associated with a link. This should be used by the IMHtml protocol-callbacks.
919 *
920 * @param link The GtkIMHtmlLink object sent to the callback functions
921 *
922 * @return The URL
923 *
924 * @since 2.6.0
925 */
926 const char *gtk_imhtml_link_get_url(GtkIMHtmlLink *link);
927
928 /**
929 * Get the GtkTextTag object (if any) associated with a particular link.
930 *
931 * @param link The GtkIMHtmlLink object sent to the callback functions
932 *
933 * @return The GtkTextTag object, or @c NULL
934 *
935 * @since 2.6.0
936 */
937 const GtkTextTag *gtk_imhtml_link_get_text_tag(GtkIMHtmlLink *link);
938
939 /**
940 * Activates a GtkIMHtmlLink object. This triggers the 'url-clicked' signal, marks the
941 * link as visited (when possible).
942 *
943 * @param link The GtkIMHtmlLink object sent to the callback functions
944 *
945 * @return @c TRUE if 'url-clicked' signal was emitted, @c FALSE otherwise.
946 *
947 * @since 2.6.0
948 */
949 gboolean gtk_imhtml_link_activate(GtkIMHtmlLink *link);
950
951 /**
952 * By default this widget intercepts presses of the "return" key and
953 * emits the "message_send" signal instead. If you don't want this
954 * behavior, and you want the standard GtkTextView behavior of
955 * inserting a newline into the buffer, then call this function.
956 *
957 * @param imhtml The GtkIMHtml where you want the "return" key to add
958 * newline and not emit the "message_send" signal.
959 */
960 void gtk_imhtml_set_return_inserts_newline(GtkIMHtml *imhtml);
961
888 /*@}*/ 962 /*@}*/
889 963
890 #ifdef __cplusplus 964 #ifdef __cplusplus
891 } 965 }
892 #endif 966 #endif

mercurial