Newer
Older
scim-wnn / scim-wnn / src / wnnconversion.h
@tamra tamra on 20 Nov 2004 2 KB 変換の仮実装。
/***************************************************************************
 *   Copyright (C) 2004 by TAM(Teppei Tamra)                               *
 *   tam-t@par.odn.ne.jp                                                   *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/
#ifndef WNNCONVERSION_H
#define WNNCONVERSION_H


#include <cstdio>
#include <cstdlib>
#include <list>
#include <wnnproto.h>
#define Uses_SCIM_ICONV
#include <scim.h>
#include <scim_iconv.h>

using namespace scim;
using namespace std;


/**
@author TAM(Teppei Tamra)
*/
class WnnConversionList{
public:
    WideString Yomi;
    list<WideString> kouho;
};

class WnnConversion{
public:
    WnnConversion();

    ~WnnConversion();
    bool isConnected();
    void reset();
    void setYomiText(WideString yomi);
    int ren_conversion();
    WideString getText();

protected:
    void wstostr(unsigned char *e,w_char *u);
    void strtows(w_char *u,unsigned char *e);
    static int wnn_message (char *s);
    static int wnn_error (char *s);

protected:
    struct wnn_buf *wnn;
    IConvert m_iconv;
    WideString yomiText;
    WideString text;
    list<WnnConversionList> convList;

};

#endif