Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | Related Pages

gtktextsearch.h

00001 /* GtkTextSearch 00002 * 00003 * 00004 * Copyright (C) 2002 Mikael Hermansson <tyan@linux.se> 00005 * 00006 * This program is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * This program is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00019 */ 00020 00021 00022 #ifndef _GTK_TEXT_SEARCH__H_ 00023 #define _GTK_TEXT_SEARCH__H_ 00024 00025 #include <gtk/gtk.h> 00026 00027 G_BEGIN_DECLS 00028 00029 #define GTK_TYPE_TEXT_SEARCH (gtk_text_search_get_type ()) 00030 #define GTK_TEXT_SEARCH(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GTK_TYPE_TEXT_SEARCH, GtkTextSearch)) 00031 #define GTK_TEXT_SEARCH_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TEXT_SEARCH, GtkTextSearchClass)) 00032 #define GTK_IS_TEXT_SEARCH(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_TEXT_SEARCH)) 00033 #define GTK_IS_TEXT_SEARCH_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TEXT_SEARCH)) 00034 00035 typedef struct _GtkTextSearch GtkTextSearch; 00036 typedef struct _GtkTextSearchClass GtkTextSearchClass; 00037 typedef gboolean (*GtkTextSearchForeachFunc) (GtkTextIter *match_start, GtkTextIter *match_end, gpointer data); 00038 00039 typedef enum { 00040 GTK_ETEXT_SEARCH_VISIBLE_ONLY, /* TODO */ 00041 GTK_ETEXT_SEARCH_TEXT_ONLY, 00042 GTK_ETEXT_SEARCH_CASE_INSENSITIVE, 00043 GTK_ETEXT_SEARCH_REGEXP /* TODO: this is not yet implemented */ 00044 }GtkETextSearchFlags; 00045 00046 struct _GtkTextSearch 00047 { 00048 GObject parent; 00049 00050 gchar *search_for; /* the text to search for */ 00051 gchar *offset; /* offset in search_for used in forward find char callback */ 00052 00053 GtkTextBuffer *buffer; 00054 GtkTextMark *mark_current; 00055 GtkTextMark *mark_stop; 00056 GtkETextSearchFlags sflags; 00057 00058 gint is_matched : 1; 00059 }; 00060 00061 struct _GtkTextSearchClass 00062 { 00063 GObjectClass parent; 00064 00065 }; 00066 00067 GType gtk_text_search_get_type (void); 00068 00069 GtkTextSearch * gtk_text_search_new (GtkTextBuffer *buffer, const GtkTextIter *start, 00070 const char *search, 00071 GtkETextSearchFlags sflags, 00072 const GtkTextIter *limit); 00073 void gtk_text_search_set (GtkTextSearch *search, 00074 GtkTextBuffer *buffer, 00075 const GtkTextIter *start, 00076 const char *searchfor, 00077 GtkETextSearchFlags sflags, 00078 const GtkTextIter *limit); 00079 void gtk_text_search_set_interval (GtkTextSearch *search, GtkTextBuffer *buffer, const GtkTextIter *start, const GtkTextIter *end); 00080 00081 gboolean gtk_text_search_forward (GtkTextSearch *search, GtkTextIter *match_start, GtkTextIter *match_end); 00082 gboolean gtk_text_search_backward (GtkTextSearch *search, GtkTextIter *match_start, GtkTextIter *match_end); 00083 gint gtk_text_search_forward_foreach (GtkTextSearch *search, GtkTextSearchForeachFunc func, gpointer data); 00084 gint gtk_text_search_backward_foreach (GtkTextSearch *search, GtkTextSearchForeachFunc func, gpointer data); 00085 00086 G_END_DECLS 00087 00088 #endif

Generated on Wed Jul 28 17:23:53 2004 for vdk 2.0.3 by doxygen 1.3.7