1 #ifndef DALI_TOOLKIT_TEXT_SELECTION_TOOLBAR_H
2 #define DALI_TOOLKIT_TEXT_SELECTION_TOOLBAR_H
5 * Copyright (c) 2019 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 #include <dali-toolkit/public-api/controls/control.h>
30 namespace Internal DALI_INTERNAL
32 class TextSelectionToolbar;
36 * @brief A control which provides a Popup with a number of buttons
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.
41 * If the buttons exceed the size constraints of the popup then it will offer scrolling.
45 class DALI_TOOLKIT_API TextSelectionToolbar : public Control
50 * @brief The start and end property ranges for this control.
54 PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
55 PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices
59 * @brief An enumeration of properties belonging to the TextSelectionToolbar class.
65 MAX_SIZE = PROPERTY_START_INDEX, ///< name "maxSize", The maximum size the Popup can be, type VECTOR2
66 ENABLE_OVERSHOOT, ///< name "enableOvershoot", Whether the overshoot image is enabled, type BOOLEAN
67 ENABLE_SCROLL_BAR, ///< name "enableScrollBar", Whether the scroll-bar is enabled, type BOOLEAN
68 SCROLL_BAR_PADDING, ///< name "scrollBarPadding", The padding used to position the scroll bar, type VECTOR2
69 SCROLL_VIEW, ///< name "scrollView", Properties to set on scroll view type Property::Map
74 * Create the TextSelectionToolbar control.
75 * @return A handle to the TextSelectionToolbar control.
77 static TextSelectionToolbar New();
80 * @brief Creates an empty handle.
82 TextSelectionToolbar();
85 * @brief Copy constructor.
87 * @param[in] handle The handle to copy from.
89 TextSelectionToolbar( const TextSelectionToolbar& handle );
92 * @brief Assignment operator.
94 * @param[in] handle The handle to copy from.
95 * @return A reference to this.
97 TextSelectionToolbar& operator=( const TextSelectionToolbar& handle );
102 * This is non-virtual since derived Handle types must not contain data or virtual methods.
104 ~TextSelectionToolbar();
108 * @brief Add a option to the the Tool bar
109 * @param[in] option Option actor to add
111 void AddOption( Actor& option );
114 * @brief Add a divider to the the Tool bar
115 * @param[in] divider Actor to be used as divider
117 void AddDivider( Actor& divider );
120 * @brief ResizeDividers
121 * @param[in] size New size of dividers, provide 0 for height to automatically set height
123 void ResizeDividers( Size& size );
126 * @brief Raises the layer above the given @e target layer.
128 * @param[in] target The layer to get above of.
130 void RaiseAbove( Layer target );
133 * @copydoc Toolkit::ScrollView::ScrollTo(const Vector2&)
135 void ScrollTo( const Vector2& position );
138 * @brief Downcast a handle to TextSelectionToolbar.
140 * If the BaseHandle points is a TextSelectionToolbar the downcast returns a valid handle.
141 * If not the returned handle is left empty.
143 * @param[in] handle Handle to an object
144 * @return handle to a TextSelectionToolbar or an empty handle
146 static TextSelectionToolbar DownCast( BaseHandle handle );
148 public: // Not intended for application developers
151 * @brief Creates a handle using the Toolkit::Internal implementation.
153 * @param[in] implementation The Control implementation.
155 DALI_INTERNAL TextSelectionToolbar( Internal::TextSelectionToolbar& implementation );
158 * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
160 * @param[in] internal A pointer to the internal CustomActor.
162 explicit DALI_INTERNAL TextSelectionToolbar( Dali::Internal::CustomActor* internal );
164 }; // Class TextSelectionToolbar
166 } // namespace Toolkit
170 #endif // DALI_TOOLKIT_TEXT_SELECTION_TOOLBAR_H