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.
19 * @file FUiCtrlListContextItem.cpp
20 * @brief This is the implementation file for ListContextItem class.
22 * This file contains the implementation of ListContextItem class.
25 #include <FBaseSysLog.h>
26 #include <FUiCtrlListContextItem.h>
27 #include "FUiCtrl_ListContextItemImpl.h"
29 using namespace Tizen::Base;
30 using namespace Tizen::Graphics;
32 namespace Tizen { namespace Ui { namespace Controls
35 ListContextItem::ListContextItem(void)
40 ListContextItem::~ListContextItem(void)
47 ListContextItem::Construct(void)
49 _ListContextItemImpl* pImpl = _ListContextItemImpl::GetInstance(*this);
50 SysAssertf(pImpl == null,
51 "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
53 pImpl = _ListContextItemImpl::CreateListContextItemImplN(this);
54 SysTryReturn(NID_UI_CTRL, pImpl != null, GetLastResult(), GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
62 ListContextItem::AddElement(int elementId, const String& text, bool enable)
64 SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
66 return __pImpl->AddElement(elementId, text, enable);
70 ListContextItem::AddElement(int elementId, const Bitmap& normalBitmap, const Bitmap& pressedBitmap,
71 const Bitmap* pHighlightedBitmap, bool enable)
73 SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
75 return __pImpl->AddElement(elementId, normalBitmap, pressedBitmap, pHighlightedBitmap, enable);
79 ListContextItem::AddElement(int elementId, const String& text, const Bitmap& normalBitmap,
80 const Bitmap& pressedBitmap, const Bitmap* pHighlightedBitmap, bool enable)
82 SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
84 return __pImpl->AddElement(elementId, text, normalBitmap, pressedBitmap, pHighlightedBitmap, enable);
89 ListContextItem::SetBackgroundBitmap(const Bitmap* pBitmap)
91 SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
93 return __pImpl->SetBackgroundBitmap(pBitmap);
98 ListContextItem::SetBackgroundColor(const Color& color)
100 SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
102 return __pImpl->SetBackgroundColor(color);
107 ListContextItem::GetBackgroundColor(void) const
109 SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
111 return __pImpl->GetBackgroundColor();
114 }}} // Tizen::Ui::Controls