/*
 ******************************************************************************
 *
 *	ParcPlace Systems, Inc.
 *	Copyright (c) 1990, ParcPlace Systems, Inc. USA   All rights reserved.
 *
 ****************************************************************************
 *
 *	File:	kanji.H
 *
 *	Functions(s):
 *
 *	Description:
 *		OI_kanji_server class header
 *
 *	RCSid = "$Id: kanji.H,v 4.1.1.1 1993/06/01 22:54:51 mth Exp $"
 *
 ****************************************************************************
 */

#ifndef OI_kanji_H
#define OI_kanji_H

#ifndef OI_lngsrv_H
#include <OI/lngsrv.H>
#endif /* OI_lngsrv_H */

	class	OI_kanji_server : public OI_lang_server	{								/* language server */
		 private:
			OI_bool		first_time ;
			int		so ;
			char		sockbuf[BUFSIZ] ;
			char		*buffer_address ;
			int		length_of_buffer ;

			void		buf_to_symlen(char*, int*, int*, KeySym*) ;
			void		buf_to_firstanswer(char*, int*, int*);
			void		event_to_buffer(XKeyEvent*, char*) ;
			void		inquire_to_buffer(Window, char*) ;
			int		buf_to_inquire(char*, int*);
			OI_bool		select_wait(int) ;
			OI_bool		XConnectIS(Display*) ;
			OI_bool		XQueryISMode(Display*, Window, int*) ;
			int		XLookupKanjiString(XKeyEvent*, char**, KeySym*, XComposeStatus*) ;
			OI_bool		XToggleInputServer(Display*, Window) ;

		 protected:
		 public:
						OI_kanji_server(class OI_connection *cp) ;
		virtual	OI_lang_server		*clone(OI_connection*) ;
		virtual	OI_bool			toggle_state(OI_d_tech*) ;
		virtual	OI_bool			query_state(OI_d_tech*, OI_bool*) ;
		virtual	char			*communicate_to_server(const XEvent*, OI_number*) ;
		virtual	OI_bool			connected() ;
	} ;


#endif /* OI_kanji_H */
