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.
18 * @file FUiCtrlFooterItem.cpp
19 * @brief This is the implementation file for FooterItem class.
23 #include <FUiCtrlFooterItem.h>
24 #include <FBaseSysLog.h>
25 #include "FUiCtrl_FooterItemImpl.h"
27 using namespace Tizen::Base;
28 using namespace Tizen::Graphics;
30 namespace Tizen { namespace Ui { namespace Controls
33 FooterItem::FooterItem(void)
38 FooterItem::~FooterItem(void)
48 FooterItem::Construct(int actionId)
52 SysTryReturnResult(NID_UI_CTRL, (actionId >= FOOTER_ITEM_ACTION_ID_MIN && actionId <= FOOTER_ITEM_ACTION_ID_MAX), E_INVALID_ARG,
53 "[E_INVALID_ARG] The actionId is invalid.");
55 _FooterItemImpl* pImpl = _FooterItemImpl::GetInstance(*this);
57 SysAssertf(pImpl == null,
58 "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
60 __pImpl = new (std::nothrow) _FooterItemImpl(this);
61 SysTryReturnResult(NID_UI_CTRL, __pImpl, E_OUT_OF_MEMORY, "[E_OUT_OF_MEMORY] Impl instance is not constructed");
63 r = __pImpl->Construct(actionId);
69 SysLog(NID_UI_CTRL, "[%s] Propagated.", GetErrorMessage(r));
77 FooterItem::GetActionId(void) const
79 SysAssertf(__pImpl != null,
80 "Not yet constructed. Construct() should be called before use.");
82 return __pImpl->GetActionId();
86 FooterItem::GetText(void) const
88 SysAssertf(__pImpl != null,
89 "Not yet constructed. Construct() should be called before use.");
91 return __pImpl->GetText();
95 FooterItem::SetActionId(int actionId)
97 SysAssertf(__pImpl != null,
98 "Not yet constructed. Construct() should be called before use.");
100 return __pImpl->SetActionId(actionId);
104 FooterItem::SetBackgroundBitmap(FooterItemStatus status, const Bitmap* pBitmap)
106 SysAssertf(__pImpl != null,
107 "Not yet constructed. Construct() should be called before use.");
109 return __pImpl->SetBackgroundBitmap(status, pBitmap);
113 FooterItem::SetIcon(FooterItemStatus status, const Bitmap* pIcon)
115 SysTryReturnResult(NID_UI_CTRL, pIcon, E_INVALID_ARG, "[E_INVALID_ARG] pIcon is invalid.");
117 SysAssertf(__pImpl != null,
118 "Not yet constructed. Construct() should be called before use.");
120 return __pImpl->SetIcon(status, pIcon);
124 FooterItem::SetText(const String& text)
126 SysAssertf(__pImpl != null,
127 "Not yet constructed. Construct() should be called before use.");
129 return __pImpl->SetText(text);
132 }}} // Tizen::Ui::Controls