2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Flora License, Version 1.1 (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://floralicense.org/license/
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.
18 * @file CtContactValueListItemProvider.cpp
19 * @brief This is the implementation file for the ContactValueListItemProvider class.
22 #include "CtContactValueListItemProvider.h"
24 using namespace Tizen::Base;
25 using namespace Tizen::Base::Collection;
26 using namespace Tizen::Graphics;
27 using namespace Tizen::Ui::Controls;
29 static const int H_ITEM = 112;
31 ContactValueListItemProvider::ContactValueListItemProvider(Tizen::Base::Collection::IList* pContactValueList)
32 : __pContactValueList(pContactValueList)
36 ContactValueListItemProvider::~ContactValueListItemProvider(void)
38 if (__pContactValueList != null)
40 __pContactValueList->RemoveAll(true);
41 delete __pContactValueList;
45 Tizen::Ui::Controls::ListItemBase*
46 ContactValueListItemProvider::CreateItem(int index, int itemWidth)
48 SimpleItem* pItem = new (std::nothrow) SimpleItem();
49 pItem->Construct(Dimension(itemWidth, H_ITEM), LIST_ANNEX_STYLE_NORMAL);
50 pItem->SetElement(*static_cast<String *>(__pContactValueList->GetAt(index)));
56 ContactValueListItemProvider::DeleteItem(int index, Tizen::Ui::Controls::ListItemBase* pItem, int itemWidth)
64 ContactValueListItemProvider::GetItemCount(void)
66 return __pContactValueList->GetCount();