Tizen 2.1 base
[platform/framework/native/ime.git] / src / FUiIme_ImeInfo.cpp
1 //\r
2 // Open Service Platform\r
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.\r
4 //\r
5 // Licensed under the Apache License, Version 2.0 (the License);\r
6 // you may not use this file except in compliance with the License.\r
7 // You may obtain a copy of the License at\r
8 //\r
9 //     http://www.apache.org/licenses/LICENSE-2.0\r
10 //\r
11 // Unless required by applicable law or agreed to in writing, software\r
12 // distributed under the License is distributed on an "AS IS" BASIS,\r
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
14 // See the License for the specific language governing permissions and\r
15 // limitations under the License.\r
16 //\r
17 \r
18 /**\r
19  * @file        FUiIme_ImeInfo.cpp\r
20  * @brief       This is the implementation file for the %_ImeInfo class.\r
21  *\r
22  * This implementation file contains definition of the %_ImeInfo class.\r
23  */\r
24 \r
25 #include <FBaseSysLog.h>\r
26 \r
27 #include "FUiIme_ImeInfo.h"\r
28 \r
29 #ifdef __cplusplus\r
30 extern "C"\r
31 {\r
32 #endif // __cplusplus\r
33 \r
34         void\r
35         InitImeInfo(const char* uuid, const char* name, const char* language)\r
36         {\r
37                 result r = E_SUCCESS;\r
38 \r
39                 r = Tizen::Ui::Ime::_ImeInfo::GetInstance()->Construct(uuid, name, language);\r
40                 SysTryLog(NID_UI_IME, r == E_SUCCESS, "Initializing _ImeInfo has failed.");\r
41 \r
42                 return;\r
43         }\r
44 \r
45 #ifdef __cplusplus\r
46 }\r
47 #endif // __cplusplus\r
48 \r
49 namespace Tizen { namespace Ui { namespace Ime {\r
50 \r
51 _ImeInfo::_ImeInfo(void)\r
52         :__uuid("")\r
53         ,__name("")\r
54         ,__language("")\r
55 {\r
56 \r
57 }\r
58 \r
59 _ImeInfo::~_ImeInfo(void)\r
60 {\r
61 \r
62 }\r
63 \r
64 _ImeInfo*\r
65 _ImeInfo::GetInstance(void)\r
66 {\r
67         static _ImeInfo imeInfo;\r
68 \r
69         return &imeInfo;\r
70 }\r
71 \r
72 result\r
73 _ImeInfo::Construct(const char* uuid, const char* name, const char* language)\r
74 {\r
75         result r = E_SUCCESS;\r
76 \r
77         __uuid = uuid;\r
78         __name = name;\r
79         __language = language;\r
80 \r
81         SysLog(NID_UI_IME, "The _ImeInfo has been constructed. The uuid is %s, the name is %s, and the language is %s.", uuid, name, language);\r
82 \r
83         return r;\r
84 }\r
85 \r
86 scim::String\r
87 _ImeInfo::GetUuid(void) const\r
88 {\r
89         return __uuid;\r
90 }\r
91 \r
92 scim::String\r
93 _ImeInfo::GetName(void) const\r
94 {\r
95         return __name;\r
96 }\r
97 \r
98 scim::String\r
99 _ImeInfo::GetLanguage(void) const\r
100 {\r
101         return __language;\r
102 }\r
103 \r
104 }}} // Tizen::Ui::Ime\r