2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0/
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an ”AS IS” BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FUi_UiBuilderControlItem.cpp
20 * @brief This is the implementation file for _UiBuilderControlItem class.
26 #include "FUi_UiBuilder.h"
27 #include "FUi_UiBuilderControlItem.h"
29 using namespace Tizen::Base;
30 using namespace Tizen::Base::Collection;
31 using namespace Tizen::Ui;
33 namespace Tizen { namespace Ui
35 _UiBuilderControlItem::_UiBuilderControlItem(void)
37 ,__pUiBuilderControlElementList(null)
39 if (__pUiBuilderControlElementList == null)
41 __pUiBuilderControlElementList = new (std::nothrow) ArrayListT<_UiBuilderControlElement*>;
45 _UiBuilderControlItem::~_UiBuilderControlItem(void)
47 if (__pUiBuilderControlElementList)
49 _UiBuilderControlElement* pUiBuilderControlElement = null;
50 int controlCount = __pUiBuilderControlElementList->GetCount();
51 for (int i = 0; i < controlCount; i++)
53 __pUiBuilderControlElementList->GetAt(i, pUiBuilderControlElement);
54 delete pUiBuilderControlElement;
56 __pUiBuilderControlElementList->RemoveAll();
57 delete __pUiBuilderControlElementList;
58 __pUiBuilderControlElementList = null;
63 _UiBuilderControlItem::SetItemName(const Tizen::Base::String& name)
69 _UiBuilderControlItem::GetItemName(void) const
75 _UiBuilderControlItem::SetItemElement(int index, const Tizen::Base::String& name, const Tizen::Base::String& value)
77 _UiBuilderControlElement* pUiBuilderControlElement = null;
78 pUiBuilderControlElement = new (std::nothrow) _UiBuilderControlElement;
79 if (pUiBuilderControlElement != null)
81 pUiBuilderControlElement->SetName(name);
82 pUiBuilderControlElement->SetValue(value);
83 __pUiBuilderControlElementList->Add(pUiBuilderControlElement);
88 ArrayListT<_UiBuilderControlElement*>*
89 _UiBuilderControlItem::GetItemProperty(void)
91 return __pUiBuilderControlElementList;