1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: t; c-basic-offset: 2 -*- */
2 /* IM-JA Japanese Input Method Module for GTK-2.0
3  *
4  * Copyright (C) 2004 Botond Botyanszki <boti@rocketmail.com>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the
18  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19  * Boston, MA 02111-1307, USA.
20  */
21 
22 #ifndef _SKKCONV_H_
23 #define _SKKCONV_H_
24 
25 #include "skklib.h"
26 #include "../im-ja.h"
27 
28 enum {
29   SKKCONV_UNCONVERTED,
30   SKKCONV_CONVERTED
31 };
32 
33 enum {
34   SKKCONV_PREV,
35   SKKCONV_NEXT
36 };
37 
38 enum {
39   SKKCONV_FORWARD,
40   SKKCONV_BACKWARD
41 };
42 
43 typedef struct _SKKContext SKKContext;
44 struct _SKKContext {
45   gchar kana_buf[BUFFERSIZE];
46   gint cursor_pos;
47   gint conv_state;
48   GList *clauselist;
49   GList *curr_clause;
50 };
51 
52 typedef struct _SKKClause SKKClause;
53 struct _SKKClause {
54   gchar *kana_start;
55   gchar *kana_end;
56   CandList cand;
57   CandList selected_cand;
58   gint conv_state;
59 };
60 
61 
62 SKKClause *skkconv_convert_clause(gchar *conv_start, gchar *conv_end, gboolean shrink);
63 void skkconv_reset_ctx(SKKContext *skkctx);
64 void skkconv_roma2kana(SKKContext *skkctx, gint input_method);
65 void skkconv_insert_string(SKKContext *skkctx, gchar *strg);
66 void skkconv_convert_all(SKKContext *skkctx);
67 void skkconv_delete_char(SKKContext *skkctx, gint direction);
68 void skkconv_move_cursor(SKKContext *skkctx, gint direction);
69 void skkconv_free_clauselist(SKKContext *skkctx);
70 void skkconv_unconvert_all(SKKContext *skkctx);
71 void skkconv_unconvert_clause(SKKClause *clause);
72 void skkconv_unconvert_current_clause(SKKContext *skkctx);
73 void skkconv_select_clause(SKKContext *skkctx, gint direction);
74 void skkconv_fix_selected_candidate(SKKContext *skkctx, gint selected);
75 void skkconv_select_candidate(SKKContext *skkctx, gint direction);
76 void skkconv_resize_clause(SKKContext *skkctx, gint direction);
77 
78 #endif
79