Merge "Add to support a multi-window mode" into devel_3.0_main
[platform/framework/native/appfw.git] / src / text / FText_Ucs2EncodingCore.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file                FText_Ucs2EncodingCore.h
19  * @brief               This is the header file for the _Ucs2EncodingCore class.
20  */
21
22 #ifndef _FTEXT_INTERNAL_UCS2_ENCODING_CORE_H_
23 #define _FTEXT_INTERNAL_UCS2_ENCODING_CORE_H_
24
25 #include <FBase.h>
26 #include "FText_EncodingCore.h"
27
28
29 namespace Tizen { namespace Text
30 {
31
32 enum Ucs2EncodingType
33 {
34         UCS2_ENCODING,
35         UCS2_ENCODING_BE,
36         UCS2_ENCODING_LE
37 };
38
39 enum Ucs2BomType
40 {
41         UCS2_BOM_NONE,
42         UCS2_BOM_BE,
43         UCS2_BOM_LE
44 };
45
46 class _Ucs2EncodingCore
47         : public _EncodingCore
48 {
49 public:
50         _Ucs2EncodingCore(void);
51         ~_Ucs2EncodingCore(void);
52
53         static _EncodingCore* GetEncodingCoreImplN(const Tizen::Base::String& encodingFrom, const Tizen::Base::String& encodingTo);
54
55         virtual result GetByteCount(const wchar_t* pSrc, int srcLength, int& retLength);
56         virtual result GetCharCount(const byte* pSrc, int srcLength, int& retLength);
57
58         virtual byte* EncodeN(const wchar_t* pSrc, int srcLength, int& retLength);
59         virtual wchar_t* DecodeN(const byte* pSrc, int srcLength, int& retLength);
60
61         virtual int GetMaxByteCount(int charCount) const;
62         virtual int GetMaxCharCount(int byteCount) const;
63
64         virtual Tizen::Base::String GetName(void);
65
66 private:
67         Ucs2EncodingType __encodingType;
68         Ucs2BomType __bomType;
69         Tizen::Base::String __encodingName;
70
71 }; // _Ucs2EncodingCore
72
73
74 } } // Tizen::Text
75
76
77 #endif  //_FTEXT_INTERNAL_UCS2_ENCODING_CORE_H_