1 /**
2  * chewingutil.h
3  *
4  * Copyright (c) 1999, 2000, 2001
5  *	Lu-chuan Kung and Kang-pen Chen.
6  *	All rights reserved.
7  *
8  * Copyright (c) 2004, 2005
9  *	libchewing Core Team. See ChangeLog for details.
10  *
11  * See the file "COPYING" for information on usage and redistribution
12  * of this file.
13  */
14 
15 #ifndef _CHEWING_UTIL_H
16 #define _CHEWING_UTIL_H
17 
18 #define SYMBOL_KEY_OK 0
19 #define SYMBOL_KEY_ERROR 1
20 #define DECREASE_CURSOR 1
21 #define NONDECREASE_CURSOR 0
22 
23 void AutoLearnPhrase( ChewingData *pgdata );
24 void SetUpdatePhraseMsg( ChewingData *pgdata, char *addWordSeq, int len, int state );
25 int NoSymbolBetween( ChewingData *pgdata, int begin, int end );
26 int ChewingIsEntering( ChewingData *pgdata );
27 void CleanAllBuf( ChewingData * );
28 int SemiSymbolInput(int key, ChewingData *pgdata);
SetUpdatePhraseMsg(ChewingData * pgdata,char * addWordSeq,int len,int state)29 int SpecialEtenSymbolInput( int key, ChewingData *pgdata );
30 int SpecialSymbolInput( int key, ChewingData *pgdata );
31 int SymbolInput( int key, ChewingData *pgdata );
32 int SymbolChoice( ChewingData *pgdata, int sel_i );
33 int HaninSymbolInput(ChoiceInfo *pci, AvailInfo *pai, const uint16 phoneSeq[],  int selectAreaLen);
34 int WriteChiSymbolToBuf( wch_t csBuf[], int csBufLen, ChewingData *pgdata );
35 int ReleaseChiSymbolBuf( ChewingData *pgdata, ChewingOutput *);
36 int AddChi( uint16 phone, ChewingData *pgdata );
37 int CallPhrasing( ChewingData *pgdata );
38 int MakeOutput( ChewingOutput *pgo, ChewingData *pgdata );
39 int MakeOutputWithRtn( ChewingOutput *pgo, ChewingData *pgdata, int keystrokeRtn );
40 void MakeOutputAddMsgAndCleanInterval( ChewingOutput *pgo, ChewingData *pgdata );
41 int AddSelect( ChewingData *pgdata, int sel_i );
42 int CountSelKeyNum( int key, ChewingData *pgdata );
43 int ChewingIsChiAt( int cursor, ChewingData *pgdata );
44 int ChewingKillSelectIntervalAcross( int cursor, ChewingData *pgdata );
45 int KillCharInSelectIntervalAndBrkpt( ChewingData *pgdata, int cursorToKill );
46 int ChewingKillChar(
47 		ChewingData *pgdata,
48 		int cursorToKill,
49 		int chiSymbolCursorToKill,
50 		int minus );
51 void RemoveSelectElement( int i, ChewingData *pgdata );
52 int IsPreferIntervalConnted( int cursor, ChewingData *pgdata );
53 
54 #endif
55 
56