Back to index

im-sdk  12.3.91
IIIMP_hotkey.hh
Go to the documentation of this file.
00001 #ifndef IIIMP_HOTKEY_HH_
00002 #define IIIMP_HOTKEY_HH_
00003 #include "IIIMP_ICState.hh"
00004 
00005 #define EVENT_FORWARDING_ON 1
00006 #define EVENT_FORWARDING_OFF 0
00007 
00008 class LangIM
00009 {
00010     int index;
00011     const char *lang_id;
00012     u16string imname;
00013     u16string hrn;
00014     const IMHotkeyProfileStruct *hotkey_profile;
00015 
00016   public:
00017     int get_index() const
00018     { return index; }
00019     const char* get_id() const
00020     { return lang_id; }
00021     const u16string& get_imname() const
00022     { return imname; } 
00023     const u16string& get_hrn() const
00024     { return hrn; } 
00025     const IMHotkeyProfileStruct* get_hotkey_profile () const
00026     { return hotkey_profile; } 
00027 
00028     LangIM(
00029        int x_index,
00030        const char *x_langid,
00031        u16string x_imname,
00032        u16string x_hrn,
00033        const IMHotkeyProfileStruct *hkps
00034        ) : index(x_index), lang_id(x_langid), imname(x_imname), hrn(x_hrn),
00035            hotkey_profile(hkps)
00036     {}
00037 };
00038 typedef list<LangIM> LangIMList;
00039 
00040 class IIIMP_ICState;
00041 class IIIMP_hotkey 
00042 {
00043     bool hotkey_mode;
00044     bool lang_selection;
00045     bool forward_event;
00046     int first_candidate;
00047     int last_candidate;
00048     int current;
00049     int curr_hotkeyid;
00050     unsigned int curr_langid;
00051 
00052   public:
00053     IIIMP_hotkey(
00054        IIIMP_ICState *hics
00055     );
00056     ~IIIMP_hotkey();
00057     bool process_hotkey(
00058         IIIMP_ICState *hics,
00059         int hotkey_id,
00060         int index
00061     );
00062     int check_for_hotkey( 
00063         IIIMP_ICState *hics,
00064         IIIMP_keyevent *kev
00065     );
00066     void set_hotkey_mode(bool flag) { hotkey_mode = flag; }
00067     bool get_hotkey_mode() const { return hotkey_mode; }
00068     void set_lang_selection(bool flag) { lang_selection = flag; }
00069     bool get_lang_selection() const { return lang_selection; }
00070     void set_forward_event(bool flag) { forward_event = flag; }
00071     bool get_forward_event() const { return forward_event; }
00072     void set_current_lang_id(int id) { curr_langid = id; }
00073     int  get_current_lang_id() const { return curr_langid; }
00074     bool
00075     send_hotkey_reply(IIIMP_ICState *hics);
00076     int
00077     UTFCHARLen(UTFCHAR *);
00078     int
00079     UTFCHARLen(const char *);
00080     int
00081     UTFCHARCpy(UTFCHAR *, const char *);
00082     int
00083     UTFCHARCpy(UTFCHAR *, UTFCHAR *);
00084     int
00085     UTFCHARCat(UTFCHAR *, UTFCHAR *, UTFCHAR *);
00086     int
00087     UTFCHARCat(UTFCHAR *, const char *, const char *, const char *, const char *);
00088     IMFeedbackList *
00089     create_feedback(int);
00090     void
00091     free_feedback(IMFeedbackList *, int);
00092     bool 
00093     forward_hotkey_to_LE(IIIMP_ICState *hics, int hotkey_id, int index);
00094     bool
00095     switch_language(IIIMP_ICState *hics, int index, int hotkey_id);
00096     bool
00097     start_lang_selection_window(IIIMP_ICState *hics);
00098     void print_LangIMList(IIIMP_ICState *hics);
00099     bool
00100     process_lang_selection_window(
00101        IIIMP_ICState *hics,
00102        IIIMP_message *pmes
00103     );
00104     bool
00105     draw_lang_selection_window(
00106        IIIMP_ICState *hics,
00107        int keycode
00108     );
00109     bool
00110     stop_lang_selection_window(IIIMP_ICState *hics);
00111     bool
00112     do_cycle_lang_selection(IIIMP_ICState *hics, int orientation);
00113 };
00114 
00115 #endif /* not IIIMP_HOTKEY_HH_ */
00116 
00117 /* Local Variables: */
00118 /* c-file-style: "iiim-project" */
00119 /* End: */