#ifndef IMINPUTCONTEXT_HH_
#define IMINPUTCONTEXT_HH_
#include <list>
#include "basictype.hh"
#include "ICHandler.hh"

class IMConnection;
class LEMgr;
class LEContext;

class IMInputContext : public ICHandler
{
    IMConnection *pimc;

    typedef list<LEContext*> LEContextList;
    LEContextList leclist;
    LEContext *pcur_lec;

    ICAttribute attr;

    LEMgr* get_lemgr();
    LEContext* create_lecontext();
    LEContext* get_current_lecontext();
    bool switch_lecontext(const ICAttribute &attr);

  public:
    IMConnection *get_imconnection()
    { return pimc; }
    void get_lecontext_args(
	vector<IMArg> &args
    );
    IMInputContext(
	IMConnection *pimc,
	const ICAttribute &attr
    );
    virtual void destroy();
  protected:
    virtual ~IMInputContext();

  public:
    // ICHandler realization.
    virtual bool send_event(
	IMLExec* pimlex,
	IMInputEvent* pimevent
    );
    virtual bool send_event_getvalues(
	IMLExec* pimlex,
	IMInputEvent* pimevent
    );
    virtual bool send_event_getvalues_finished(
	IMLExec* pimlex
    );
    virtual const ICAttribute& get_icattr();
    virtual bool set_icattr(
    	const ICAttribute &attr
    );
    virtual bool toggle_conversion(
	IMLExec *pimlex,
	bool flag
    );
    virtual bool invoke_desktop_listener(
	IMLExec *pimlex,
        int listener_id,
        int file_size,
        void *object
    );
    virtual iml_desktop_t *get_current_desktop();
    virtual bool reset(
	IMLExec *pimlex
    );
    virtual bool destroy(
	IMLExec *pimlex
    );

    /* obsolete API!!!! */
    virtual bool toggle_focus(
	IMLExec *pimlex,
	bool flag
    );
};

#endif /* not IMINPUTCONTEXT_HH_ */

/* Local Variables: */
/* c-file-style: "iiim-project" */
/* End: */
