1 #ifndef DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_ECORE_WL_H
2 #define DALI_INTERNAL_AUTOFILL_MANAGER_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-manager-impl.h>
30 #include <dali/internal/input/tizen-wayland/autofill-group-impl-ecore-wl.h>
41 class AutofillManagerEcoreWl : public Dali::Internal::Adaptor::AutofillManager
46 using AuthSignalType = Dali::AutofillManager::AuthSignalType;
47 using FillSignalType = Dali::AutofillManager::FillSignalType;
48 using ListSignalType = Dali::AutofillManager::ListSignalType;
53 * @brief Gets the AutofillManager instance
55 * It creates the instance if it has not already been created.
56 * Internally, a check should be made using IsAvailable() before this is called as we do not want
57 * to create an instance if not needed by applications.
60 static Dali::AutofillManager Get();
63 * @brief Connects Callbacks required for Autofill daemon.
65 void ConnectCallbacks() override;
67 #ifdef CAPI_AUTOFILL_SUPPORT
70 * @brief Gets Autofill framework handle
71 * @return Autofill framework handle, which type is 'autofill_h"
73 autofill_h GetAutofillHandle();
76 * @brief Implement to receives Autofill Authentication Information callback.
78 * In this method, gets authentication information and emits the signal to check the authentication.
79 * @param authInfoHandle The autofill authentication information handle
80 * @param data The data from authentication information callback
82 void ReceiveAuthInfo( autofill_auth_info_h authInfoHandle, void *data );
85 * @brief Implement to fill out the data.
87 * This method would emit the signal to fill out the data.
88 * @param itemHandle The autofill fill response item handle
89 * @param userData The data from fill response callback
91 void FillGroupItem( autofill_fill_response_item_h itemHandle, void *userData );
94 * @brief Implement to set multiple group information.
96 * This method would emit the signals to make lists and fill out the data.
97 * @param itemHandle The autofill fill response item handle
98 * @param userData The data from fill response callback
100 void FillMultipleGroupItem( autofill_fill_response_item_h itemHandle, void *userData );
101 #endif // CAPI_AUTOFILL_SUPPORT
104 /////////////////////////////////////////////// Autofill Item and Group ///////////////////////////////////////////////
107 * @copydoc Dali::AutofillManager::CreateAutofillItem()
109 Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) override;
112 * @copydoc Dali::AutofillManager::CreateAutofillGroup()
114 Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ) override;
117 /////////////////////////////////////////////// Autofill Authentication Information ///////////////////////////////////////////////
120 * @copydoc Dali::AutofillManager::IsAutofillDataPresent()
122 bool IsAutofillDataPresent() const override;
125 * @copydoc Dali::AutofillManager::IsAuthenticationNeeded()
127 bool IsAuthenticationNeeded() const override;
130 * @copydoc Dali::AutofillManager::GetAuthenticationServiceName()
132 const std::string& GetAuthenticationServiceName() const override;
135 * @copydoc Dali::AutofillManager::GetAuthenticationServiceMessage()
137 const std::string& GetAuthenticationServiceMessage() const override;
140 * @copydoc Dali::AutofillManager::GetAuthenticationServiceImagePath()
142 const std::string& GetAuthenticationServiceImagePath() const override;
145 /////////////////////////////////////////////// Autofill Fill Response ///////////////////////////////////////////////
148 * @copydoc Dali::AutofillManager::GetFillItemId()
150 const std::string& GetFillItemId() const override;
153 * @copydoc Dali::AutofillManager::GetFillItemPresentationText()
155 const std::string& GetFillItemPresentationText() const override;
158 * @copydoc Dali::AutofillManager::GetFillItemValue()
160 const std::string& GetFillItemValue() const override;
163 * @copydoc Dali::AutofillManager::SaveAutofillData()
165 void SaveAutofillData( Dali::AutofillGroup group ) override;
170 * @copydoc Dali::AutofillManager::AuthenticationReceivedSignal()
172 AuthSignalType& AuthenticationReceivedSignal() override;
175 * @copydoc Dali::AutofillManager::FillResponseReceivedSignal()
177 FillSignalType& FillResponseReceivedSignal() override;
180 * @copydoc Dali::AutofillManager::ListEventSignal()
182 ListSignalType& ListEventSignal() override;
185 * Connects a callback function with the object's signals.
186 * @param[in] object The object providing the signal.
187 * @param[in] tracker Used to disconnect the signal.
188 * @param[in] signalName The signal to connect to.
189 * @param[in] functor A newly allocated FunctorDelegate.
190 * @return True if the signal was connected.
191 * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
193 static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
197 * Context created the first time and kept until deleted.
199 void CreateContext() override;
202 * Delete Autofill context.
204 void DeleteContext() override;
210 explicit AutofillManagerEcoreWl();
216 ~AutofillManagerEcoreWl();
219 // Undefined copy constructor
220 explicit AutofillManagerEcoreWl( const AutofillManagerEcoreWl& autofillManager ) = delete;
222 // Undefined assignment operator
223 AutofillManagerEcoreWl& operator=( AutofillManagerEcoreWl& autofillManager ) = delete;
226 #ifdef CAPI_AUTOFILL_SUPPORT
227 autofill_h mAutofillHandle; ///< The Autofill framework handle
228 #endif // CAPI_AUTOFILL_SUPPORT
229 Dali::AutofillGroup mAutofillGroup;
231 std::vector<Dali::AutofillGroup> mAutofillGroupList; ///< The list to manage AutofillGroup
232 std::vector<Dali::AutofillItem> mAutofillItemList; ///< The list to manage AutofillItem
235 AuthSignalType mAuthReceivedSignal; ///< Authentication Received Signal
236 FillSignalType mFillReceivedSignal; ///< Fill Response Received Signal
237 ListSignalType mListReceivedSignal; ///< List Received Signal
240 std::string mAuthenticationServiceName; ///< The autofill authentication service name
241 std::string mAuthenticationServiceMessage; ///< The autofill authentication service message
242 std::string mAuthenticationServiceImagePath; ///< The autofill authentication service logo image path
243 std::string mFillItemId; ///< The autofill fill response item ID
244 std::string mFillItemPresentationText; ///< The autofill fill response item presentation text
245 std::string mFillItemValue; ///< The autofill fill response item value (input data)
247 bool mIsDataPresent; ///< The autofill data presence
248 bool mIsAuthNeeded; ///< The authentication need
252 } // namespace Adaptor
254 } // namespace Internal
258 #endif // DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_ECORE_WL_H