Changed indicator bg color.
[platform/framework/native/uifw.git] / src / ui / controls / FUiCtrlIconListViewItem.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
10 //
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.
16 //
17
18 /**
19  * @file        FUiCtrlIconListViewItem.cpp
20  * @brief       This is the implementation file for the IconListViewItem class.
21  */
22
23 // Includes
24 #include <FBaseSysLog.h>
25 #include <FUiCtrlIconListViewItem.h>
26
27 #include "FUiCtrl_IconListViewItemImpl.h"
28
29 using namespace Tizen::Base;
30 using namespace Tizen::Graphics;
31
32 namespace Tizen { namespace Ui { namespace Controls
33 {
34
35 IconListViewItem::IconListViewItem(void)
36         : __pImpl(null)
37 {
38         // nothing
39 }
40
41 IconListViewItem::~IconListViewItem(void)
42 {
43         delete __pImpl;
44         __pImpl = null;
45 }
46
47 result
48 IconListViewItem::Construct(const Bitmap& bitmap, const String* pText, const Bitmap* pSelectedBitmap,
49                 const Bitmap* pHighlightedBitmap)
50 {
51         // Check whether __pImpl has been set, that is, "already constructed" condition.
52         SysAssertf(__pImpl == null,
53                         "Already constructed. Calling Construct() twice or more on a same instance is not allowed for this class.");
54
55         __pImpl = _IconListViewItemImpl::CreateIconListViewItemImplN(*this, bitmap, pText, pSelectedBitmap, pHighlightedBitmap);
56
57         result r = GetLastResult();
58         if (__pImpl == null)
59         {
60                 SysLogException(NID_UI_CTRL, r, "[%s] Propagating.", GetErrorMessage(r));
61         }
62         else
63         {
64                 r = E_SUCCESS;
65         }
66
67         return r;
68 }
69
70 result
71 IconListViewItem::SetOverlayBitmap(int overlayBitmapId, const Bitmap* pOverlayBitmap,
72                 HorizontalAlignment horizontalAlignment, VerticalAlignment verticalAlignment)
73 {
74         // Check whether __pImpl has not been set as a precondition of this method, that is, "not-yet constructed" condition.
75         SysAssertf(__pImpl != null, "Not yet constructed. Construct() should be called before use.");
76
77         return __pImpl->SetOverlayBitmap(overlayBitmapId, pOverlayBitmap, horizontalAlignment, verticalAlignment);
78 }
79
80 }}} // Tizen::Ui::Controls