Merge "AsyncTaskManager overhead reduce" into devel/master
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / text-abstraction / emoji-helper.cpp
1 /*
2  * Copyright (c) 2021 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 HEADER
19 #include <dali/devel-api/text-abstraction/emoji-helper.h>
20
21 namespace Dali
22 {
23 namespace TextAbstraction
24 {
25 DALI_ADAPTOR_API bool IsSymbolScript(const TextAbstraction::Script& script)
26 {
27   return (TextAbstraction::SYMBOLS1 == script ||
28           TextAbstraction::SYMBOLS2 == script ||
29           TextAbstraction::SYMBOLS3 == script ||
30           TextAbstraction::SYMBOLS4 == script ||
31           TextAbstraction::SYMBOLS5 == script ||
32           TextAbstraction::SYMBOLS_NSLCL == script);
33 }
34
35 DALI_ADAPTOR_API bool IsEmojiScript(const TextAbstraction::Script& script)
36 {
37   return (TextAbstraction::EMOJI == script);
38 }
39
40 DALI_ADAPTOR_API bool IsEmojiTextScript(const TextAbstraction::Script& script)
41 {
42   return (TextAbstraction::EMOJI_TEXT == script);
43 }
44
45 DALI_ADAPTOR_API bool IsEmojiColorScript(const TextAbstraction::Script& script)
46 {
47   return (TextAbstraction::EMOJI_COLOR == script);
48 }
49
50 DALI_ADAPTOR_API bool IsOneOfEmojiScripts(const TextAbstraction::Script& script)
51 {
52   return (IsEmojiScript(script) || IsEmojiColorScript(script) || IsEmojiTextScript(script));
53 }
54
55 DALI_ADAPTOR_API bool IsSymbolOrEmojiScript(const TextAbstraction::Script& script)
56 {
57   return (IsEmojiScript(script) || IsSymbolScript(script));
58 }
59
60 DALI_ADAPTOR_API bool IsSymbolOrEmojiOrTextScript(const TextAbstraction::Script& script)
61 {
62   return (IsSymbolScript(script) || IsOneOfEmojiScripts(script));
63 }
64
65 DALI_ADAPTOR_API Character GetUnicodeForInvisibleGlyph()
66 {
67   return TextAbstraction::CHAR_ZWS;
68 }
69
70 } // namespace TextAbstraction
71
72 } // namespace Dali