[Tizen] Add DALi Autofill implementation
[platform/core/uifw/dali-adaptor.git] / dali / internal / input / tizen-wayland / autofill-group-impl-ecore-wl.h
1 #ifndef DALI_INTERNAL_AUTOFILL_GROUP_IMPL_ECORE_WL_H
2 #define DALI_INTERNAL_AUTOFILL_GROUP_IMPL_ECORE_WL_H
3
4 /*
5  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <dali/public-api/object/base-object.h>
23 #ifdef CAPI_AUTOFILL_SUPPORT
24 #include <autofill.h>
25 #endif // CAPI_AUTOFILL_SUPPORT
26 #include <vector>
27
28 // INTERNAL INCLUDES
29 #include <dali/internal/input/common/autofill-group-impl.h>
30 #include <dali/internal/input/tizen-wayland/autofill-item-impl-ecore-wl.h>
31
32 namespace Dali
33 {
34
35 namespace Internal
36 {
37
38 namespace Adaptor
39 {
40
41
42 /**
43  * @brief This class is used to group AutofillItems.
44  */
45 class AutofillGroupEcoreWl : public Dali::Internal::Adaptor::AutofillGroup
46 {
47
48 public:
49
50   /**
51    * @brief Constructor.
52    *
53    * @param[in] groupId A unique ID value of each AutofillGroup
54    * @return A public handle to the newly allocated AutofillGroup.
55    */
56   static Dali::AutofillGroup New( const std::string& groupId );
57
58   /**
59    * @brief Initialize AutofillGroup constructor.
60    */
61   void Initialize() override;
62
63   /**
64    * @copydoc Dali::AutofillGroup::GetId()
65    */
66   const std::string& GetId() const override;
67
68 #ifdef CAPI_AUTOFILL_SUPPORT
69   /**
70    * @brief Gets Autofill framework group handle
71    * @return Autofill framework group handle, which type is 'autofill_view_info_h'
72    */
73   autofill_view_info_h GetAutofillGroupHandle();
74
75   /**
76    * @brief Gets Autofill framework save group handle
77    * @return Autofill framework save group handle, which type is 'autofill_save_view_info_h'
78    */
79   autofill_save_view_info_h GetAutofillSaveGroupHandle();
80 #endif // CAPI_AUTOFILL_SUPPORT
81
82   /**
83    * @copydoc Dali::AutofillGroup::AddAutofillItem()
84    */
85   void AddAutofillItem( Dali::AutofillItem item ) override;
86
87   /**
88    * @copydoc Dali::AutofillGroup::GetAutofillItem()
89    */
90   Dali::AutofillItem GetAutofillItem( const std::string& id ) override;
91
92   /**
93    * @brief Clears all lists of AutofillItem added in AutofillGroup.
94    */
95   void ClearAutofillItemList() override;
96
97   /**
98    * @copydoc Dali::AutofillGroup::SaveAutofillData()
99    */
100   void SaveAutofillData() override;
101
102   /**
103    * @copydoc Dali::AutofillGroup::RequestAuthentication()
104    */
105   void RequestAuthentication() override;
106
107   /**
108    * @copydoc Dali::AutofillGroup::SendFillRequest()
109    */
110   void SendFillRequest() override;
111
112 private:
113   /**
114    * Constructor.
115    */
116   explicit AutofillGroupEcoreWl( const std::string groupId );
117
118 protected:
119   /**
120    * Destructor.
121    */
122   ~AutofillGroupEcoreWl();
123
124 private:
125   // Undefined copy constructor
126   explicit AutofillGroupEcoreWl( const AutofillGroupEcoreWl& autofillGroup ) = delete;
127
128   // Undefined assignment operator
129   AutofillGroupEcoreWl& operator=( AutofillGroupEcoreWl& autofillGroup ) = delete;
130
131
132 private:
133 #ifdef CAPI_AUTOFILL_SUPPORT
134   autofill_view_info_h mAutofillGroupHandle;  ///< The Autofill Framework group handle
135   autofill_save_view_info_h mAutofillSaveGroupHandle;
136 #endif // CAPI_AUTOFILL_SUPPORT
137
138   std::vector<Dali::AutofillItem> mAutofillItemList; ///< The List to add AutofillItem
139   std::string mGroupId;  ///< The AutofillGroup ID
140
141 };
142
143
144 } // namespace Adaptor
145
146 } // namespace Internal
147
148 } // namespace Dali
149
150 #endif // DALI_INTERNAL_AUTOFILL_GROUP_IMPL_ECORE_WL_H