1 #ifndef DALI_AUTOFILL_ITEM_H
2 #define DALI_AUTOFILL_ITEM_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/public-api/object/base-handle.h>
25 #include <dali/public-api/dali-adaptor-common.h>
30 namespace Internal DALI_INTERNAL
40 * @brief The AutofillItem class
42 * is used to pass on data from the AutofillItem.
43 * AutofillItem includes Id, Label, Autofill Hint, and whether it is sensitive or not.
45 class DALI_ADAPTOR_API AutofillItem : public BaseHandle
50 * @brief Enumeration for hint of the autofill item.
54 CREDIT_CARD_EXPIRATION_DATE, ///< Autofill hint for a credit card expiration date
55 CREDIT_CARD_EXPIRATION_DAY, ///< Autofill hint for a credit card expiration day
56 CREDIT_CARD_EXPIRATION_MONTH, ///< Autofill hint for a credit card expiration month
57 CREDIT_CARD_EXPIRATION_YEAR, ///< Autofill hint for a credit card expiration year
58 CREDIT_CARD_NUMBER, ///< Autofill hint for a credit card number
59 EMAIL_ADDRESS, ///< Autofill hint for an email address
60 NAME, ///< Autofill hint for a user's real name
61 PHONE, ///< Autofill hint for a phone number
62 POSTAL_ADDRESS, ///< Autofill hint for a postal address
63 POSTAL_CODE, ///< Autofill hint for a postal code
64 ID, ///< Autofill hint for a user's ID
65 PASSWORD, ///< Autofill hint for password
66 CREDIT_CARD_SECURITY_CODE ///< Autofill hint for a credit card security code
72 * @brief Creates an uninitialized AutofillItem.
74 * To create AutofillItem instance, please refer to Dali::AutofillManager::CreateAutofillItem().
79 * @brief AutofillItem Destructor.
84 * @brief Copy constructor.
86 * @param[in] item AutofillItem to copy. The copied player will point at the same implementation
88 AutofillItem( const AutofillItem& item );
91 * @brief Assignment operator.
93 * @param[in] item The AutofillItem to assign from.
94 * @return The updated AutofillItem.
96 AutofillItem& operator=( const AutofillItem& item );
99 * @brief Downcast a handle to AutofillItem handle.
101 * If handle points to a AutofillItem the downcast produces valid
102 * handle. If not the returned handle is left uninitialized.
104 * @param[in] handle Handle to an object
105 * @return Handle to a AutofillItem or an uninitialized handle
107 static AutofillItem DownCast( BaseHandle handle );
110 * @brief Equality operator.
112 * @param[in] rhs The AutofillItem structure to test against
113 * @return True if AutofillItems are equal
115 bool operator==( const AutofillItem& rhs ) const
125 * @brief Gets AutofillItem Id.
127 * @return AutofillItem Id
129 const std::string& GetId() const;
132 * @brief Gets AutofillItem Label.
134 * @return AutofillItem Label
136 const std::string& GetLabel() const;
139 * @brief Gets AutofillItem Hint.
141 * @return AutofillItem Hint
143 Dali::AutofillItem::Hint GetHint() const;
146 * @brief Gets whether AutofillItem is sensitive data or not.
148 * @return True if the AutofillItem is sensitive.
150 bool IsSensitiveData() const;
153 * @brief Sets AutofillItem value for saving.
155 * @param[in] value The value for saving
157 void SetSaveValue( const std::string& value );
160 * @brief Gets the saved value of AutofillItem.
162 * @return The saved value
164 const std::string& GetSaveValue() const;
167 * @brief Gets the presentation text with a index of the list.
169 * @param index The index for the presentation text list
170 * @return The presentation text to show up for the fill value
172 const std::string& GetPresentationText( int index ) const;
175 * @brief Gets the value to be filled with a index of the list.
177 * @param index The index for the value list
178 * @return The value to be filled
180 const std::string& GetFillValue( int index ) const;
183 * @brief Clears the presentation text list.
185 void ClearPresentationTextList();
188 * @brief Clears the value list.
190 void ClearFillValueList();
193 * @brief Gets the number of fill value in the list.
195 * @return The number of fill value in the list
197 unsigned int GetFillValueCount();
199 public: // Not intended for application developers
202 * @brief Internal constructor
204 explicit DALI_INTERNAL AutofillItem( Internal::Adaptor::AutofillItem* internal );
210 #endif // DALI_AUTOFILL_ITEM_H