2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Flora License, Version 1.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://floralicense.org/license/
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.
18 * @file FUi_LayoutLayoutList.cpp
19 * @brief This is the implementation file for LayoutList class.
21 * This file contains the implementation of LayoutList class.
25 #include "FUi_LayoutLayoutList.h"
27 namespace Tizen { namespace Ui { namespace _Layout
30 LayoutList::LayoutList(void)
34 LayoutList::~LayoutList(void)
40 LayoutList::GetFirstNode(void) const
42 return dynamic_cast <LayoutListNode*>(LinkedList::GetFirstNode());
46 LayoutList::GetLastNode(void) const
48 return dynamic_cast <LayoutListNode*>(LinkedList::GetLastNode());
52 LayoutList::GetNextNode(const LayoutListNode& node) const
54 return dynamic_cast <LayoutListNode*>(LinkedList::GetNextNode(node));
58 LayoutList::GetPrevNode(const LayoutListNode& node) const
60 return dynamic_cast <LayoutListNode*>(LinkedList::GetPrevNode(node));
64 LayoutList::AddNode(Layout& addLayout)
66 LayoutListNode* pAddNode = new (std::nothrow) LayoutListNode();
73 pAddNode->Create(addLayout);
75 if (InsertIntoLeft(*_pEndNode, *pAddNode) != E_SUCCESS)
85 LayoutList::CheckNodeExists(const Layout& layout) const
87 LayoutListNode* pCurNode = GetFirstNode();
88 Layout* pCurLayout = null;
92 pCurLayout = pCurNode->GetLayout();
93 if (pCurLayout == &layout)
97 pCurNode = GetNextNode(*pCurNode);
103 LayoutList::RemoveNode(LinkedListNode& node)
105 return LinkedList::RemoveNode(node);
110 LayoutList::RemoveAllNode(void)
112 LinkedListNode* pCurNode = GetFirstNode();
113 LinkedListNode* pNextNode = pCurNode;
115 while (pCurNode != null)
117 pNextNode = LinkedList::GetNextNode(*pCurNode);
118 if (RemoveNode(*pCurNode) != E_SUCCESS)
122 pCurNode = pNextNode;
126 }}} // Tizen::Ui::_Layout