2006-05-21 16:11:05 -07:00
|
|
|
/*
|
2005-11-13 19:08:24 -08:00
|
|
|
* mootextsearch.h
|
|
|
|
*
|
2007-06-24 10:56:20 -07:00
|
|
|
* Copyright (C) 2004-2007 by Yevgen Muntyan <muntyan@math.tamu.edu>
|
2005-11-13 19:08:24 -08:00
|
|
|
*
|
2007-06-24 10:56:20 -07:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
2007-09-23 09:47:28 -07:00
|
|
|
* License version 2.1 as published by the Free Software Foundation.
|
2005-11-13 19:08:24 -08:00
|
|
|
*
|
|
|
|
* See COPYING file that comes with this distribution.
|
|
|
|
*/
|
|
|
|
|
2007-06-10 02:06:03 -07:00
|
|
|
#ifndef MOO_TEXT_SEARCH_H
|
|
|
|
#define MOO_TEXT_SEARCH_H
|
2005-11-13 19:08:24 -08:00
|
|
|
|
|
|
|
#include <mooedit/mootextiter.h>
|
|
|
|
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
|
|
|
|
|
2006-08-19 00:50:56 -07:00
|
|
|
typedef enum /*< flags >*/
|
|
|
|
{
|
2005-11-13 19:08:24 -08:00
|
|
|
MOO_TEXT_SEARCH_CASELESS = 1 << 0,
|
|
|
|
MOO_TEXT_SEARCH_REGEX = 1 << 1,
|
|
|
|
MOO_TEXT_SEARCH_WHOLE_WORDS = 1 << 2,
|
|
|
|
MOO_TEXT_SEARCH_REPL_LITERAL = 1 << 3
|
|
|
|
} MooTextSearchFlags;
|
|
|
|
|
2006-08-19 00:50:56 -07:00
|
|
|
typedef enum /*< enum >*/
|
|
|
|
{
|
2005-11-13 19:08:24 -08:00
|
|
|
MOO_TEXT_REPLACE_STOP = 0,
|
|
|
|
MOO_TEXT_REPLACE_SKIP = 1,
|
|
|
|
MOO_TEXT_REPLACE_DO_REPLACE = 2,
|
|
|
|
MOO_TEXT_REPLACE_ALL = 3
|
|
|
|
} MooTextReplaceResponse;
|
|
|
|
|
|
|
|
gboolean moo_text_search_forward (const GtkTextIter *start,
|
|
|
|
const char *str,
|
|
|
|
MooTextSearchFlags flags,
|
|
|
|
GtkTextIter *match_start,
|
|
|
|
GtkTextIter *match_end,
|
|
|
|
const GtkTextIter *end);
|
|
|
|
gboolean moo_text_search_backward (const GtkTextIter *start,
|
|
|
|
const char *str,
|
|
|
|
MooTextSearchFlags flags,
|
|
|
|
GtkTextIter *match_start,
|
|
|
|
GtkTextIter *match_end,
|
|
|
|
const GtkTextIter *end);
|
|
|
|
|
|
|
|
int moo_text_replace_all (GtkTextIter *start,
|
|
|
|
GtkTextIter *end,
|
|
|
|
const char *text,
|
|
|
|
const char *replacement,
|
|
|
|
MooTextSearchFlags flags);
|
|
|
|
|
|
|
|
|
|
|
|
G_END_DECLS
|
|
|
|
|
2007-06-10 02:06:03 -07:00
|
|
|
#endif /* MOO_TEXT_SEARCH_H */
|