1 #ifndef __DALI_TOOLKIT_TEXT_SELECTION_POPUP_H__
2 #define __DALI_TOOLKIT_TEXT_SELECTION_POPUP_H__
5 * Copyright (c) 2015 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 class TextSelectionPopupCallbackInterface;
32 namespace Internal DALI_INTERNAL
34 class TextSelectionPopup;
38 * @brief A control which provides a Popup with a number of buttons
40 * The style of the pop can be set through style sheets, this includes the images for the buttons
41 * A Show and Hide API is provided.
43 * If the buttons exceed the size constraints of the popup then it will offer scrolling.
47 class DALI_IMPORT_API TextSelectionPopup : public Control
63 * @brief The start and end property ranges for this control.
67 PROPERTY_START_INDEX = Control::CONTROL_PROPERTY_END_INDEX + 1,
68 PROPERTY_END_INDEX = PROPERTY_START_INDEX + 1000 ///< Reserve property indices
72 * @brief An enumeration of properties belonging to the TextSelectionPopup class.
78 POPUP_MAX_SIZE = PROPERTY_START_INDEX, ///< name "popup-max-size", maximum size the Popup can be, type VECTOR2
79 POPUP_MIN_SIZE, ///< name "popup-min-size", minimum size the Popup can be, type VECTOR2
80 OPTION_MAX_SIZE, ///< name "option-max-size", maximum size an option can be, type VECTOR2
81 OPTION_MIN_SIZE, ///< name "option-min-size", minimum size an option can be, type VECTOR2
82 OPTION_DIVIDER_SIZE, ///< name "option-divider-size", size of the divider between options type VECTOR2
83 POPUP_CLIPBOARD_BUTTON_ICON_IMAGE, ///< name "popup-clipboard-button-image", The image to use as the popup clipboard icon, type STRING
84 POPUP_CUT_BUTTON_ICON_IMAGE, ///< name "popup-cut-button-image", The image to use as the popup cut icon, type STRING
85 POPUP_COPY_BUTTON_ICON_IMAGE, ///< name "popup-copy-button-image", The image to use as the popup copy icon, type STRING
86 POPUP_PASTE_BUTTON_ICON_IMAGE, ///< name "popup-paste-button-image", The image to use as the popup paste icon, type STRING
87 POPUP_SELECT_BUTTON_ICON_IMAGE, ///< name "popup-select-button-image", The image to use as the popup select icon, type STRING
88 POPUP_SELECT_ALL_BUTTON_ICON_IMAGE, ///< name "popup-select-all-button-image", The image to use as the popup select all icon, type STRING
89 DIVIDER_COLOR, ///< name "popup-divider-color", VECTOR4, The color of the divider between options, type VECTOR4
90 ICON_COLOR, ///< name "popup-icon-color", VECTOR4, The color of the icons (if supplied), type VECTOR4
91 PRESSED_COLOR ///< name "popup-pressed-color", VECTOR4, The color of the option when pressed, type VECTOR4
96 * Create the TextSelectionPopup control with the given set of buttons.
97 * @param[in] enabledButtons The given set of buttons to enable
98 * @param[in] callbackInterface The text popup callback interface which receives the button click callbacks.
99 * @return A handle to the TextSelectionPopup control.
101 static TextSelectionPopup New( Buttons enabledButtons,
102 TextSelectionPopupCallbackInterface* callbackInterface );
105 * @brief Creates an empty handle.
107 TextSelectionPopup();
110 * @brief Copy constructor.
112 * @param[in] handle The handle to copy from.
114 TextSelectionPopup( const TextSelectionPopup& handle );
117 * @brief Assignment operator.
119 * @param[in] handle The handle to copy from.
120 * @return A reference to this.
122 TextSelectionPopup& operator=( const TextSelectionPopup& handle );
127 * This is non-virtual since derived Handle types must not contain data or virtual methods.
129 ~TextSelectionPopup();
132 * @brief Downcast a handle to TextSelectionPopup.
134 * If the BaseHandle points is a TextSelectionPopup the downcast returns a valid handle.
135 * If not the returned handle is left empty.
137 * @param[in] handle Handle to an object
138 * @return handle to a TextSelectionPopup or an empty handle
140 static TextSelectionPopup DownCast( BaseHandle handle );
143 * @brief Raises the toolbar's layer above the given @e target layer.
145 * @param[in] target The layer to get above of.
147 void RaiseAbove( Layer target );
150 * @brief Show the Popup
154 public: // Not intended for application developers
157 * @brief Creates a handle using the Toolkit::Internal implementation.
159 * @param[in] implementation The Control implementation.
161 DALI_INTERNAL TextSelectionPopup( Internal::TextSelectionPopup& implementation );
164 * @brief Allows the creation of this Control from an Internal::CustomActor pointer.
166 * @param[in] internal A pointer to the internal CustomActor.
168 explicit DALI_INTERNAL TextSelectionPopup( Dali::Internal::CustomActor* internal );
170 }; // Class TextSelectionPopup
172 } // namespace Toolkit
176 #endif // __DALI_TOOLKIT_TEXT_SELECTION_POPUP_H__