[Tizen] Add DALi Autofill implementation
[platform/core/uifw/dali-adaptor.git] / dali / internal / input / common / autofill-group-impl.h
1 #ifndef DALI_INTERNAL_AUTOFILL_GROUP_IMPL_H
2 #define DALI_INTERNAL_AUTOFILL_GROUP_IMPL_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
24 // INTERNAL INCLUDES
25 #include <dali/devel-api/adaptor-framework/autofill-group.h>
26
27 namespace Dali
28 {
29
30 namespace Internal
31 {
32
33 namespace Adaptor
34 {
35
36 /**
37  * @brief This class is used to group AutofillItems.
38  */
39 class AutofillGroup : public Dali::BaseObject
40 {
41
42 public:
43
44   /**
45    * @brief Constructor.
46    *
47    * @param[in] groupId A unique ID value of each AutofillGroup
48    * @return A public handle to the newly allocated AutofillGroup.
49    */
50   static Dali::AutofillGroup New( const std::string& groupId );
51
52   /**
53    * @brief Initialize AutofillGroup constructor.
54    */
55   virtual void Initialize() = 0;
56
57   /**
58    * @copydoc Dali::AutofillGroup::GetId()
59    */
60   virtual const std::string& GetId() const = 0;
61
62   /**
63    * @copydoc Dali::AutofillGroup::AddAutofillItem()
64    */
65   virtual void AddAutofillItem( Dali::AutofillItem item ) = 0;
66
67   /**
68    * @copydoc Dali::AutofillGroup::GetAutofillItem()
69    */
70   virtual Dali::AutofillItem GetAutofillItem( const std::string& id ) = 0;
71
72   /**
73    * @brief Clears all lists of AutofillItem added in AutofillGroup.
74    */
75   virtual void ClearAutofillItemList() = 0;
76
77   /**
78    * @copydoc Dali::AutofillGroup::SaveAutofillData()
79    */
80   virtual void SaveAutofillData() = 0;
81
82   /**
83    * @copydoc Dali::AutofillGroup::RequestAuthentication()
84    */
85   virtual void RequestAuthentication() = 0;
86
87   /**
88    * @copydoc Dali::AutofillGroup::SendFillRequest()
89    */
90   virtual void SendFillRequest() = 0;
91
92 public:
93   /**
94    * Constructor.
95    */
96   AutofillGroup() = default;
97
98 protected:
99   /**
100    * Destructor.
101    */
102   ~AutofillGroup() = default;
103
104 private:
105   // Undefined copy constructor
106   AutofillGroup( const AutofillGroup& autofillGroup ) = delete;
107
108   // Undefined assignment operator
109   AutofillGroup& operator=( AutofillGroup& autofillGroup ) = delete;
110
111 };
112
113 inline static Internal::Adaptor::AutofillGroup& GetImplementation(Dali::AutofillGroup& autofillGroup)
114 {
115   DALI_ASSERT_ALWAYS( autofillGroup && "AutofillGroup handle is empty" );
116
117   BaseObject& handle = autofillGroup.GetBaseObject();
118
119   return static_cast<Internal::Adaptor::AutofillGroup&>(handle);
120 }
121
122 inline static const Internal::Adaptor::AutofillGroup& GetImplementation(const Dali::AutofillGroup& autofillGroup)
123 {
124   DALI_ASSERT_ALWAYS( autofillGroup && "AutofillGroup handle is empty" );
125
126   const BaseObject& handle = autofillGroup.GetBaseObject();
127
128   return static_cast<const Internal::Adaptor::AutofillGroup&>(handle);
129 }
130
131 } // namespace Adaptor
132
133 } // namespace Internal
134
135 } // namespace Dali
136
137 #endif // DALI_INTERNAL_AUTOFILL_GROUP_IMPL_H