~lidaobing/+junk/zhcon

« back to all changes in this revision

Viewing changes to src/ImmModule.h

  • Committer: LI Daobing
  • Date: 2008-11-04 04:39:18 UTC
  • Revision ID: lidaobing@gmail.com-20081104043918-nfwwvgfb0uied0mt
importĀ 1:0.2.6-5.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// vi:ts=4:shiftwidth=4:expandtab
 
2
/*
 
3
 *
 
4
 * UNICON - The Console Chinese & I18N
 
5
 * Copyright (c) 1999-2000
 
6
 *
 
7
 * This file is part of UNICON, a console Chinese & I18N
 
8
 *
 
9
 * This program is free software; you can redistribute it and/or modify
 
10
 * it under the terms of the GNU General Public License as published by
 
11
 * the Free Software Foundation; either version 2 of the License, or
 
12
 * (at your option) any later version.
 
13
 *
 
14
 * This program is distributed in the hope that it will be useful,
 
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
17
 * GNU General Public License for more details.
 
18
 *
 
19
 * You should have received a copy of the GNU General Public License
 
20
 * along with this program; if not, write to the Free Software
 
21
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 
22
 *
 
23
 * See the file COPYING directory of this archive
 
24
 * Author: see CREDITS
 
25
 */
 
26
 
 
27
/*****************************************************************************
 
28
 *
 
29
 *       ImmModule.h  ====    Defination of Method Modules Interface 
 
30
 *
 
31
 ***************************************************************************/
 
32
#ifndef __IMMMODULE_H__
 
33
#define __IMMMODULE_H__
 
34
 
 
35
#include <stdlib.h>
 
36
#include <Phrase.h>
 
37
#include <ImmDefs.h>
 
38
 
 
39
typedef struct  __IMM_CLIENT__
 
40
{
 
41
    /* ClientData for recording states */
 
42
    void *pImmClientData;
 
43
 
 
44
    /* Buffer for the PhraseItem */
 
45
    PhraseItem m;
 
46
    char buf[512];
 
47
 
 
48
} IMM_CLIENT;
 
49
 
 
50
struct ImmOperation
 
51
{
 
52
    char     *name;
 
53
    char     *version;
 
54
    char     *comments;
 
55
    u_long   type;               /* eg. IMM_BIG5 << 24 | IMM_CCE */
 
56
 
 
57
    /* File I/O Operation */
 
58
    IMM_CLIENT *(*open) (char *szFileName, long type);
 
59
    int (*save)  (IMM_CLIENT *p, char *szFileName);
 
60
    int (*close) (IMM_CLIENT *p);
 
61
 
 
62
    /* Indepent Modules support */
 
63
    int (*KeyFilter) (IMM_CLIENT *p, u_char key, char *buf, int *len);
 
64
    int (*ResetInput) (IMM_CLIENT *p);
 
65
 
 
66
    /* Input Area Configuration & Operation */
 
67
    int (*ConfigInputArea) (IMM_CLIENT *pImm, int SelectionLen);
 
68
    int (*GetInputDisplay) (IMM_CLIENT *pImm, char *buf, long buflen);
 
69
    int (*GetSelectDisplay) (IMM_CLIENT *pImm, char *buf, long buflen);
 
70
    
 
71
    /* Phrase Operation */
 
72
    PhraseItem * (*pGetItem) (IMM_CLIENT *p, u_long n);
 
73
    int    (*AddPhrase) (IMM_CLIENT *pClient, PhraseItem *p);
 
74
    int    (*ModifyPhraseItem) (IMM_CLIENT *p, long n, PhraseItem *pItem);
 
75
    int    (*Flush) (IMM_CLIENT *p);
 
76
};
 
77
 
 
78
#endif
 
79