Debian Codegraph @

src/kana.h

raw
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * Copyright (C) 2005 Takuro Ashie
4 * Copyright (C) 2012 CSSlayer
5 *
6 * This program 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; either version 2, or (at your option)
9 * any later version.
10 *
11 * This program 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
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20
21 #ifndef __FCITX_ANTHY_KANA_H__
22 #define __FCITX_ANTHY_KANA_H__
23
24 #include "key2kana_base.h"
25 #include "default_tables.h"
26 #include "key2kana_table.h"
27
28 class AnthyInstance;
29
30 class KanaConvertor : public Key2KanaConvertorBase
31 {
32 public:
33 KanaConvertor (AnthyInstance & anthy);
34 virtual ~KanaConvertor ();
35
36 bool can_append (const KeyEvent & key,
37 bool ignore_space = false);
38 bool append (const KeyEvent & key,
39 std::string & result,
40 std::string & pending,
41 std::string & raw);
42 bool append (const std::string & raw,
43 std::string & result,
44 std::string & pending);
45 void clear (void);
46
47 bool is_pending (void);
48 std::string get_pending (void);
49 std::string flush_pending (void);
50 void reset_pending (const std::string & result,
51 const std::string & raw);
52
53 private:
54 AnthyInstance &m_anthy;
55
56 // state
57 std::string m_pending;
58 };
59
60 #endif /* __FCITX_ANTHY_KANA_H__ */
61 /*
62 vi:ts=4:nowrap:ai:expandtab
63 */