Constify some more string pointers in the API (patch by
[geany-mirror.git] / src / search.h
blob8621588f5b21658d6f2b96349f84821971ee68b6
1 /*
2 * search.h - this file is part of Geany, a fast and lightweight IDE
4 * Copyright 2006-2010 Enrico Tröger <enrico(dot)troeger(at)uvena(dot)de>
5 * Copyright 2006-2010 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
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21 * $Id$
24 /**
25 * @file search.h
26 * Search (prefs).
27 **/
30 #ifndef GEANY_SEARCH_H
31 #define GEANY_SEARCH_H 1
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;
43 GeanySearchData;
45 extern GeanySearchData search_data;
48 /** Search preferences */
49 typedef struct GeanySearchPrefs
51 gboolean suppress_dialogs;
52 gboolean use_current_word; /**< Use current word for default search text */
53 gboolean use_current_file_dir; /* find in files directory to use on showing dialog */
55 GeanySearchPrefs;
57 extern GeanySearchPrefs search_prefs;
60 void search_init(void);
62 void search_finalize(void);
64 void search_show_find_dialog(void);
66 void search_show_replace_dialog(void);
68 void search_show_find_in_files_dialog(const gchar *dir);
70 struct _ScintillaObject;
72 gint search_find_next(struct _ScintillaObject *sci, const gchar *str, gint flags);
74 void search_find_usage(const gchar *search_text, gint flags, gboolean in_session);
76 void search_find_selection(GeanyDocument *doc, gboolean search_backwards);
78 gint search_mark_all(GeanyDocument *doc, const gchar *search_text, gint flags);
80 gint search_replace_target(struct _ScintillaObject *sci, const gchar *replace_text,
81 gboolean regex);
83 struct Sci_TextToFind;
85 guint search_replace_range(struct _ScintillaObject *sci, struct Sci_TextToFind *ttf,
86 gint flags, const gchar *replace_text);
88 #endif