2 // Open Service Platform
3 // Copyright (c) 2012 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 FWebCtrlPageNavigationList.cpp
20 * @brief The file contains the definition of PageNavigationList class.
22 * The file contains the definition of PageNavigationList class.
25 #include <FBaseResult.h>
26 #include <FBaseSysLog.h>
27 #include <FWebCtrlPageNavigationList.h>
28 #include <FWebHistoryItem.h>
29 #include "FWebCtrl_PageNavigationListImpl.h"
32 using namespace Tizen::Base;
33 using namespace Tizen::Base::Collection;
36 namespace Tizen { namespace Web { namespace Controls
40 PageNavigationList::PageNavigationList(void)
41 : __pPageNavigationListImpl(new (std::nothrow) _PageNavigationListImpl())
43 SysTryReturnVoidResult(NID_WEB_CTRL, __pPageNavigationListImpl, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
47 PageNavigationList::~PageNavigationList(void)
49 delete __pPageNavigationListImpl;
50 __pPageNavigationListImpl = null;
55 PageNavigationList::GetCurrentItem(void) const
57 SysAssertf(__pPageNavigationListImpl != null, "Not yet constructed. Construct() should be called before use.");
59 return __pPageNavigationListImpl->GetCurrentItem();
64 PageNavigationList::GetCurrentIndex(void) const
66 SysAssertf(__pPageNavigationListImpl != null, "Not yet constructed. Construct() should be called before use.");
68 return __pPageNavigationListImpl->GetCurrentIndex();
73 PageNavigationList::GetItemAt(int index) const
75 SysAssertf(__pPageNavigationListImpl != null, "Not yet constructed. Construct() should be called before use.");
79 const HistoryItem* pItem = __pPageNavigationListImpl->GetItemAt(index);
80 SysTryReturn(NID_WEB_CTRL, pItem, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
82 SysLog(NID_WEB_CTRL, "The current value of index is %d", index);
89 PageNavigationList::GetItemCount(void) const
91 SysAssertf(__pPageNavigationListImpl != null, "Not yet constructed. Construct() should be called before use.");
93 return __pPageNavigationListImpl->GetItemCount();
97 }}} // Tizen::Web::Controls