#ifndef IIIMP_HOTKEY_PROFILE_HH_
#define IIIMP_HOTKEY_PROFILE_HH_
#include "IMBasicObject.hh"
#include "IIIMPTrans.hh"
#include "SunIM.h"

#define GLOBAL_HOTKEY 0x0
#define SESSION_SPECIFIC_HOTKEY 0x1

#define IIIMP_PROFILE_ID_FIRST 0x1
#define IIIMP_PROFILE_ID_SECOND 0x2

#define HOTKEY_ID_LANG_SWITCH 1
#define HOTKEY_ID_TRIGGER_NOTIFY 2
#define HOTKEY_ID_SUPER_HELP 3

class Hotkey
{
    int hotkey_id;
    int state_flag;
    int action_flag;
    IMKeySpecList keys;
    u16string label;

  public:
    const int get_hotkey_id() const
    { return hotkey_id; }
    const int get_state_flag() const 
    { return state_flag; }
    const int get_action_flag() const
    { return action_flag; }
    const IMKeySpecList* get_keylist() const
    { return &keys; } 
    const u16string& get_label() const
    { return label; }

    Hotkey(
        int x_hkid,
        int sflag,
        int aflag,
        IMKeySpecList x_keys,
        u16string x_label
    ) : hotkey_id(x_hkid), state_flag(sflag), action_flag(aflag), keys(x_keys), label(x_label)
    {}
};

typedef list<Hotkey> HotkeyList;

class HotkeyProfile {
    int profile_id;
    void* register_id;
    HotkeyList hklist;

  public:
    const int get_profile_id() const
    { return profile_id; }
    const void* get_register_id() const 
    { return register_id; }
    const HotkeyList* get_hotkey_list() const
    { return &hklist; }

    HotkeyProfile(
        int x_profileid,
        void* x_register_id,
        HotkeyList x_hklist
    ) : profile_id(x_profileid), register_id(x_register_id), hklist(x_hklist)
    {}
};

typedef list<HotkeyProfile> HotkeyProfileList ;

class IIIMP_hotkey_profile
{
    HotkeyProfileList profile_list ;   
  public:
    IIIMP_hotkey_profile(
    );
    ~IIIMP_hotkey_profile();
    const HotkeyProfileList *get_profile_list();
    int register_hotkeys(void* registerer_id, HotkeyList *hklist); 
    // for someone to store
    // the hotkeys 
    // returns profile_id

    HOTKEY_LIST* retrive_hotkeys(IIIMP_data_s *pdata_s, int profile_id); 
    // convert list to 
    // array and register
    // the hotkeys with 
    // client
    int get_num_profiles();
    void* get_registerer_id_by_profile_id(int profile_id);
    void* get_profile_id_by_registerer_id(void* registerer_id);
    
};

#endif /* not IIIMP_HOTKEY_PROFILE_HH_ */

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