Merge "DALi Version 1.0.30" into tizen
[platform/core/uifw/dali-core.git] / dali / internal / event / images / emoji-factory.h
1 #ifndef __DALI_INTERNAL_EMOJI_FACTORY_H__
2 #define __DALI_INTERNAL_EMOJI_FACTORY_H__
3
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <string>
23 #include <stdint.h>
24
25 // INTERNAL INCLUDES
26 #include <dali/public-api/common/map-wrapper.h>
27
28 namespace Dali
29 {
30
31 namespace Internal
32 {
33
34 /**
35  * EmojiFactory is an object that store emoji file names indexing them by its unicode value.
36  */
37 class EmojiFactory
38 {
39 public:
40
41   /**
42    * Default constructor.
43    */
44   EmojiFactory();
45
46   /**
47    * Default destructor.
48    */
49   virtual ~EmojiFactory();
50
51   /**
52    * Retrieves whether the character is an emoji.
53    *
54    * @param[in] character The character to be checked.
55    *
56    * @return \e true if the emoji has been inserted. Otherwise it return \e false.
57    */
58   bool IsEmoji( uint32_t character ) const;
59
60   /**
61    * Retrieves the emoji file name for the given character.
62    *
63    * @param[in] character The given character.
64    *
65    * @return A string with the emoji file name or a void string if the character is not an emoji.
66    */
67   std::string GetEmojiFileNameFromCharacter( uint32_t character ) const;
68
69 private:
70
71   // Undefined
72   EmojiFactory( const EmojiFactory& rhs );
73
74   // Undefined
75   EmojiFactory& operator=( const EmojiFactory& rhs );
76
77 private:
78   std::map<uint32_t,std::string> mColorGlyphs; ///< Emoji map with the file names indexed by the unicode.
79   uint32_t mMinEmoji;                          ///< The minimum emoji code.
80 };
81
82 } // namespace Internal
83
84 } // namespace Dali
85
86 #endif // __DALI_INTERNAL_EMOJI_FACTORY_H__