[Tizen] Add DALi Autofill implementation
[platform/core/uifw/dali-adaptor.git] / dali / devel-api / adaptor-framework / autofill-group.h
1 #ifndef DALI_AUTOFILL_GROUP_H
2 #define DALI_AUTOFILL_GROUP_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-handle.h>
23
24 // INTERNAL INCLUDES
25 #include <dali/public-api/dali-adaptor-common.h>
26 #include <dali/devel-api/adaptor-framework/autofill-item.h>
27
28 namespace Dali
29 {
30
31 namespace Internal DALI_INTERNAL
32 {
33 namespace Adaptor
34 {
35 class AutofillGroup;
36 }
37 }
38
39
40 /**
41  * @brief The AutofillGroup class
42  *
43  * is used to group AutofillItems together.
44  */
45 class DALI_ADAPTOR_API AutofillGroup : public BaseHandle
46 {
47 public:
48
49    /**
50     * @brief Creates an uninitialized AutofillGroup.
51     *
52     * To create AutofillGroup instance, please refer to Dali::AutofillManager::CreateAutofillGroup().
53     */
54    AutofillGroup();
55
56   /**
57    * @brief AutofillGroup Destructor.
58    */
59   ~AutofillGroup();
60
61   /**
62     * @brief Copy constructor.
63     *
64     * @param[in] group AutofillGroup to copy. The copied player will point at the same implementation
65     */
66    AutofillGroup( const AutofillGroup& group );
67
68   /**
69     * @brief Assignment operator.
70     *
71     * @param[in] group The AutofillGroup to assign from.
72     * @return The updated AutofillGroup.
73     */
74    AutofillGroup& operator=( const AutofillGroup& group );
75
76   /**
77    * @brief Downcast a handle to AutofillGroup handle.
78    *
79    * If handle points to a AutofillGroup the downcast produces valid
80    * handle. If not the returned handle is left uninitialized.
81    *
82    * @param[in] handle Handle to an object
83    * @return Handle to a AutofillGroup or an uninitialized handle
84    */
85   static AutofillGroup DownCast( BaseHandle handle );
86
87   /**
88    * @brief Equality operator.
89    *
90    * @param[in] rhs The AutofillGroup structure to test against
91    * @return True if AutofillGroups are equal
92    */
93   bool operator==( const AutofillGroup& rhs ) const
94   {
95     if( &rhs == this )
96     {
97       return true;
98     }
99     return false;
100   }
101
102   /**
103    * @brief Gets AutofillGroup unique Id.
104    *
105    * @return AutofillGroup ID
106    */
107   const std::string& GetId() const;
108
109   /**
110    * @brief Adds AutofillItem to AutofillGroup itself in order to group.
111    *
112    * @param[in] item AutofillItem instance to be included in AutofillGroup
113    */
114   void AddAutofillItem( Dali::AutofillItem item );
115
116   /**
117    * @brief Gets AutofillItem instance according to the id.
118    *
119    * @param[in] id AutofillItem Id to get from AutofillGroup List
120    * @return AutofillItem instance to match for Id
121    */
122   Dali::AutofillItem GetAutofillItem( const std::string& id );
123
124   /**
125    * @brief Stores Autofill data in autofill group.
126    */
127   void SaveAutofillData();
128
129   /**
130    * @brief Requests and receives autofill authentication information.
131    */
132   void RequestAuthentication();
133
134   /**
135    * @brief Sends fill request to fill out the data.
136    */
137   void SendFillRequest();
138
139 public: // Not intended for application developers
140
141   /**
142    * @brief Internal constructor
143    */
144   explicit DALI_INTERNAL AutofillGroup( Internal::Adaptor::AutofillGroup* internal );
145
146 };
147
148
149 } // namespace Dali
150
151 #endif // DALI_AUTOFILL_GROUP_H