1 #ifndef __DALI_CHARACTER_H__
2 #define __DALI_CHARACTER_H__
5 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
22 * @addtogroup CAPI_DALI_TEXT_MODULE
27 #include <dali/public-api/common/dali-common.h>
29 namespace Dali DALI_IMPORT_API
32 namespace Internal DALI_INTERNAL
38 * @brief The Character class encapsulates a character implementation to support multiple languages.
40 * This class is provided for convenience. A user can't instantiate Characters directly.
41 * However, by instantiating a Text object, Characters are returned by Text::operator[].
48 * @brief CharacterDirection
50 * Characters can be classified under one of five direction types, which determines the
51 * direction in which they are displayed.
53 * English is a left-to-right language.
54 * If English were instead right-to-left, then the word English would be displayed as
57 enum CharacterDirection
59 LeftToRight, ///< Left to Right characters are the most common (e.g. English and other Indo-European languages)
60 RightToLeft, ///< Right to Left characters are less common (e.g. Hebrew and Arabic)
61 LeftToRightWeak, ///< Weak Left to Right characters (e.g. numbers)
62 RightToLeftWeak, ///< Weak Right to Left characters
63 Neutral ///< Neutral characters follow the direction of characters surrounding them (e.g. whitespace ' ')
69 * @brief Copy constructor.
71 * @param [in] character Character to be copied.
73 Character( const Character& character );
76 * @brief Assignment operator.
78 * @param [in] character Character to be assigned.
79 * @return a reference to this
81 Character& operator=( const Character& character );
84 * @brief Non virtual destructor.
89 * @brief Equality operator.
91 * @param [in] character The character to be compared.
92 * @return true if the character is identical
94 bool operator==( const Character& character ) const;
97 * @brief Inequality operator.
99 * @param [in] character The character to be compared.
100 * @return true if the character is not identical
102 bool operator!=( const Character& character ) const;
105 * @brief Returns direction of this character.
107 * @return The character's direction is returned see CharacterDirection
109 CharacterDirection GetCharacterDirection() const;
112 * @brief Returns whether this character is white space (true)
115 * @return true if a whitespace character, false otherwise.
117 bool IsWhiteSpace() const;
120 * @brief Returns whether this character is a new line character (true).
123 * @return true if a new line character, false otherwise.
125 bool IsNewLine() const;
128 Internal::Character* mImpl;
131 * @brief Default constructor.
135 DALI_INTERNAL Character();
137 public: // Not intended for application developers
138 DALI_INTERNAL Character( Internal::Character* impl );
140 DALI_INTERNAL const Internal::Character& GetImplementation() const;
142 DALI_INTERNAL Internal::Character& GetImplementation();
150 #endif // __DALI_CHARACTER_H__