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.
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
39 /* set to TRUE when text was set by a search bar callback to keep track of
40 * search bar background colour */
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 */
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
);
71 struct _ScintillaObject
;
72 struct Sci_TextToFind
;
74 gint
search_find_next(struct _ScintillaObject
*sci
, const gchar
*str
, gint flags
);
76 gint
search_find_text(struct _ScintillaObject
*sci
, gint flags
, struct Sci_TextToFind
*ttf
);
78 void search_find_usage(const gchar
*search_text
, gint flags
, gboolean in_session
);
80 void search_find_selection(GeanyDocument
*doc
, gboolean search_backwards
);
82 gint
search_mark_all(GeanyDocument
*doc
, const gchar
*search_text
, gint flags
);
84 gint
search_replace_target(struct _ScintillaObject
*sci
, const gchar
*replace_text
,
87 guint
search_replace_range(struct _ScintillaObject
*sci
, struct Sci_TextToFind
*ttf
,
88 gint flags
, const gchar
*replace_text
);