Back to index

im-sdk  12.3.91
le-options.h
Go to the documentation of this file.
00001 /*
00002  * Copyright 2003 Sun Microsystems Inc.
00003  *
00004  * This is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the
00016  * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00017  * Boston, MA 02111-1307, USA.
00018  *
00019  * Authors: Karl Park <karl.park@sun.com>
00020  */
00021 
00022 #ifndef LE_OPTIONS_H
00023 #define LE_OPTIONS_H
00024 
00025 #ifndef Bool
00026 typedef enum {
00027   True=1, False=0
00028 } Boolean;
00029 #define Bool Boolean
00030 #endif
00031 
00032 #define DEFAULT_KOLE_OPTION_FILE "/usr/lib/iiim/le/kole/input_methods/kole.conf"
00033 /* NAME of Options */
00034 #define STR_OPTION_CHARSET "charset"
00035 #define STR_OPTION_DELETION "delete by jaso"
00036 #define STR_OPTION_KEYBOARD "keyboard"
00037 #define STR_OPTION_COMMITMODE "commit mode"
00038 
00039 /* Value of Options */
00040 #define STR_CHARSET_EUC "euc"
00041 #define STR_CHARSET_UNICODE "utf8"
00042 
00043 #define STR_DELETION_BY_JASO_YES "y"
00044 #define STR_DELETION_BY_JASO_NO "n"
00045 
00046 #define STR_KEYBOARD_LAYOUT_2PAIR "2bul"
00047 #define STR_KEYBOARD_LAYOUT_3PAIR390 "3bul_390"
00048 #define STR_KEYBOARD_LAYOUT_3PAIRFINAL "3bul_final"
00049 
00050 
00051 #define STR_COMMITMODE_BY_CHAR "char"
00052 #define STR_COMMITMODE_BY_HOTKEY "hotkey"
00053 
00054 
00055 enum KOLE_OPTION_TYPES {
00056   KOLE_OPTION_TYPE_KEYBOARD,
00057   KOLE_OPTION_TYPE_CHARSET,
00058   KOLE_OPTION_TYPE_DELETION,
00059   KOLE_OPTION_TYPE_CHARBASED_COMMIT,
00060   KOLE_OPTION_TYPE_COUNT,
00061 };
00062 
00063 typedef enum KOLE_OPTION_TYPES KOLE_option_type;
00064 
00065 
00066 enum _KEYBOARD_LAYOUT_T {
00067   LAYOUT_2PART = 0,
00068   LAYOUT_3PART390,
00069   LAYOUT_3PART_FINAL,
00070   LAYOUT_NUM,
00071 };
00072 typedef enum _KEYBOARD_LAYOUT_T KEYBOARD_LAYOUT_T;
00073 typedef KEYBOARD_LAYOUT_T OPTION_KEYBOARD_LAYOUT;
00074 
00075 typedef enum _OPTION_CHARSET {
00076   IN_EUC,
00077   IN_UNICODE,
00078 } OPTION_CHARSET;
00079 
00080 
00081 typedef enum _OPTION_DELETION{
00082   BY_CHAR,
00083   BY_JASO
00084 } OPTION_DELETION;
00085 
00086 typedef enum _OPTION_COMMIT_MODE {
00087   COMMIT_BY_CHAR,
00088   COMMIT_BY_HOTKEY
00089 } OPTION_COMMIT_MODE;
00090 
00091 typedef struct {
00092   enum KOLE_OPTION_TYPES type;
00093   char *vstr;
00094   union {
00095     KEYBOARD_LAYOUT_T kbd;
00096     OPTION_CHARSET cset;
00097     OPTION_DELETION del;
00098     OPTION_COMMIT_MODE commit_by;
00099   } v;
00100 } KOLE_config;
00101 
00102 typedef struct _Config Config;
00103 
00104 struct _Config {
00105   OPTION_CHARSET charset;
00106   OPTION_DELETION deletion;
00107   OPTION_KEYBOARD_LAYOUT keyboard;
00108   OPTION_COMMIT_MODE commit_mode;
00109 };
00110 
00111 #endif /* LE_OPTIONS_H */