Back to index

im-sdk  12.3.91
ICHandler.hh
Go to the documentation of this file.
00001 #ifndef ICHANDLER_HH_
00002 #define ICHANDLER_HH_
00003 #include <string>
00004 #include <vector>
00005 #include <SunIM.h>
00006 #include "basictype.hh"
00007 
00008 class IMCharSubsets
00009 {
00010     typedef vector<int> IMCharSubsetIDXVec;
00011     IMCharSubsetIDXVec imcsvec;
00012 
00013   public:
00014     const int* get_c_csidices();
00015     void add_csidx(int idx);
00016 
00017     IMCharSubsets();
00018 };
00019 
00020 class ICAttribute
00021 {
00022   private:
00023     u16string inputmethod;
00024     u16string inputlanguage;
00025     u16string inputengine;
00026     IMCharSubsets charsubsets;
00027 
00028   public:
00029     void set_inputmethod(const u16string& imname)
00030     { inputmethod = imname; }
00031     void set_inputlanguage(const u16string& langname)
00032     { inputlanguage = langname; }
00033     void set_inputengine(const u16string& imename)
00034     { inputengine = imename; }
00035     void set_charsubsets(const IMCharSubsets &subsets)
00036     { charsubsets = subsets; }
00037 
00038     // void merge(ICAttribute &attr);
00039 
00040     const u16string& get_inputmethod() const { return inputmethod; }
00041     const u16string& get_inputlanguage() const { return inputlanguage; }
00042     const u16string& get_inputengine() const { return inputengine; }
00043     IMCharSubsets& get_character_subsets() { return charsubsets; }
00044 };
00045 
00046 class IMLExec
00047 {
00048   public:
00049     enum IML_EXITCODE {
00050            IML_EXIT_SUCCESS = 1
00051     };
00052     virtual iml_inst* push_insts(
00053        iml_inst **rrv
00054     ) = 0;
00055     virtual ~IMLExec() {}
00056 };
00057 
00058 class ICHandler
00059 {
00060   public:
00061     virtual bool send_event(
00062        IMLExec* pimlex,
00063        IMInputEvent* pimevent
00064     ) = 0;
00065     virtual bool send_event_getvalues(
00066        IMLExec* pimlex,
00067        IMInputEvent* pimevent
00068     ) = 0;
00069     virtual bool send_event_getvalues_finished(
00070        IMLExec* pimlex
00071     ) = 0;
00072     virtual const ICAttribute& get_icattr() = 0;
00073     virtual bool set_icattr(
00074        const ICAttribute &attr
00075     ) = 0;
00076     virtual bool invoke_desktop_listener(
00077        IMLExec *pimlex,
00078         int listener_id,
00079         int file_size,
00080         void *ptr
00081     ) = 0;
00082     virtual iml_desktop_t *get_current_desktop() = 0;
00083     virtual bool toggle_conversion(
00084        IMLExec *pimlex,
00085        bool flag
00086     ) = 0;
00087     virtual bool reset(
00088        IMLExec *pimlex
00089     ) = 0;
00090     virtual bool destroy(
00091        IMLExec *pimlex
00092     ) = 0;
00093     virtual void destroy() = 0;
00094 
00095     /* obsolete API!!!! */
00096     virtual bool toggle_focus(
00097        IMLExec *pimlex,
00098        bool flag
00099     ) = 0;
00100 };
00101 
00102 #endif /* not ICHANDLER_HH_ */
00103 
00104 /* Local Variables: */
00105 /* c-file-style: "iiim-project" */
00106 /* End: */