1 /***************************************************************************
2  *   Copyright (C) 2010~2010 by CSSlayer                                   *
3  *   wengxt@gmail.com                                                      *
4  *                                                                         *
5  *   This program is free software; you can redistribute it and/or modify  *
6  *   it under the terms of the GNU General Public License as published by  *
7  *   the Free Software Foundation; either version 2 of the License, or     *
8  *   (at your option) any later version.                                   *
9  *                                                                         *
10  *   This program is distributed in the hope that it will be useful,       *
11  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
12  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
13  *   GNU General Public License for more details.                          *
14  *                                                                         *
15  *   You should have received a copy of the GNU General Public License     *
16  *   along with this program; if not, write to the                         *
17  *   Free Software Foundation, Inc.,                                       *
18  *   51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.              *
19  ***************************************************************************/
20 
21 #ifndef PYCONFIG_H
22 #define PYCONFIG_H
23 #include "fcitx-config/fcitx-config.h"
24 #include "fcitx/configfile.h"
25 #include "sp.h"
26 
27 struct MHPY;
28 
29 typedef enum _ADJUSTORDER {
30     AD_NO = 0,
31     AD_FAST = 1,
32     AD_FREQ = 2
33 } ADJUSTORDER;
34 
35 typedef enum _SHUANGPINSCHEME {
36     SP_ZIRANMA,
37     SP_MS,
38     SP_ZIGUANG,
39     SP_ABC,
40     SP_ZHONGWENZHIXING,
41     SP_PINYINJIAJIA,
42     SP_XIAOHE,
43     SP_USERDEFINE,
44 } SHUANGPINSCHEME;
45 
46 typedef struct _PYMappedSplitData PYMappedSplitData;
47 
48 typedef struct _FcitxPinyinConfig {
49     FcitxGenericConfig gconfig;
50 
51     SHUANGPINSCHEME spscheme;
52     boolean bFullPY;
53     boolean bPYCreateAuto;
54     boolean bPYSaveAutoAsPhrase;
55     boolean bFixCursorAtHead;
56     boolean bUseVForQuickPhrase;
57     ADJUSTORDER baseOrder;
58     ADJUSTORDER phraseOrder;
59     ADJUSTORDER freqOrder;
60     FcitxHotkey hkPYAddFreq[2];
61     FcitxHotkey hkPYDelFreq[2];
62     FcitxHotkey hkPYDelUserPhr[2];
63     char* strPYGetWordFromPhrase;
64     struct _MHPY *MHPY_C;
65     struct _MHPY *MHPY_S;
66     boolean bMisstypeNGGN;
67     struct _PYTABLE *PYTable;
68     char cNonS;
69     SP_C SPMap_C[31];
70     SP_S SPMap_S[4];
71 
72     PYMappedSplitData* splitData;
73 } FcitxPinyinConfig;
74 
75 CONFIG_BINDING_DECLARE(FcitxPinyinConfig);
76 boolean LoadPYConfig(FcitxPinyinConfig *pyconfig);
77 void SavePYConfig(FcitxPinyinConfig *pyconfig);
78 
79 #endif
80 // kate: indent-mode cstyle; space-indent on; indent-width 0;
81