/src/scim-python-lookup-table.h

http://scim-python.googlecode.com/ · C Header · 99 lines · 61 code · 14 blank · 24 comment · 0 complexity · e69c6cef2532edf5fd3b130e7f7e834f MD5 · raw file

  1. /* vim:set noet ts=4: */
  2. /**
  3. * scim-python
  4. *
  5. * Copyright (c) 2007-2008 Huang Peng <shawn.p.huang@gmail.com>
  6. *
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU Lesser General Public
  10. * License as published by the Free Software Foundation; either
  11. * version 2 of the License, or (at your option) any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU Lesser General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with this program; if not, write to the
  20. * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
  21. * Boston, MA 02111-1307 USA
  22. *
  23. * $Id: $
  24. */
  25. #ifndef __SCIM_PYTHON_LOOKUP_TABLE_H_
  26. #define __SCIM_PYTHON_LOOKUP_TABLE_H_
  27. #define Uses_SCIM_LOOKUP_TABLE
  28. #include <Python.h>
  29. #include <scim.h>
  30. using namespace scim;
  31. struct PyLookupTableObject;
  32. class PyLookupTable : public CommonLookupTable {
  33. private:
  34. PyLookupTableObject *self;
  35. private:
  36. PyLookupTable (PyLookupTableObject *lookup_table, unsigned int page_size = 10);
  37. PyLookupTable (PyLookupTableObject *lookup_table, unsigned int page_size, const std::vector<WideString> &labels);
  38. virtual ~PyLookupTable ();
  39. public:
  40. static PyObject *py_set_candidate_labels (PyLookupTableObject *self,
  41. PyObject *args);
  42. static PyObject *py_get_candidate_label (PyLookupTableObject *self,
  43. PyObject *args);
  44. static PyObject *py_set_page_size (PyLookupTableObject *self,
  45. PyObject *args);
  46. static PyObject *py_get_page_size (PyLookupTableObject *self,
  47. PyObject *args);
  48. static PyObject *py_get_current_page_size (PyLookupTableObject *self,
  49. PyObject *args);
  50. static PyObject *py_get_current_page_start (PyLookupTableObject *self,
  51. PyObject *args);
  52. static PyObject *py_is_cursor_visible (PyLookupTableObject *self,
  53. PyObject *args);
  54. static PyObject *py_is_page_size_fixed (PyLookupTableObject *self,
  55. PyObject *args);
  56. static PyObject *py_get_cursor_pos (PyLookupTableObject *self,
  57. PyObject *args);
  58. static PyObject *py_get_cursor_pos_in_current_page (PyLookupTableObject *self,
  59. PyObject *args);
  60. static PyObject *py_page_up (PyLookupTableObject *self, PyObject *args);
  61. static PyObject *py_page_down (PyLookupTableObject *self, PyObject *args);
  62. static PyObject *py_cursor_up (PyLookupTableObject *self, PyObject *args);
  63. static PyObject *py_cursor_down (PyLookupTableObject *self, PyObject *args);
  64. static PyObject *py_show_cursor (PyLookupTableObject *self, PyObject *args);
  65. static PyObject *py_fix_page_size (PyLookupTableObject *self, PyObject *args);
  66. static PyObject *py_set_cursor_pos (PyLookupTableObject *self, PyObject *args);
  67. static PyObject *py_set_cursor_pos_in_current_page (PyLookupTableObject *self,
  68. PyObject *args);
  69. static PyObject *py_get_candidate_in_current_page (PyLookupTableObject *self,
  70. PyObject *args);
  71. static PyObject *py_get_attributes_in_current_page (PyLookupTableObject *self,
  72. PyObject *args);
  73. static PyObject *py_get_candidate (PyLookupTableObject *self, PyObject *args);
  74. static PyObject *py_get_attributes (PyLookupTableObject *self, PyObject *args);
  75. static PyObject *py_number_of_candidates (PyLookupTableObject *self, PyObject *args);
  76. static PyObject *py_clear (PyLookupTableObject *self, PyObject *args);
  77. static PyObject *py_append_candidate (PyLookupTableObject *self, PyObject *args);
  78. static PyObject *py_new (PyTypeObject *type, PyObject *args, PyObject *kwds);
  79. static int py_init (PyLookupTableObject *self, PyObject *args, PyObject *kwds);
  80. static void py_dealloc (PyLookupTableObject *self);
  81. static const PyLookupTable &from_pyobject (PyObject *object);
  82. static PyMethodDef py_methods[];
  83. };
  84. void init_lookup_table (PyObject *module);
  85. #endif //__SCIM_PYTHON_LOOKUP_TABLE_H_