1 #ifndef DALI_INTERNAL_AUTOFILL_ITEM_IMPL_H
2 #define DALI_INTERNAL_AUTOFILL_ITEM_IMPL_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>
25 #include <dali/devel-api/adaptor-framework/autofill-item.h>
37 * @brief This class is used to pass on data from the AutofillItem of control.
39 class AutofillItem : public Dali::BaseObject
47 * @param[in] id A unique ID for this AutofillItem
48 * @param[in] label An auxiliary means to guess what data is
49 * @param[in] hint The hint - id (username), name, password, phone, credit card number, organization, and so on
50 * @param[in] sensitiveData Whether this AutofillItem is a sensitive data or not. (The default is false)
51 * @return A public handle to the newly allocated AutofillItem
53 static Dali::AutofillItem New( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData );
56 * @brief Initialize AutofillItem constructor.
58 virtual void Initialize() = 0;
61 * @copydoc Dali::AutofillItem::GetId()
63 virtual const std::string& GetId() const = 0;
66 * @copydoc Dali::AutofillItem::GetLabel()
68 virtual const std::string& GetLabel() const = 0;
71 * @copydoc Dali::AutofillItem::GetHint()
73 virtual Dali::AutofillItem::Hint GetHint() const = 0;
76 * @copydoc Dali::AutofillItem::IsSensitiveData()
78 virtual bool IsSensitiveData() const = 0;
81 * @copydoc Dali::AutofillItem::SetSaveValue()
83 virtual void SetSaveValue( const std::string& value ) = 0;
86 * @copydoc Dali::AutofillItem::GetSaveValue()
88 virtual const std::string& GetSaveValue() const = 0;
91 * @brief Adds the presentation text to fill out in the list.
93 * @param[in] presentationText The presentation text to fill out
95 virtual void AddPresentationList( const std::string& presentationText ) = 0;
98 * @brief Adds the value to fill out in the list.
100 * @param[in] fillValue The value to fill out
102 virtual void AddFillValueList( const std::string& fillValue ) = 0;
105 * @copydoc Dali::AutofillItem::GetPresentationText()
107 virtual const std::string& GetPresentationText( int index ) const = 0;
110 * @copydoc Dali::AutofillItem::GetFillValue()
112 virtual const std::string& GetFillValue( int index ) const = 0;
115 * @copydoc Dali::AutofillItem::ClearPresentationTextList()
117 virtual void ClearPresentationTextList() = 0;
120 * @copydoc Dali::AutofillItem::ClearFillValueList()
122 virtual void ClearFillValueList() = 0;
125 * @copydoc Dali::AutofillItem::GetFillValueCount()
127 virtual unsigned int GetFillValueCount() = 0;
133 AutofillItem() = default;
139 ~AutofillItem() = default;
142 // Undefined copy constructor
143 AutofillItem( const AutofillItem& autofillItem ) = delete;
145 // Undefined assignment operator
146 AutofillItem& operator=( AutofillItem& autofillItem ) = delete;
150 inline static Internal::Adaptor::AutofillItem& GetImplementation(Dali::AutofillItem& autofillItem)
152 DALI_ASSERT_ALWAYS( autofillItem && "AutofillItem handle is empty" );
154 BaseObject& handle = autofillItem.GetBaseObject();
156 return static_cast<Internal::Adaptor::AutofillItem&>(handle);
159 inline static const Internal::Adaptor::AutofillItem& GetImplementation(const Dali::AutofillItem& autofillItem)
161 DALI_ASSERT_ALWAYS( autofillItem && "AutofillItem handle is empty" );
163 const BaseObject& handle = autofillItem.GetBaseObject();
165 return static_cast<const Internal::Adaptor::AutofillItem&>(handle);
168 } // namespace Adaptor
170 } // namespace Internal
174 #endif // DALI_INTERNAL_AUTOFILL_ITEM_IMPL_H