1 #ifndef DALI_AUTOFILL_MANAGER_H
2 #define DALI_AUTOFILL_MANAGER_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>
23 #include <dali/public-api/signals/dali-signal.h>
26 #include <dali/public-api/dali-adaptor-common.h>
27 #include <dali/devel-api/adaptor-framework/autofill-group.h>
32 namespace Internal DALI_INTERNAL
36 class AutofillManager;
42 * @brief The AutofillManager class
44 * allows the application to fill out the user data, such as email, account and address previously saved.
45 * Currently, Autofill is limited to text input box. Later it can be ScrollView, etc.
48 * | %Signal Name | Method |
49 * |------------------------|-------------------------------------|
50 * | authenticationReceived | @ref AuthenticationReceivedSignal() |
51 * | fillResponseReceived | @ref FillResponseReceivedSignal() |
53 class DALI_ADAPTOR_API AutofillManager : public BaseHandle
58 // TODO : Need to update parameter and return value according to each Signal
59 typedef Signal< void () > AuthSignalType; ///< Authentication Received Signal
60 typedef Signal< void ( AutofillItem ) > FillSignalType; ///< Fill Response Received Signal
61 typedef Signal< void () > ListSignalType; ///< List Event Signal for multi-group
66 * @brief Retrieves a handle to the instance of AutofillManager.
68 * @return A handle to the AutofillManager.
70 static AutofillManager Get();
73 /////////////////////////////////////////////// Autofill Item and Group ///////////////////////////////////////////////
76 * @brief Creates AutofillItem instance.
78 * @param[in] id A unique ID that does not always change on each launching
79 * @param[in] label An auxiliary means to guess heuristically what data is
80 * @param[in] hint The Hint - id (username), name, password, phone, credit card number, organization, and so on
81 * @param[in] isSensitive Whether this AutofillItem is a sensitive data or not
82 * @return A public handle to the newly allocated AutofillItem
84 Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive );
87 * @brief Creates AutofillGroup instance.
89 * @param[in] groupId A unique ID value of each AutofillGroup
90 * @return A public handle to the newly allocated AutofillGroup
92 Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId );
95 /////////////////////////////////////////////// Autofill Authentication Information ///////////////////////////////////////////////
98 * @brief Gets the 'autofill data present' attribute in autofill authentication information.
100 * @return True if Autofill data is present
102 bool IsAutofillDataPresent() const;
105 * @brief Gets the 'authentication needed' attribute in autofill authentication information.
107 * @return True if the authentication is needed in the current Autofill process.
109 bool IsAuthenticationNeeded() const;
112 * @brief Gets the service name in autofill authentication information.
114 * @return The autofill authentication service name
116 const std::string& GetAuthenticationServiceName() const;
119 * @brief Gets the service message in autofill authentication information.
121 * @return The autofill authentication service message
123 const std::string& GetAuthenticationServiceMessage() const;
126 * @brief Gets the service logo image path in autofill authentication information.
128 * @return The autofill authentication service logo image path
130 const std::string& GetAuthenticationServiceImagePath() const;
133 /////////////////////////////////////////////// Autofill Fill Response ///////////////////////////////////////////////
136 * @brief Gets the autofill ID in an autofill fill response item.
138 * @return The autofill fill response item ID
140 const std::string& GetFillItemId() const;
143 * @brief Gets the presentation text in an autofill fill response item.
145 * @return The presentation text
147 const std::string& GetFillItemPresentationText() const;
150 * @brief Gets the autofill value in an autofill fill response item.
152 * @return The autofill fill response item value
154 const std::string& GetFillItemValue() const;
157 * @brief Stores the current Autofill data.
159 * @param[in] group The AutofillGroup to store the data
161 void SaveAutofillData( Dali::AutofillGroup group );
166 * @brief This is emitted when the authentication is needed and AutofillManager gets the information.
168 * @return The signal containing the received data
170 AuthSignalType& AuthenticationReceivedSignal();
173 * @brief This is emitted when AutofillManager receives the fill response.
175 * @return The signal containing the received data
177 FillSignalType& FillResponseReceivedSignal();
180 * @brief This is emitted when the list for multi fill response group is needed.
182 * @return The signal containing the received data
184 ListSignalType& ListEventSignal();
186 // Construction & Destruction
188 * @brief Constructor.
190 * Create an uninitialized handle.
191 * This can be initialized by calling AutofillManager::Get().
198 * This is non-virtual since derived Handle types must not contain data or virtual methods.
203 * @brief This constructor is used by AutofillManager::Get().
205 * @param[in] autofillManager A pointer to the AutofillManager.
207 explicit DALI_INTERNAL AutofillManager( Internal::Adaptor::AutofillManager* autofillManager );
213 #endif // DALI_AUTOFILL_MANAGER_H