TextInput - Fixes the selection box for right to left text.
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / internal / controls / text-input / text-input-text-style-impl.h
1 #ifndef __DALI_TOOLKIT_INTERNAL_TEXT_INPUT_TEXT_STYLE_H__
2 #define __DALI_TOOLKIT_INTERNAL_TEXT_INPUT_TEXT_STYLE_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 #include <dali/dali.h>
22
23 // INTERNAL INCLUDES
24
25 #include <dali-toolkit/internal/controls/text-input/textview-character-positions-impl.h>
26
27 namespace Dali
28 {
29
30 namespace Toolkit
31 {
32
33 namespace Internal
34 {
35
36 class TextInputTextStyle;
37
38 typedef IntrusivePtr<TextInputTextStyle> TextInputTextStylePtr;
39
40 /**
41  *  Stores the Input Text Style and provides functions to retrieve and manipulate it.
42  */
43
44 class TextInputTextStyle : ConnectionTracker
45 {
46
47 public:
48
49   /**
50    * @brief Constructor
51    */
52   TextInputTextStyle(){};
53
54   /**
55    * @brief Destructor
56    */
57    ~TextInputTextStyle(){};
58
59   /**
60    * @brief Returns the current Input Style, this is the style that newly inputed text will inherit.
61    * @return TextStyle object representing new style.
62    */
63   TextStyle GetInputStyle() const{return mInputStyle;};
64
65   /**
66    * @brief Sets the Input style so newly inputed text will inherit this.
67    * @param[in] newStyle the style to now use for Input
68    * @return returns true if style changed.  False if new style is the same as current setting.
69    */
70   bool SetInputStyle( const TextStyle newStyle, const TextStyle::Mask mask = TextStyle::ALL ){return false;};
71
72   /**
73    * @brief Gets the Current Font used for newly inputed text
74    * @return the Font currently set for new text
75    */
76   Dali::Font GetInputFont() const{return Dali::Font();};
77
78   /**
79    * Signals
80    */
81
82   /* Input style changed signal.*/
83   typedef SignalV2< void( const TextStyle& style ) > StyleChangedSignalType;
84
85   /**
86    * @brief Signal emitted when style changes.
87    * @return The signal to connect to
88    */
89   StyleChangedSignalType& StyleChangedSignal();
90
91 private:
92
93   /**
94    * @brief Copy Constructor
95    * @param[in] textStyle
96    * Undefined/Hidden.
97    */
98   TextInputTextStyle(const TextInputTextStyle& textStyle );
99
100   /**
101    * @Assignment Constructor
102    * @param[in] rhs
103    * Undefined/Hidden.
104    */
105   TextInputTextStyle& operator=(const TextInputTextStyle& rhs);
106
107 private:
108
109   TextStyle mInputStyle;                               // Stores the current input style.
110   StyleChangedSignalType mStyleChangedSignal;          // Signal emitted when style changes.
111 };
112
113 } // namespace Internal
114
115 } // namespace Toolkit
116
117 } // namespace Dali
118
119 #endif // __DALI_TOOLKIT_INTERNAL_TEXT_INPUT_TEXT_STYLE_H__
120
121