Remove comment noise from `doc/plugins.dox` and make it a build depend
[geany-mirror.git] / src / search.h
blob4fa70575a3371fe212f8895ab39267d695bd0929
1 /*
2 * search.h - this file is part of Geany, a fast and lightweight IDE
4 * Copyright 2006-2012 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
5 * Copyright 2006-2012 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 /**
23 * @file search.h
24 * Search (prefs).
25 **/
28 #ifndef GEANY_SEARCH_H
29 #define GEANY_SEARCH_H 1
31 G_BEGIN_DECLS
33 /* the flags given in the search dialog for "find next", also used by the search bar */
34 typedef struct GeanySearchData
36 gchar *text;
37 gint flags;
38 gboolean backwards;
39 /* set to TRUE when text was set by a search bar callback to keep track of
40 * search bar background colour */
41 gboolean search_bar;
42 /* text as it was entered by user */
43 gchar *original_text;
45 GeanySearchData;
47 extern GeanySearchData search_data;
50 enum GeanyFindSelOptions
52 GEANY_FIND_SEL_CURRENT_WORD,
53 GEANY_FIND_SEL_X,
54 GEANY_FIND_SEL_AGAIN
57 /** Search preferences */
58 typedef struct GeanySearchPrefs
60 gboolean always_wrap; /* don't ask whether to wrap search */
61 gboolean use_current_word; /**< Use current word for default search text */
62 gboolean use_current_file_dir; /* find in files directory to use on showing dialog */
63 gboolean hide_find_dialog; /* hide the find dialog on next or previous */
64 enum GeanyFindSelOptions find_selection_type;
66 GeanySearchPrefs;
68 extern GeanySearchPrefs search_prefs;
71 typedef struct GeanyMatchInfo
73 gint flags;
74 /* range */
75 gint start, end;
76 /* only valid if (flags & SCFIND_REGEX) */
77 gchar *match_text; /* text actually matched */
78 struct
80 gint start, end;
82 matches[10]; /* sub-patterns */
84 GeanyMatchInfo;
87 void search_init(void);
89 void search_finalize(void);
91 void search_show_find_dialog(void);
93 void search_show_replace_dialog(void);
95 void search_show_find_in_files_dialog(const gchar *dir);
97 void search_show_find_in_files_dialog_full(const gchar *text, const gchar *dir);
100 struct _ScintillaObject;
101 struct Sci_TextToFind;
103 void geany_match_info_free(GeanyMatchInfo *info);
105 gint search_find_prev(struct _ScintillaObject *sci, const gchar *str, gint flags, GeanyMatchInfo **match_);
107 gint search_find_next(struct _ScintillaObject *sci, const gchar *str, gint flags, GeanyMatchInfo **match_);
109 gint search_find_text(struct _ScintillaObject *sci, gint flags, struct Sci_TextToFind *ttf, GeanyMatchInfo **match_);
111 void search_find_again(gboolean change_direction);
113 void search_find_usage(const gchar *search_text, const gchar *original_search_text, gint flags, gboolean in_session);
115 void search_find_selection(GeanyDocument *doc, gboolean search_backwards);
117 gint search_mark_all(GeanyDocument *doc, const gchar *search_text, gint flags);
119 gint search_replace_match(struct _ScintillaObject *sci, const GeanyMatchInfo *match, const gchar *replace_text);
121 guint search_replace_range(struct _ScintillaObject *sci, struct Sci_TextToFind *ttf,
122 gint flags, const gchar *replace_text);
124 G_END_DECLS
126 #endif