Revert "License conversion from Flora to Apache 2.0"
[platform/core/uifw/dali-toolkit.git] / base / dali-toolkit / internal / controls / text-view / text-actor-cache.h
1 #ifndef __DALI_TOOLKIT_INTERNAL_TEXT_ACTOR_CACHE_H__
2 #define __DALI_TOOLKIT_INTERNAL_TEXT_ACTOR_CACHE_H__
3
4 //
5 // Copyright (c) 2014 Samsung Electronics Co., Ltd.
6 //
7 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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 // INTERNAL INCLUDES
21 #include <dali/public-api/actors/text-actor.h>
22
23 namespace Dali
24 {
25
26 namespace Toolkit
27 {
28
29 namespace Internal
30 {
31
32 /**
33  * Stores text-actors to be reused.
34  *
35  * Is it asumed that the first text-actor of a group of text-actors added to the cache is the first one to be rehused.
36  */
37 class TextActorCache
38 {
39
40 public:
41   /**
42    * Default constructor.
43    */
44   TextActorCache();
45
46   /**
47    * Destructor.
48    */
49   ~TextActorCache();
50
51   /**
52    * Inserts the given text-actors into the cache.
53    *
54    * First text-actor of the vector is the first one to be reused.
55    *
56    * @param[in] textActors The text-actors to be inserted into the cache.
57    */
58   void InsertTextActors( const std::vector<TextActor>& textActors );
59
60   /**
61    * Retrieves a text-actor from the cache.
62    *
63    * @return A handle to a text-actor. It returns a non initialized handle if the cache has no text-actors.
64    */
65   TextActor RetrieveTextActor();
66
67   /**
68    * Clears the text of the text-actor in the cache.
69    */
70   void ClearTexts();
71
72 private:
73   std::vector<TextActor> mTextActors; ///< Stores cached text-actors.
74 };
75
76 } // namespace Internal
77
78 } // namespace Toolkit
79
80 } // namespace Dali
81
82 #endif // __DALI_TOOLKIT_INTERNAL_TEXT_ACTOR_CACHE_H__