(Build) Ensure default style is installed & remove autoconf file lists
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / internal / text / hidden-text.h
1 #ifndef DALI_HIDDEN_TEXT_H
2 #define DALI_HIDDEN_TEXT_H
3
4 /*
5  * Copyright (c) 2019 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 <dali/public-api/adaptor-framework/timer.h>
23 #include <dali/public-api/object/property-map.h>
24
25 // INTERNAL INCLUDES
26 #include <dali-toolkit/public-api/controls/text-controls/hidden-input-properties.h>
27 #include <dali-toolkit/internal/text/text-definitions.h>
28
29 namespace Dali
30 {
31
32 namespace Toolkit
33 {
34
35 namespace Text
36 {
37
38 /**
39  * Class to handle the hidden text
40  */
41 class HiddenText : public ConnectionTracker
42 {
43 public:
44   class Observer
45   {
46   public:
47
48     /**
49      * @brief Invoked when the time to show last character is expired
50      */
51     virtual void DisplayTimeExpired() = 0;
52   };
53
54   /**
55    * @brief Constructor
56    * @param[in] observer The Observer pointer.
57    */
58   HiddenText( Observer* observer );
59
60 public: // Intended for internal use
61
62   /**
63    * @brief Used to set options of hidden text
64    * @param[in] map The property map describing the option
65    */
66   void SetProperties( const Property::Map& map );
67
68   /**
69    * @brief Retrieve property map of hidden text options
70    * @param[out] map The hidden text option
71    */
72   void GetProperties( Property::Map& map );
73
74   /**
75    * @brief Convert source text to destination text according to current option
76    * @param[in] source The original text
77    * @param[out] destination The applied text
78    */
79   void Substitute( const Vector<Character>& source, Vector<Character>& destination );
80
81   /**
82    * @brief Invoked when the timer is expired
83    */
84   bool OnTick();
85
86 private:
87
88   Timer mTimer;
89   Observer* mObserver;
90   int mHideMode;
91   int mSubstituteText;
92   int mDisplayDuration;
93   int mSubstituteCount;
94   Length mPreviousTextCount;
95 };
96
97 } // namespace Text
98
99 } // namespace Toolkit
100
101 } // namespace Dali
102
103 #endif // DALI_HIDDEN_TEXT_H