1 #ifndef DALI_INTERNAL_AUTOFILL_ITEM_IMPL_ECORE_WL_H
2 #define DALI_INTERNAL_AUTOFILL_ITEM_IMPL_ECORE_WL_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-object.h>
23 #ifdef CAPI_AUTOFILL_SUPPORT
25 #endif // CAPI_AUTOFILL_SUPPORT
29 #include <dali/internal/input/common/autofill-item-impl.h>
42 * @brief This class is used to pass on data from the AutofillItem of control.
44 class AutofillItemEcorewWl : public Dali::Internal::Adaptor::AutofillItem
52 * @param[in] id A unique ID for this AutofillItem
53 * @param[in] label An auxiliary means to guess what data is
54 * @param[in] hint The hint - id (username), name, password, phone, credit card number, organization, and so on
55 * @param[in] sensitiveData Whether this AutofillItem is a sensitive data or not. (The default is false)
56 * @return A public handle to the newly allocated AutofillItem
58 static Dali::AutofillItem New( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData );
61 * @brief Initialize AutofillItem constructor.
63 void Initialize() override;
66 * @copydoc Dali::AutofillItem::GetId()
68 const std::string& GetId() const override;
71 * @copydoc Dali::AutofillItem::GetLabel()
73 const std::string& GetLabel() const override;
76 * @copydoc Dali::AutofillItem::GetHint()
78 Dali::AutofillItem::Hint GetHint() const override;
81 * @copydoc Dali::AutofillItem::IsSensitiveData()
83 bool IsSensitiveData() const override;
86 * @copydoc Dali::AutofillItem::SetSaveValue()
88 void SetSaveValue( const std::string& value ) override;
91 * @copydoc Dali::AutofillItem::GetSaveValue()
93 const std::string& GetSaveValue() const override;
95 #ifdef CAPI_AUTOFILL_SUPPORT
97 * @brief Gets Autofill framework item handle
98 * @return Autofill framework item handle, which type is 'autofill_item_h'
100 autofill_item_h GetAutofillItemHandle();
103 * @brief Gets Autofill framework save item handle
104 * @return Autofill framework save item handle, which type is 'autofill_save_item_h'
106 autofill_save_item_h GetAutofillSaveItemHandle();
107 #endif // CAPI_AUTOFILL_SUPPORT
110 * @brief Adds the presentation text to fill out in the list.
112 * @param[in] presentationText The presentation text to fill out
114 void AddPresentationList( const std::string& presentationText ) override;
117 * @brief Adds the value to fill out in the list.
119 * @param[in] fillValue The value to fill out
121 void AddFillValueList( const std::string& fillValue ) override;
124 * @copydoc Dali::AutofillItem::GetPresentationText()
126 const std::string& GetPresentationText( int index ) const override;
129 * @copydoc Dali::AutofillItem::GetFillValue()
131 const std::string& GetFillValue( int index ) const override;
134 * @copydoc Dali::AutofillItem::ClearPresentationTextList()
136 void ClearPresentationTextList() override;
139 * @copydoc Dali::AutofillItem::ClearFillValueList()
141 void ClearFillValueList() override;
144 * @copydoc Dali::AutofillItem::GetFillValueCount()
146 unsigned int GetFillValueCount() override;
152 explicit AutofillItemEcorewWl( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData );
158 ~AutofillItemEcorewWl();
161 // Undefined copy constructor
162 explicit AutofillItemEcorewWl( const AutofillItemEcorewWl& autofillItem ) = delete;
164 // Undefined assignment operator
165 AutofillItemEcorewWl& operator=( AutofillItemEcorewWl& autofillItem ) = delete;
168 #ifdef CAPI_AUTOFILL_SUPPORT
169 autofill_item_h mAutofillItemHandle; ///< The Autofill Framework item handle
170 autofill_save_item_h mAutofillSaveItemHandle; ///< The Autofill Framework save item handle for save
171 #endif // CAPI_AUTOFILL_SUPPORT
175 std::string mId; ///< The AutofillItem ID
176 std::string mLabel; ///< The AutofillItem Label
177 Dali::AutofillItem::Hint mHint; ///< The AutofillItem Hint (id (username), name, password, phone, credit card number, organization, so on)
178 bool mSensitiveData; ///< Whether the data is sensitive or not
182 std::vector<std::string> mPresentationTextList; ///< The list for the presentation text to fill out
183 std::vector<std::string> mValueList; ///< The list for the value to fill out
189 } // namespace Adaptor
191 } // namespace Internal
195 #endif // DALI_INTERNAL_AUTOFILL_ITEM_IMPL_ECORE_WL_H