/src/ftk_input_pattern.h

http://ftk.googlecode.com/ · C Header · 54 lines · 15 code · 9 blank · 30 comment · 0 complexity · ae61dddacefc8c33a4639013fd2b3d19 MD5 · raw file

  1. /*
  2. * File: ftk_input_pattern.h
  3. * Author: Li XianJing <xianjimli@hotmail.com>
  4. * Brief: input pattern to format some special input, such as date,
  5. * time and ip address.
  6. *
  7. * Copyright (c) 2009 - 2011 Li XianJing <xianjimli@hotmail.com>
  8. *
  9. * Licensed under the Academic Free License version 2.1
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * This program is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  24. */
  25. /*
  26. * History:
  27. * ================================================================
  28. * 2011-07-28 Li XianJing <xianjimli@hotmail.com> created
  29. *
  30. */
  31. #ifndef FTK_INPUT_PATTERN_H
  32. #define FTK_INPUT_PATTERN_H
  33. #include "ftk_key.h"
  34. FTK_BEGIN_DECLS
  35. struct _FtkInputPattern;
  36. typedef struct _FtkInputPattern FtkInputPattern;
  37. FtkInputPattern* ftk_input_pattern_create(const char* pattern, const char* init);
  38. Ret ftk_input_pattern_input(FtkInputPattern* thiz, FtkKey key);
  39. Ret ftk_input_pattern_set_caret(FtkInputPattern* thiz, size_t caret);
  40. Ret ftk_input_pattern_set_text(FtkInputPattern* thiz, const char* text);
  41. size_t ftk_input_pattern_get_caret(FtkInputPattern* thiz);
  42. const char* ftk_input_pattern_get_text(FtkInputPattern* thiz);
  43. void ftk_input_pattern_destroy(FtkInputPattern* thiz);
  44. FTK_END_DECLS
  45. #endif/*FTK_INPUT_PATTERN_H*/