libyui-gtk  2.44.9
ygtkrichtext.h
1 /********************************************************************
2  * YaST2-GTK - http://en.opensuse.org/YaST2-GTK *
3  ********************************************************************/
4 
5 /* YGtkRichText is a very simple widget that displays HTML code.
6  It was done, since GTK+ doesn't offer one out of box, and to
7  avoid dependencies.
8 */
9 
10 #ifndef YGTK_RICH_TEXT_H
11 #define YGTK_RICH_TEXT_H
12 
13 #include "ygtktextview.h"
14 G_BEGIN_DECLS
15 
16 #define YGTK_TYPE_RICH_TEXT (ygtk_rich_text_get_type ())
17 #define YGTK_RICH_TEXT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
18  YGTK_TYPE_RICH_TEXT, YGtkRichText))
19 #define YGTK_RICH_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), \
20  YGTK_TYPE_RICH_TEXT, YGtkRichTextClass))
21 #define YGTK_IS_RICH_TEXT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
22  YGTK_TYPE_RICH_TEXT))
23 #define YGTK_IS_RICH_TEXT_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), \
24  YGTK_TYPE_RICH_TEXT))
25 #define YGTK_RICH_TEXT_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
26  YGTK_TYPE_RICH_TEXT, YGtkRichTextClass))
27 
28 typedef struct _YGtkRichText
29 {
30  YGtkTextView parent;
31  // members:
32  GdkCursor *hand_cursor;
33  GdkPixbuf *background_pixbuf;
34 } YGtkRichText;
35 
36 typedef struct _YGtkRichTextClass
37 {
38  YGtkTextViewClass parent_class;
39 
40  // signals:
41  void (*link_clicked) (YGtkRichText *rich_text, const gchar *link);
43 
44 GtkWidget *ygtk_rich_text_new (void);
45 GType ygtk_rich_text_get_type (void) G_GNUC_CONST;
46 
47 /* Sets some text to YGtkRichText, may be HTML or plain text, as indicated by
48  rich_text. */
49 void ygtk_rich_text_set_text (YGtkRichText* rtext, const gchar* text);
50 void ygtk_rich_text_set_plain_text (YGtkRichText* rtext, const gchar* text);
51 
52 // To be used together with an entry box to search for text
53 gboolean ygtk_rich_text_mark_text (YGtkRichText *rtext, const gchar *text);
54 gboolean ygtk_rich_text_forward_mark (YGtkRichText *rtext, const gchar *text); // F3
55 
56 void ygtk_rich_text_set_background (YGtkRichText *rtext, GdkPixbuf *pixbuf);
57 
58 G_END_DECLS
59 #endif /* YGTK_RICH_TEXT_H */
60 
_YGtkRichTextClass
Definition: ygtkrichtext.h:36
_YGtkTextView
Definition: ygtktextview.h:27
_YGtkTextViewClass
Definition: ygtktextview.h:32
_YGtkRichText
Definition: ygtkrichtext.h:28