| 1 |
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
| 2 |
/* |
| 3 |
* Copyright (C) 2004 Hiroyuki Ikezoe |
| 4 |
* Copyright (C) 2004 Takuro Ashie |
| 5 |
* Copyright (C) 2012 CSSlayer |
| 6 |
* |
| 7 |
* This program is free software; you can redistribute it and/or modify |
| 8 |
* it under the terms of the GNU General Public License as published by |
| 9 |
* the Free Software Foundation; either version 2, or (at your option) |
| 10 |
* any later version. |
| 11 |
* |
| 12 |
* This program is distributed in the hope that it will be useful, |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
* GNU General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU General Public License |
| 18 |
* along with this program; if not, write to the Free Software |
| 19 |
* Foundation, 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. |
| 20 |
*/ |
| 21 |
|
| 22 |
#ifndef __FCITX_ANTHY_KEY2KANA_BASE_H__ |
| 23 |
#define __FCITX_ANTHY_KEY2KANA_BASE_H__ |
| 24 |
|
| 25 |
#include "common.h" |
| 26 |
|
| 27 |
class Key2KanaConvertorBase |
| 28 |
{ |
| 29 |
public: |
| 30 |
Key2KanaConvertorBase () |
| 31 |
: m_case_sensitive (true) |
| 32 |
{}; |
| 33 |
virtual ~Key2KanaConvertorBase () {}; |
| 34 |
|
| 35 |
virtual bool can_append (const KeyEvent & key, |
| 36 |
bool ignore_space = false) = 0; |
| 37 |
virtual bool append (const KeyEvent & key, |
| 38 |
std::string & result, |
| 39 |
std::string & pending, |
| 40 |
std::string & raw) = 0; |
| 41 |
virtual bool append (const std::string & raw, |
| 42 |
std::string & result, |
| 43 |
std::string & pending) = 0; |
| 44 |
virtual void clear (void) = 0; |
| 45 |
|
| 46 |
virtual bool is_pending (void) = 0; |
| 47 |
virtual std::string get_pending (void) = 0; |
| 48 |
virtual std::string flush_pending (void) = 0; |
| 49 |
virtual void reset_pending (const std::string & result, |
| 50 |
const std::string & raw) = 0; |
| 51 |
|
| 52 |
virtual void reset_pseudo_ascii_mode (void) |
| 53 |
{} |
| 54 |
virtual bool process_pseudo_ascii_mode (const std::string & wstr) |
| 55 |
{ return false; } |
| 56 |
|
| 57 |
virtual void set_case_sensitive (bool sensitive) |
| 58 |
{ m_case_sensitive = sensitive; } |
| 59 |
virtual bool get_case_sensitive (void) |
| 60 |
{ return m_case_sensitive; } |
| 61 |
|
| 62 |
protected: |
| 63 |
bool m_case_sensitive; |
| 64 |
}; |
| 65 |
|
| 66 |
#endif /* __FCITX_ANTHY_KEY2KANA_BASE_H__ */ |
| 67 |
/* |
| 68 |
vi:ts=4:nowrap:ai:expandtab |
| 69 |
*/ |