1 #ifndef DALI_TOOLKIT_AUTO_FILL_CONTAINER_H
2 #define DALI_TOOLKIT_AUTO_FILL_CONTAINER_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/devel-api/adaptor-framework/autofill-item.h>
25 #include <dali-toolkit/public-api/controls/control.h>
33 namespace Internal DALI_INTERNAL
35 class AutofillContainer;
39 * @brief AutofillContainer controls several text input boxes (Dali::Toolkit::TextField and Dali::Toolkit::TextEditor).
41 * It can make these editors a group of text boxes.
43 class DALI_TOOLKIT_API AutofillContainer : public BaseHandle
47 // TODO : Need to update parameter and return value according to each Signal
48 typedef Signal< void (AutofillContainer&) > AuthenticationSignalType; ///< Authentication Signal Type
49 typedef Signal< void (Control&) > ListShownSignalType; ///< List Shown Signal Type
54 * @brief Creates the AutofillContainer.
56 * @param[in] name The AutofillContainer name
57 * @return A handle to the AutofillContainer
59 static AutofillContainer New( const std::string& name );
62 * @brief Creates an empty handle.
67 * @brief Copy constructor.
69 * @param[in] handle The handle to copy from
71 AutofillContainer( const AutofillContainer& handle );
74 * @brief Assignment operator.
76 * @param[in] handle The handle to copy from
77 * @return A reference to this
79 AutofillContainer& operator=( const AutofillContainer& handle );
84 * This is non-virtual since derived Handle types must not contain data or virtual methods.
89 * @brief Downcasts a handle to AutofillContainer.
91 * If the BaseHandle points is a AutofillContainer, the downcast returns a valid handle.
92 * If not, the returned handle is left empty.
94 * @param[in] handle Handle to an object
95 * @return Handle to a AutofillContainer or an empty handle
97 static AutofillContainer DownCast( BaseHandle handle );
100 * @brief Adds Control and AutofillItem information to Autofill Container.
102 * @param[in] control The control to be added to Autofill Container
103 * @param[in] propertyIndex The Property to be filled automatically of each Control
104 * @param[in] id A unique ID that does not always change on each launching
105 * @param[in] label An auxiliary means to guess heuristically what data is
106 * @param[in] hint The Hint - id (username), name, password, phone, credit card number, organization, and so on
107 * @param[in] isSensitive Whether this information is a sensitive data or not
109 void AddAutofillItem( Control control, Property::Index propertyIndex, const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive );
112 * @brief Removes Control and its AutofillItem information to Autofill Container.
114 * @param[in] control The control to be removed
116 void RemoveAutofillItem( Control control );
119 * @brief Sets that a control is focused.
121 * @param focused The focused control
123 void SetFocusedControl( Toolkit::Control focused );
126 * @brief Gets the focused control.
128 * @return The focused control
130 Toolkit::Control GetFocusedControl();
133 * @brief Stores autofill data.
135 void SaveAutofillData();
138 * @brief Sends a request for filling the data.
140 void RequestFillData();
143 * @brief Gets the Autofill Service Name.
145 * @return Autofill Service Name
147 const std::string& GetAutofillServiceName() const;
150 * @brief Gets the Autofill Service Message.
152 * @return Autofill Service Message
154 const std::string& GetAutofillServiceMessage() const;
157 * @brief Gets the Autofill Service Image Path.
159 * @return Autofill Service Image Path
161 const std::string& GetAutofillServiceImagePath() const;
164 * @brief Gets the number of list items. (The presentation text of Autofill)
166 * @return The number of list items
168 unsigned int GetListCount();
171 * @brief Gets the list item of the index.
173 * @param[in] index The index for the list
174 * @return The list item of the index
176 const std::string& GetListItem( unsigned int index ) const;
179 * @brief Sets the selected item to fill out.
181 * @param[in] selected The selected item
183 void SetSelectedItem( const std::string& selected );
189 * @brief AutofillServiceShownSignal
191 * @return The signal containing the received data
193 AuthenticationSignalType& AutofillServiceShownSignal();
196 * @brief AutofillListShownSignal
198 * @return The signal containing the received data
200 ListShownSignalType& AutofillListShownSignal();
203 public: // Not intended for application developers
206 * @brief Creates a handle using the Toolkit::Internal implementation.
208 * @param[in] implementation The Control implementation
210 DALI_INTERNAL AutofillContainer( Internal::AutofillContainer* implementation );
215 } // namespace Toolkit
219 #endif // DALI_TOOLKIT_AUTO_FILL_CONTAINER_H