2 * Copyright (c) 2019 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <dali/internal/input/ubuntu-x11/autofill-item-impl-x.h>
23 #include <dali/public-api/object/type-registry.h>
24 #include <dali/integration-api/debug.h>
37 #if defined(DEBUG_ENABLED)
38 Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_AUTOFILL");
44 return Dali::Internal::Adaptor::AutofillItem::New( "", "", Dali::AutofillItem::Hint::ID, false );
47 Dali::TypeRegistration type( typeid(Dali::AutofillItem), typeid(Dali::BaseHandle), Create );
49 } // unnamed namespace
52 AutofillItemX::AutofillItemX( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData )
56 mSensitiveData( sensitiveData ),
58 mPresentationTextList(),
63 AutofillItemX::~AutofillItemX()
68 Dali::AutofillItem AutofillItemX::New( const std::string& id, const std::string& label, Dali::AutofillItem::Hint hint, bool sensitiveData )
70 Dali::Internal::Adaptor::AutofillItem* item = new Dali::Internal::Adaptor::AutofillItemX( id, label, hint, sensitiveData );
71 Dali::AutofillItem handle = Dali::AutofillItem( item );
78 void AutofillItemX::Initialize()
82 const std::string& AutofillItemX::GetId() const
84 DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemX::GetId \n" );
88 const std::string& AutofillItemX::GetLabel() const
90 DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemX::GetLabel \n" );
94 Dali::AutofillItem::Hint AutofillItemX::GetHint() const
96 DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemX::GetHint \n" );
100 bool AutofillItemX::IsSensitiveData() const
102 DALI_LOG_INFO( gLogFilter, Debug::General, "AutofillItemX::IsSensitiveData \n" );
103 return mSensitiveData;
106 void AutofillItemX::SetSaveValue( const std::string& value )
111 const std::string& AutofillItemX::GetSaveValue() const
116 void AutofillItemX::AddPresentationList( const std::string& presentationText )
118 mPresentationTextList.push_back( presentationText );
121 void AutofillItemX::AddFillValueList( const std::string& fillValue )
123 mValueList.push_back( fillValue );
126 const std::string& AutofillItemX::GetPresentationText( int index ) const
128 return mPresentationTextList[index];
131 const std::string& AutofillItemX::GetFillValue( int index ) const
133 return mValueList[index];
136 void AutofillItemX::ClearPresentationTextList()
138 mPresentationTextList.clear();
141 void AutofillItemX::ClearFillValueList()
146 unsigned int AutofillItemX::GetFillValueCount()
148 return mValueList.size();