_UnihanMethods Struct Reference

Service methods provided by Unihan. More...

#include <unihan_im.h>


Data Fields

int(* send_buffer )(UnihanIM *uim, void *buf, size_t buf_size)
int(* config_get )(UnihanIM *uim, char *key, char **value, long *len)
 Get per-user configuration data.
int(* config_set )(UnihanIM *uim, char *key, char *value, long len)
 Set per-user configuration data.
int(* preedit_draw )(UnihanIM *uim, char *s, UnihanStyleList *styles)
 Draws preedit text in IM client's window.
int(* preedit_caret_pos )(UnihanIM *uim, int caretPos)
 Sets the preedit string's caret (cursor) position.
int(* preedit_change )(UnihanIM *uim, char *s, UnihanStyleList *styles, int pos, int len, int caretPos)
 Changes the existing preedit string.
int(* preedit_erase )(UnihanIM *uim)
 Clears the preedit text.
int(* lookup_start )(UnihanIM *uim, UnihanLookupStart *lustart)
 Specifies the details of the candidate lookup choice window.
int(* lookup_draw )(UnihanIM *uim, UnihanLookupDraw *ludraw)
 Draws the candidate lookup choice window.
int(* lookup_done )(UnihanIM *uim)
 Closes the candidate lookup choice window.
int(* status_draw )(UnihanIM *uim, char *s, UnihanStyleList *styles)
 Shows a string in the status window.
int(* commit_string )(UnihanIM *uim, char *s)
 Commits a string to the IM client.
int(* locale_get )(UnihanIM *uim, char **locale)
 Gets the locale of the current user.
int(* tcsc_mode_get )(UnihanIM *uim, UnihanTCSCMode *tcscMode)
 Gets the current traditional/simplified mode.
int(* tcsc_do_conv )(UnihanIM *uim, UnihanTCSCMode tcscMode, char *orig, char **converted)
 Performs traditional/simplified conversion.
int(* mem_alloc )(UnihanIM *uim, size_t len, void **mem)
 Allocates temporary memory.
int(* client_info_get )(UnihanIM *uim, UnihanClientInfoType type, char **info)
int(* is_fullwidth )(UnihanIM *uim)
 Checks current fullwidth/halfwidth mode.
int(* is_chinesepunc )(UnihanIM *uim)
 Checks current Chinese/English punctuation mode.
int(* is_shuangpin )(UnihanIM *uim)
 Checks current Shuangpin mode.
int(* beep )(UnihanIM *uim)
 Makes the IM client beep.
int(* match_phrase )(UnihanIM *uim, char *s)
 Begins phrase matching mode.
void(* log )(UnihanIM *uim, UnihanLogLevelFlags log_level, const char *format,...)
 Logs debug information.


Detailed Description

Service methods provided by Unihan.


Field Documentation

int(* _UnihanMethods::send_buffer)(UnihanIM *uim, void *buf, size_t buf_size)

int(* _UnihanMethods::config_get)(UnihanIM *uim, char *key, char **value, long *len)

Get per-user configuration data.

Parameters:
uim UnihanIM context
key key of config data to get
value pointer to a buffer for receiving the config data. The caller must not free or modify the buffer.
len pointer to a long for receiving the length of config data
Returns:
0 if no error, > 0 if error occurs.

int(* _UnihanMethods::config_set)(UnihanIM *uim, char *key, char *value, long len)

Set per-user configuration data.

Parameters:
uim UnihanIM context
key key of config data to get
value the config data
len the length of config data
Returns:
0 if no error, > 0 if error occurs.

int(* _UnihanMethods::preedit_draw)(UnihanIM *uim, char *s, UnihanStyleList *styles)

Draws preedit text in IM client's window.

Parameters:
uim UnihanIM context
s the preedit string
styles an array of UnihanStyleList. The length must be the same as s, eg. if s has 3 characters, styles must also have 3 elements.
Returns:
0 if no error, > 0 if error occurs.

int(* _UnihanMethods::preedit_caret_pos)(UnihanIM *uim, int caretPos)

Sets the preedit string's caret (cursor) position.

Parameters:
uim UnihanIM context
caretPos position of the caret, 0 = on the left of first character
Returns:
0 if no error, > 0 if error occurs.

int(* _UnihanMethods::preedit_change)(UnihanIM *uim, char *s, UnihanStyleList *styles, int pos, int len, int caretPos)

Changes the existing preedit string.

Parameters:
uim UnihanIM context
s the new preedit string. If NULL, the preedit text between pos and pos + len will be deleted.
styles an array of UnihanStyleList; same convention as preedit_draw()
pos the start index of the preedit text to change
len the length of the text to change. If 0, s is inserted into the preedit text string.
Returns:
0 if no error, > 0 if error occurs.

int(* _UnihanMethods::preedit_erase)(UnihanIM *uim)

Clears the preedit text.

Parameters:
uim UnihanIM context
Returns:
0 if no error, > 0 if error occurs.

int(* _UnihanMethods::lookup_start)(UnihanIM *uim, UnihanLookupStart *lustart)

Specifies the details of the candidate lookup choice window.

Parameters:
uim UnihanIM context
lustart details of the lookup choice window such as height, width, title, etc.
Returns:
0 if no error, > 0 if error occurs.

int(* _UnihanMethods::lookup_draw)(UnihanIM *uim, UnihanLookupDraw *ludraw)

Draws the candidate lookup choice window.

lookup_start() must be called first.

Parameters:
uim UnihanIM context
ludraw candidates to draw in the window
Returns:
0 if no error, > 0 if error occurs.

int(* _UnihanMethods::lookup_done)(UnihanIM *uim)

Closes the candidate lookup choice window.

Parameters:
uim UnihanIM context
Returns:
0 if no error, > 0 if error occurs.

int(* _UnihanMethods::status_draw)(UnihanIM *uim, char *s, UnihanStyleList *styles)

Shows a string in the status window.

Parameters:
uim UnihanIM context
s string to show in status window, NULL to clear the window
styles (currently unused)
Returns:
0 if no error, > 0 if error occurs.

int(* _UnihanMethods::commit_string)(UnihanIM *uim, char *s)

Commits a string to the IM client.

Parameters:
uim UnihanIM context
s the string to commit
Returns:
0 if no error, > 0 if error occurs.

int(* _UnihanMethods::locale_get)(UnihanIM *uim, char **locale)

Gets the locale of the current user.

Parameters:
uim UnihanIM context
locale pointer to a string to receive the locale, eg. zh_CN, zh_HK, zh_TW. The caller must not free or modify the returned string.
Returns:
0 if no error, > 0 if error occurs.

int(* _UnihanMethods::tcsc_mode_get)(UnihanIM *uim, UnihanTCSCMode *tcscMode)

Gets the current traditional/simplified mode.

Parameters:
uim UnihanIM context
tcscMode a pointer to a buffer to receive the current TC/SC mode
Returns:
0 if no error, > 0 if error occurs.

int(* _UnihanMethods::tcsc_do_conv)(UnihanIM *uim, UnihanTCSCMode tcscMode, char *orig, char **converted)

Performs traditional/simplified conversion.

Parameters:
uim UnihanIM context
tcscMode the kind of conversion to perform
orig the string to be converted
converted the converted string, newly allocated
Returns:
0 if no error, > 0 if error occurs.

int(* _UnihanMethods::mem_alloc)(UnihanIM *uim, size_t len, void **mem)

Allocates temporary memory.

The allocated memory will be freed by Unihan after the current event handler callback returns.

Parameters:
uim UnihanIM context
len size of memory to allocate
mem pointer to a void* to hold the newly allocated memory
Returns:
0 if no error, > 0 if error occurs.

int(* _UnihanMethods::client_info_get)(UnihanIM *uim, UnihanClientInfoType type, char **info)

Parameters:
uim UnihanIM context
Returns:
0 if no error, > 0 if error occurs.

int(* _UnihanMethods::is_fullwidth)(UnihanIM *uim)

Checks current fullwidth/halfwidth mode.

Parameters:
uim UnihanIM context
Returns:
TRUE if in fullwidth mode, FALSE if not

int(* _UnihanMethods::is_chinesepunc)(UnihanIM *uim)

Checks current Chinese/English punctuation mode.

Parameters:
uim UnihanIM context
Returns:
TRUE if in Chinese punctuation mode, FALSE if not

int(* _UnihanMethods::is_shuangpin)(UnihanIM *uim)

Checks current Shuangpin mode.

Parameters:
uim UnihanIM context
Returns:
TRUE if in Shangpin mode, FALSE if not

int(* _UnihanMethods::beep)(UnihanIM *uim)

Makes the IM client beep.

Parameters:
uim UnihanIM context
Returns:
0 if no error, > 0 if error occurs.

int(* _UnihanMethods::match_phrase)(UnihanIM *uim, char *s)

Begins phrase matching mode.

Parameters:
uim UnihanIM context
s key to match for phrases
Returns:
0 if no phrases found, 1 if phrases are found.

void(* _UnihanMethods::log)(UnihanIM *uim, UnihanLogLevelFlags log_level, const char *format,...)

Logs debug information.

Parameters:
uim UnihanIM context


The documentation for this struct was generated from the following file:
Generated on Fri Sep 7 15:51:41 2007 for unihan-core-le by  doxygen 1.5.2