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