1 #ifndef DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_H
2 #define DALI_INTERNAL_AUTOFILL_MANAGER_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-manager.h>
36 class AutofillManager : public Dali::BaseObject
42 * @brief Gets the AutofillManager instance
44 * It creates the instance if it has not already been created.
45 * Internally, a check should be made using IsAvailable() before this is called as we do not want
46 * to create an instance if not needed by applications.
49 static Dali::AutofillManager Get();
52 * @brief Connects Callbacks required for Autofill daemon.
54 virtual void ConnectCallbacks() = 0;
57 * @copydoc Dali::AutofillManager::CreateAutofillItem()
59 virtual Dali::AutofillItem CreateAutofillItem( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive ) = 0;
62 * @copydoc Dali::AutofillManager::CreateAutofillGroup()
64 virtual Dali::AutofillGroup CreateAutofillGroup( const std::string& groupId ) = 0;
67 * @copydoc Dali::AutofillManager::IsAutofillDataPresent()
69 virtual bool IsAutofillDataPresent() const = 0;
72 * @copydoc Dali::AutofillManager::IsAuthenticationNeeded()
74 virtual bool IsAuthenticationNeeded() const = 0;
77 * @copydoc Dali::AutofillManager::GetAuthenticationServiceName()
79 virtual const std::string& GetAuthenticationServiceName() const = 0;
82 * @copydoc Dali::AutofillManager::GetAuthenticationServiceMessage()
84 virtual const std::string& GetAuthenticationServiceMessage() const = 0;
87 * @copydoc Dali::AutofillManager::GetAuthenticationServiceImagePath()
89 virtual const std::string& GetAuthenticationServiceImagePath() const = 0;
92 * @copydoc Dali::AutofillManager::GetFillItemId()
94 virtual const std::string& GetFillItemId() const = 0;
97 * @copydoc Dali::AutofillManager::GetFillItemPresentationText()
99 virtual const std::string& GetFillItemPresentationText() const = 0;
102 * @copydoc Dali::AutofillManager::GetFillItemValue()
104 virtual const std::string& GetFillItemValue() const = 0;
107 * @copydoc Dali::AutofillManager::SaveAutofillData()
109 virtual void SaveAutofillData( Dali::AutofillGroup group ) = 0;
114 * @copydoc Dali::AutofillManager::AuthenticationReceivedSignal()
116 virtual Dali::AutofillManager::AuthSignalType& AuthenticationReceivedSignal() { return mAuthReceivedSignal; }
119 * @copydoc Dali::AutofillManager::FillResponseReceivedSignal()
121 virtual Dali::AutofillManager::FillSignalType& FillResponseReceivedSignal() { return mFillReceivedSignal; }
124 * @copydoc Dali::AutofillManager::ListEventSignal()
126 virtual Dali::AutofillManager::ListSignalType& ListEventSignal() { return mListReceivedSignal; }
130 * Context created the first time and kept until deleted.
132 virtual void CreateContext() = 0;
135 * Delete Autofill context.
137 virtual void DeleteContext() = 0;
143 AutofillManager() = default;
149 ~AutofillManager() = default;
152 // Undefined copy constructor
153 AutofillManager( const AutofillManager& autofillManager ) = delete;
155 // Undefined assignment operator
156 AutofillManager& operator=( AutofillManager& autofillManager ) = delete;
159 Dali::AutofillManager::AuthSignalType mAuthReceivedSignal; ///< Authentication Received Signal
160 Dali::AutofillManager::FillSignalType mFillReceivedSignal; ///< Fill Response Received Signal
161 Dali::AutofillManager::ListSignalType mListReceivedSignal; ///< List Received Signal
166 inline static Internal::Adaptor::AutofillManager& GetImplementation(Dali::AutofillManager& autofillManager)
168 DALI_ASSERT_ALWAYS( autofillManager && "AutofillManager handle is empty" );
170 BaseObject& handle = autofillManager.GetBaseObject();
172 return static_cast<Internal::Adaptor::AutofillManager&>(handle);
175 inline static const Internal::Adaptor::AutofillManager& GetImplementation(const Dali::AutofillManager& autofillManager)
177 DALI_ASSERT_ALWAYS( autofillManager && "AutofillManager handle is empty" );
179 const BaseObject& handle = autofillManager.GetBaseObject();
181 return static_cast<const Internal::Adaptor::AutofillManager&>(handle);
184 } // namespace Adaptor
186 } // namespace Internal
190 #endif // DALI_INTERNAL_AUTOFILL_MANAGER_IMPL_H