2 Scim-Unikey Input Method
5 Copyright (C) 2008-2009 Ubuntu-VN <http://www.ubuntu-vn.org>
6 Author: Le Quoc Tuan <mr.lequoctuan@gmail.com>
7 Home: http://scim-unikey.googlecode.com
8 License: GNU LESSER GENERAL PUBLIC LICENSE v2.1
11 #if !defined (__SCIM_UNIKEY_IMENGINE_H)
12 #define __SCIM_UNIKEY_IMENGINE_H
18 class UnikeyFactory : public IMEngineFactoryBase
20 friend class UnikeyInstance;
24 virtual ~UnikeyFactory ();
26 virtual WideString get_name () const;
27 virtual WideString get_authors () const;
28 virtual WideString get_credits () const;
29 virtual WideString get_help () const;
30 virtual String get_uuid () const;
31 virtual String get_icon_file () const;
33 virtual IMEngineInstancePointer create_instance (const String& encoding, int id = -1);
36 class UnikeyInstance : public IMEngineInstanceBase
39 UnikeyInstance(UnikeyFactory *factory, const String& encoding, int id = -1);
40 virtual ~UnikeyInstance ();
42 virtual bool process_key_event(const KeyEvent& key);
44 virtual void focus_in();
45 virtual void focus_out();
46 virtual void trigger_property(const String &property);
49 bool Unikey_process_key_event_direct(const KeyEvent& key);
50 bool Unikey_process_key_event_preedit(const KeyEvent& key);
51 void Unikey_send_backspace(int nBackspace);
52 void Unikey_update_preedit_string(const WideString s, const bool visible);
53 PropertyList CreatePropertyList();
55 int m_im; // input method
56 int m_oc; // output charset
57 UnikeyOptions m_ukopt; // Unikey Options
58 WideString m_preeditstring; // store PreEdit String
59 bool m_preedit; // is PreEdit On?
60 bool m_codertelex; // is CoderTelex on?
61 bool m_process_w_AtBeginWord; // process W at Begin Word?
62 bool m_auto_commit; // auto commit?
63 std::vector<KeyEvent> m_preeditskey; // keys to switch preedit and non preedit mode
64 bool m_lastkey_with_shift; // last press key with modifier is shift