Enable setting of ScrollView properties within TextSelectionToolbar via json
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / text-controls / text-selection-toolbar.h
1 #ifndef __DALI_TOOLKIT_TEXT_SELECTION_TOOLBAR_H__
2 #define __DALI_TOOLKIT_TEXT_SELECTION_TOOLBAR_H__
3
4 /*
5  * Copyright (c) 2015 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 // INTERNAL INCLUDES
22 #include <dali-toolkit/public-api/controls/control.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 namespace Internal DALI_INTERNAL
31 {
32 class TextSelectionToolbar;
33 }
34
35 /**
36  * @brief A control which provides a Popup with a number of buttons
37  *
38  * The style of the pop can be set through style sheets, this includes the images for the buttons
39  * A Show and Hide API is provided.
40  *
41  * If the buttons exceed the size constraints of the popup then it will offer scrolling.
42  *
43  *
44  */
45 class DALI_IMPORT_API TextSelectionToolbar : public Control
46 {
47 public:
48
49   /**
50    * @brief The start and end property ranges for this control.
51    */
52   enum PropertyRange
53   {
54     PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
55     PROPERTY_END_INDEX =   PROPERTY_START_INDEX + 1000              ///< Reserve property indices
56   };
57
58   /**
59    * @brief An enumeration of properties belonging to the TextSelectionToolbar class.
60    */
61   struct Property
62   {
63     enum
64     {
65       MAX_SIZE =  PROPERTY_START_INDEX, ///< name "max-size",                The maximum size the Popup can be,              type VECTOR2
66       ENABLE_OVERSHOOT,                 ///< name "enable-overshoot",        Whether the overshoot image is enabled,         type BOOLEAN
67       SCROLL_VIEW,                      ///< name "scroll-view",             Properties to set on scroll view                type Property::Map
68     };
69   };
70
71   /**
72    * Create the TextSelectionToolbar control.
73    * @return A handle to the TextSelectionToolbar control.
74    */
75   static TextSelectionToolbar New();
76
77   /**
78    * @brief Creates an empty handle.
79    */
80   TextSelectionToolbar();
81
82   /**
83    * @brief Copy constructor.
84    *
85    * @param[in] handle The handle to copy from.
86    */
87   TextSelectionToolbar( const TextSelectionToolbar& handle );
88
89   /**
90    * @brief Assignment operator.
91    *
92    * @param[in] handle The handle to copy from.
93    * @return A reference to this.
94    */
95   TextSelectionToolbar& operator=( const TextSelectionToolbar& handle );
96
97   /**
98    * @brief Destructor
99    *
100    * This is non-virtual since derived Handle types must not contain data or virtual methods.
101    */
102   ~TextSelectionToolbar();
103
104
105   /**
106    * @brief Add a option to the the Tool bar
107    * @param[in] option Option actor to add
108    */
109   void AddOption( Actor& option );
110
111   /**
112    * @brief Add a divider to the the Tool bar
113    * @param[in] divider Actor to be used as divider
114    */
115   void AddDivider( Actor& divider );
116
117   /**
118    *  @brief ResizeDividers
119    *  @param[in] size New size of dividers, provide 0 for height to automatically set height
120    */
121   void ResizeDividers( Size& size );
122
123   /**
124    * @brief Raises the layer above the given @e target layer.
125    *
126    * @param[in] target The layer to get above of.
127    */
128   void RaiseAbove( Layer target );
129
130   /**
131    * @brief Downcast a handle to TextSelectionToolbar.
132    *
133    * If the BaseHandle points is a TextSelectionToolbar the downcast returns a valid handle.
134    * If not the returned handle is left empty.
135    *
136    * @param[in] handle Handle to an object
137    * @return handle to a TextSelectionToolbar or an empty handle
138    */
139   static TextSelectionToolbar DownCast( BaseHandle handle );
140
141 public: // Not intended for application developers
142
143   /**
144    * @brief Creates a handle using the Toolkit::Internal implementation.
145    *
146    * @param[in] implementation The Control implementation.
147    */
148   DALI_INTERNAL TextSelectionToolbar( Internal::TextSelectionToolbar& implementation );
149
150   /**
151    * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
152    *
153    * @param[in]  internal  A pointer to the internal CustomActor.
154    */
155   explicit DALI_INTERNAL TextSelectionToolbar( Dali::Internal::CustomActor* internal );
156
157 }; // Class TextSelectionToolbar
158
159 } // namespace Toolkit
160
161 } // namespace Dali
162
163 #endif // __DALI_TOOLKIT_TEXT_SELECTION_TOOLBAR_H__