[Tizen] Add AutofillContainer class and autofill implementation
[platform/core/uifw/dali-toolkit.git] / dali-toolkit / devel-api / controls / text-controls / autofill-container.cpp
1 /*
2  * Copyright (c) 2019 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali-toolkit/devel-api/controls/text-controls/autofill-container.h>
20
21 // INTERNAL INCLUDES
22 #include <dali-toolkit/internal/controls/text-controls/autofill-container-impl.h>
23
24 namespace Dali
25 {
26
27 namespace Toolkit
28 {
29
30 AutofillContainer AutofillContainer::New( const std::string& name )
31 {
32   return Internal::AutofillContainer::New( name );
33 }
34
35 AutofillContainer::AutofillContainer()
36 {
37 }
38
39 AutofillContainer::AutofillContainer( const AutofillContainer& handle )
40 : BaseHandle(handle)
41 {
42 }
43
44 AutofillContainer& AutofillContainer::operator=( const AutofillContainer& handle )
45 {
46   BaseHandle::operator=(handle);
47   return *this;
48 }
49
50 AutofillContainer::~AutofillContainer()
51 {
52 }
53
54 AutofillContainer AutofillContainer::DownCast( BaseHandle handle )
55 {
56   return AutofillContainer( dynamic_cast<Internal::AutofillContainer*>( handle.GetObjectPtr() ) );
57 }
58
59
60 void AutofillContainer::AddAutofillItem( Control control, Property::Index propertyIndex, const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool isSensitive )
61 {
62   GetImpl(*this).AddAutofillItem( control, propertyIndex, id, label, hint, isSensitive );
63 }
64
65 void AutofillContainer::RemoveAutofillItem( Control control )
66 {
67   GetImpl(*this).RemoveAutofillItem( control );
68 }
69
70 void AutofillContainer::SetFocusedControl( Toolkit::Control focused )
71 {
72   GetImpl(*this).SetFocusedControl( focused );
73 }
74
75 Toolkit::Control AutofillContainer::GetFocusedControl()
76 {
77   return GetImpl(*this).GetFocusedControl();
78 }
79
80 void AutofillContainer::SaveAutofillData()
81 {
82   GetImpl(*this).SaveAutofillData();
83 }
84
85 void AutofillContainer::RequestFillData()
86 {
87   GetImpl(*this).RequestFillData();
88 }
89
90 const std::string& AutofillContainer::GetAutofillServiceName() const
91 {
92   return GetImpl(*this).GetAutofillServiceName();
93 }
94
95 const std::string& AutofillContainer::GetAutofillServiceMessage() const
96 {
97   return GetImpl(*this).GetAutofillServiceMessage();
98 }
99
100 const std::string& AutofillContainer::GetAutofillServiceImagePath() const
101 {
102   return GetImpl(*this).GetAutofillServiceImagePath();
103 }
104
105 unsigned int AutofillContainer::GetListCount()
106 {
107   return GetImpl(*this).GetListCount();
108 }
109
110 const std::string& AutofillContainer::GetListItem( unsigned int index ) const
111 {
112   return GetImpl(*this).GetListItem( index );
113 }
114
115 void AutofillContainer::SetSelectedItem( const std::string& selected )
116 {
117   GetImpl(*this).SetSelectedItem( selected );
118 }
119
120 AutofillContainer::AutofillContainer( Internal::AutofillContainer* implementation )
121 : BaseHandle(implementation)
122 {
123 }
124
125 AutofillContainer::AuthenticationSignalType& AutofillContainer::AutofillServiceShownSignal()
126 {
127   return GetImpl(*this).AutofillServiceShownSignal();
128 }
129
130 AutofillContainer::ListShownSignalType& AutofillContainer::AutofillListShownSignal()
131 {
132   return GetImpl(*this).AutofillListShownSignal();
133 }
134
135 } // namespace Toolkit
136
137 } // namespace Dali