1 #ifndef DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_X_H
2 #define DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_X_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>
26 #include <dali/internal/input/common/autofill-manager-impl.h>
27 #include <dali/internal/input/ubuntu-x11/autofill-group-impl-x.h>
38 class AutofillManagerX : public Dali::Internal::Adaptor::AutofillManager
43 using AuthSignalType = Dali::AutofillManager::AuthSignalType;
44 using FillSignalType = Dali::AutofillManager::FillSignalType;
45 using ListSignalType = Dali::AutofillManager::ListSignalType;
50 * @brief Gets the AutofillManager instance
52 * It creates the instance if it has not already been created.
53 * Internally, a check should be made using IsAvailable() before this is called as we do not want
54 * to create an instance if not needed by applications.
57 static Dali::AutofillManager Get();
60 * @brief Connects Callbacks required for Autofill daemon.
62 void ConnectCallbacks() override;
65 /////////////////////////////////////////////// Autofill Item and Group ///////////////////////////////////////////////
68 * @copydoc Dali::AutofillManager::CreateAutofillItem()
70 Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) override;
73 * @copydoc Dali::AutofillManager::CreateAutofillGroup()
75 Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ) override;
78 /////////////////////////////////////////////// Autofill Authentication Information ///////////////////////////////////////////////
81 * @copydoc Dali::AutofillManager::IsAutofillDataPresent()
83 bool IsAutofillDataPresent() const override;
86 * @copydoc Dali::AutofillManager::IsAuthenticationNeeded()
88 bool IsAuthenticationNeeded() const override;
91 * @copydoc Dali::AutofillManager::GetAuthenticationServiceName()
93 const std::string& GetAuthenticationServiceName() const override;
96 * @copydoc Dali::AutofillManager::GetAuthenticationServiceMessage()
98 const std::string& GetAuthenticationServiceMessage() const override;
101 * @copydoc Dali::AutofillManager::GetAuthenticationServiceImagePath()
103 const std::string& GetAuthenticationServiceImagePath() const override;
106 /////////////////////////////////////////////// Autofill Fill Response ///////////////////////////////////////////////
109 * @copydoc Dali::AutofillManager::GetFillItemId()
111 const std::string& GetFillItemId() const override;
114 * @copydoc Dali::AutofillManager::GetFillItemPresentationText()
116 const std::string& GetFillItemPresentationText() const override;
119 * @copydoc Dali::AutofillManager::GetFillItemValue()
121 const std::string& GetFillItemValue() const override;
124 * @copydoc Dali::AutofillManager::SaveAutofillData()
126 void SaveAutofillData( Dali::AutofillGroup group ) override;
131 * @copydoc Dali::AutofillManager::AuthenticationReceivedSignal()
133 AuthSignalType& AuthenticationReceivedSignal() override;
136 * @copydoc Dali::AutofillManager::FillResponseReceivedSignal()
138 FillSignalType& FillResponseReceivedSignal() override;
141 * @copydoc Dali::AutofillManager::ListEventSignal()
143 ListSignalType& ListEventSignal() override;
146 * Connects a callback function with the object's signals.
147 * @param[in] object The object providing the signal.
148 * @param[in] tracker Used to disconnect the signal.
149 * @param[in] signalName The signal to connect to.
150 * @param[in] functor A newly allocated FunctorDelegate.
151 * @return True if the signal was connected.
152 * @post If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.
154 static bool DoConnectSignal( BaseObject* object, ConnectionTrackerInterface* tracker, const std::string& signalName, FunctorDelegate* functor );
158 * Context created the first time and kept until deleted.
160 void CreateContext() override;
163 * Delete Autofill context.
165 void DeleteContext() override;
171 explicit AutofillManagerX();
180 // Undefined copy constructor
181 explicit AutofillManagerX( const AutofillManagerX& autofillManager ) = delete;
183 // Undefined assignment operator
184 AutofillManagerX& operator=( AutofillManagerX& autofillManager ) = delete;
187 Dali::AutofillGroup mAutofillGroup;
189 std::vector<Dali::AutofillGroup> mAutofillGroupList; ///< The list to manage AutofillGroup
190 std::vector<Dali::AutofillItem> mAutofillItemList; ///< The list to manage AutofillItem
193 AuthSignalType mAuthReceivedSignal; ///< Authentication Received Signal
194 FillSignalType mFillReceivedSignal; ///< Fill Response Received Signal
195 ListSignalType mListReceivedSignal; ///< List Received Signal
198 std::string mAuthenticationServiceName; ///< The autofill authentication service name
199 std::string mAuthenticationServiceMessage; ///< The autofill authentication service message
200 std::string mAuthenticationServiceImagePath; ///< The autofill authentication service logo image path
201 std::string mFillItemId; ///< The autofill fill response item ID
202 std::string mFillItemPresentationText; ///< The autofill fill response item presentation text
203 std::string mFillItemValue; ///< The autofill fill response item value (input data)
205 bool mIsDataPresent; ///< The autofill data presence
206 bool mIsAuthNeeded; ///< The authentication need
211 } // namespace Adaptor
213 } // namespace Internal
217 #endif // DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_X_H