1 /**
2  *  Yudit Unicode Editor Source File
3  *
4  *  GNU Copyright (C) 1997-2006  Gaspar Sinai <gaspar@yudit.org>
5  *
6  *  This program is free software; you can redistribute it and/or modify
7  *  it under the terms of the GNU General Public License, version 2,
8  *  dated June 1991. See file COPYYING for details.
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 Free Software
17  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */
19 
20 #ifndef SB_Generic_h
21 #define SB_Generic_h
22 
23 #include "stoolkit/SUniMap.h"
24 #include "stoolkit/STypes.h"
25 #include "stoolkit/SString.h"
26 #include "stoolkit/SStringVector.h"
27 #include "stoolkit/sencoder/SBEncoder.h"
28 
29 /**
30  * This is a generic converter based upon externap 'my' maps.
31  * @author: Gaspar Sinai <gaspar@yudit.org>
32  * @version: 2000-05-12
33  */
34 class SB_Generic : SBEncoder
35 {
36 public:
37   SB_Generic (const SString& name);
38   virtual ~SB_Generic ();
39 
40   virtual const SString& encode (const SV_UCS4& input);
41   virtual const SV_UCS4& decode (const SString& input);
42   virtual unsigned int getDecoderMap (SStringVector* key, SStringVector* value,
43         unsigned int size);
44 
45   virtual const SStringVector& delimiters ();
46   virtual const SStringVector& delimiters (const SString& sample);
47   virtual SString preEditBuffer() const;
48   virtual SV_UCS4 postEditBuffer () const;
49   virtual void clear();
50 
51   bool isOK() const;
52 
53 protected:
54   SUniMap   map;
55   bool      clustered; /* cluster */
56   bool      ok;
57 };
58 
59 #endif /* SB_Generic_h */
60