Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. /*
  2.  * Copyright 2009 Mark Benjamin <netsurf-browser.org.MarkBenjamin@dfgh.net>
  3.  *
  4.  * This file is part of NetSurf, http://www.netsurf-browser.org/
  5.  *
  6.  * NetSurf is free software; you can redistribute it and/or modify
  7.  * it under the terms of the GNU General Public License as published by
  8.  * the Free Software Foundation; version 2 of the License.
  9.  *
  10.  * NetSurf is distributed in the hope that it will be useful,
  11.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.  * GNU General Public License for more details.
  14.  *
  15.  * You should have received a copy of the GNU General Public License
  16.  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  17.  */
  18.  
  19. #ifndef _NETSURF_RENDER_SEARCH_H_
  20. #define _NETSURF_RENDER_SEARCH_H_
  21.  
  22. #include <ctype.h>
  23. #include <string.h>
  24.  
  25. #include "desktop/search.h"
  26.  
  27. struct search_context;
  28.  
  29. /**
  30.  * Called when a search context is destroyed
  31.  * \param context  search context being invalidated
  32.  * \param p        pointer for client data
  33.  */
  34. typedef void (*search_invalidate_callback)(struct search_context *context,
  35.                 void *p);
  36.  
  37. struct search_callbacks {
  38.         struct gui_search_callbacks *gui;
  39.         void *gui_p; /* private gui owned data */
  40.         search_invalidate_callback invalidate;
  41.         void *p; /* private client data */
  42. };
  43.  
  44.  
  45. struct search_context * search_create_context(struct hlcache_handle *h,
  46.                 struct search_callbacks callbacks);
  47. void search_destroy_context(struct search_context *context);
  48. void search_step(struct search_context *context, search_flags_t flags,
  49.                 const char * string);
  50. void search_show_all(bool all, struct search_context *context);
  51.  
  52.  
  53. bool search_term_highlighted(struct content *c,
  54.                 unsigned start_offset, unsigned end_offset,
  55.                 unsigned *start_idx, unsigned *end_idx,
  56.                 struct search_context *context);
  57.  
  58. #endif
  59.