1 
2 #ifndef __XED_SEARCHBAR_H__
3 #define __XED_SEARCHBAR_H__
4 
5 #include <gtk/gtk.h>
6 #include <gtksourceview/gtksource.h>
7 #include "xed-window.h"
8 
9 G_BEGIN_DECLS
10 
11 #define XED_TYPE_SEARCHBAR              (xed_searchbar_get_type())
12 #define XED_SEARCHBAR(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), XED_TYPE_SEARCHBAR, XedSearchbar))
13 #define XED_SEARCHBAR_CONST(obj)        (G_TYPE_CHECK_INSTANCE_CAST((obj), XED_TYPE_SEARCHBAR, XedSearchbar const))
14 #define XED_SEARCHBAR_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), XED_TYPE_SEARCHBAR, XedSearchbarClass))
15 #define XED_IS_SEARCHBAR(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), XED_TYPE_SEARCHBAR))
16 #define XED_IS_SEARCHBAR_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_SEARCHBAR))
17 #define XED_SEARCHBAR_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), XED_TYPE_SEARCHBAR, XedSearchbarClass))
18 
19 typedef struct _XedSearchbar        XedSearchbar;
20 typedef struct _XedSearchbarPrivate XedSearchbarPrivate;
21 typedef struct _XedSearchbarClass   XedSearchbarClass;
22 
23 struct _XedSearchbar
24 {
25     GtkBox parent;
26     XedWindow *window;
27 
28     /*< private > */
29     XedSearchbarPrivate *priv;
30 };
31 
32 struct _XedSearchbarClass
33 {
34     GtkBoxClass parent_class;
35 
36     /* Key bindings */
37     gboolean (* show_replace) (XedSearchbar *dlg);
38 };
39 
40 typedef enum
41 {
42     XED_SEARCH_MODE_SEARCH,
43     XED_SEARCH_MODE_REPLACE
44 } XedSearchMode;
45 
46 GType        xed_searchbar_get_type (void) G_GNUC_CONST;
47 
48 GtkWidget   *xed_searchbar_new (GtkWindow *parent);
49 
50 void         xed_searchbar_hide (XedSearchbar *searchbar);
51 void         xed_searchbar_show (XedSearchbar *searchbar, XedSearchMode search_mode);
52 void         xed_searchbar_find_again (XedSearchbar *searchbar, gboolean backward);
53 
54 const gchar *xed_searchbar_get_replace_text (XedSearchbar *searchbar);
55 const gchar *xed_searchbar_get_search_text (XedSearchbar *searchbar);
56 
57 gboolean     xed_searchbar_get_backwards    (XedSearchbar *searchbar);
58 
59 GtkSourceSearchSettings *xed_searchbar_get_search_settings (XedSearchbar *searchbar);
60 
61 void xed_searchbar_set_search_text (XedSearchbar *searchbar,
62                                     const gchar  *search_text);
63 
64 void         xed_searchbar_set_parse_escapes (XedSearchbar *searchbar, gboolean parse_escapes);
65 gboolean     xed_searchbar_get_parse_escapes (XedSearchbar *searchbar);
66 
67 G_END_DECLS
68 
69 #endif  /* __XED_SEARCHBAR_H__  */
70