PageRenderTime 2095ms CodeModel.GetById 144ms app.highlight 10ms RepoModel.GetById 121ms app.codeStats 1677ms

/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
31using namespace scim;
32struct PyLookupTableObject;
33
34class PyLookupTable : public CommonLookupTable {
35private:
36	PyLookupTableObject *self;
37
38private:
39	PyLookupTable (PyLookupTableObject *lookup_table, unsigned int page_size = 10);
40	PyLookupTable (PyLookupTableObject *lookup_table, unsigned int page_size, const std::vector<WideString> &labels);
41	virtual ~PyLookupTable ();
42
43public:
44	static PyObject *py_set_candidate_labels (PyLookupTableObject *self, 
45						PyObject *args);
46	static PyObject *py_get_candidate_label (PyLookupTableObject *self,
47						PyObject *args);
48	static PyObject *py_set_page_size (PyLookupTableObject *self,
49						PyObject *args);
50	static PyObject *py_get_page_size (PyLookupTableObject *self,
51						PyObject *args);
52	static PyObject *py_get_current_page_size (PyLookupTableObject *self,
53						PyObject *args);
54	static PyObject *py_get_current_page_start (PyLookupTableObject *self,
55						PyObject *args);
56	static PyObject *py_is_cursor_visible (PyLookupTableObject *self,
57						PyObject *args);
58	static PyObject *py_is_page_size_fixed (PyLookupTableObject *self,
59						PyObject *args);
60	static PyObject *py_get_cursor_pos (PyLookupTableObject *self,
61						PyObject *args);
62	static PyObject *py_get_cursor_pos_in_current_page (PyLookupTableObject *self,
63						PyObject *args);
64
65	static PyObject *py_page_up (PyLookupTableObject *self, PyObject *args);
66	static PyObject *py_page_down (PyLookupTableObject *self, PyObject *args);
67	static PyObject *py_cursor_up (PyLookupTableObject *self, PyObject *args);
68	static PyObject *py_cursor_down (PyLookupTableObject *self, PyObject *args);
69
70	static PyObject *py_show_cursor (PyLookupTableObject *self, PyObject *args);
71	static PyObject *py_fix_page_size (PyLookupTableObject *self, PyObject *args);
72
73	static PyObject *py_set_cursor_pos (PyLookupTableObject *self, PyObject *args);
74	static PyObject *py_set_cursor_pos_in_current_page (PyLookupTableObject *self,
75						PyObject *args);
76
77	static PyObject *py_get_candidate_in_current_page (PyLookupTableObject *self,
78						PyObject *args);
79	static PyObject *py_get_attributes_in_current_page (PyLookupTableObject *self,
80						PyObject *args);
81
82	static PyObject *py_get_candidate (PyLookupTableObject *self, PyObject *args);
83	static PyObject *py_get_attributes (PyLookupTableObject *self, PyObject *args);
84	static PyObject *py_number_of_candidates (PyLookupTableObject *self, PyObject *args);
85
86	static PyObject *py_clear (PyLookupTableObject *self, PyObject *args);
87
88	static PyObject *py_append_candidate (PyLookupTableObject *self, PyObject *args);
89
90	static PyObject *py_new (PyTypeObject *type, PyObject *args, PyObject *kwds);
91	static int py_init (PyLookupTableObject *self, PyObject *args, PyObject *kwds);
92	static void py_dealloc (PyLookupTableObject *self);
93	static const PyLookupTable &from_pyobject (PyObject *object);
94	static PyMethodDef py_methods[];
95
96};
97
98void init_lookup_table (PyObject *module);
99#endif //__SCIM_PYTHON_LOOKUP_TABLE_H_