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.
19 * @file FUiCtrlListItemBase.h
20 * @brief This is the header file for the %ListItemBase class.
22 * This header file contains the declarations of the %ListItemBase class and its helper classes.
25 #ifndef _FUI_CTRL_LIST_ITEM_BASE_H_
26 #define _FUI_CTRL_LIST_ITEM_BASE_H_
28 #include <FBaseObject.h>
29 #include <FBaseTypes.h>
30 #include <FGrpBitmap.h>
31 #include <FGrpRectangle.h>
32 #include <FUiCtrlListContextItem.h>
33 #include <FUiCtrlListViewTypes.h>
35 namespace Tizen { namespace Ui { namespace Controls
38 class _ListItemBaseImpl;
42 * @brief This class defines common behavior for a %ListItemBase.
46 * The %ListItemBase class is a base class, which represents a list item which is the unit of handling of the ListView or
47 * GroupedListView classes.
49 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_listviews.htm">ListViews</a>.
52 class _OSP_EXPORT_ ListItemBase
53 : public Tizen::Base::Object
57 * This destructor overrides Tizen::Base::Object::~Object().
61 virtual ~ListItemBase(void);
64 * Sets the background image of the item which is displayed when the item is in specified state.
68 * @return An error code
69 * @param[in] status The item drawing state
70 * @param[in] pBitmap The background bitmap image
71 * @exception E_SUCCESS The method is successful.
72 * @exception E_SYSTEM A system error has occurred.
73 * @remarks The background bitmap has priority over the background color. When both the background bitmap and the background color are specified,
74 * only the bitmap is displayed.
76 result SetBackgroundBitmap(ListItemDrawingStatus status, const Tizen::Graphics::Bitmap* pBitmap);
79 * Sets the background color of the item which is displayed when the item is in specified state.
83 * @return An error code
84 * @param[in] status The item drawing state
85 * @param[in] color The background color
86 * @exception E_SUCCESS The method is successful.
87 * @exception E_SYSTEM A system error has occurred.
88 * @remarks The background bitmap has priority over the background color. When both the background bitmap and the background color are specified, only the bitmap is displayed. @n
89 * The background color of the item is not applied when the item is inserted into the GroupedListView of section style.
91 result SetBackgroundColor(ListItemDrawingStatus status, const Tizen::Graphics::Color& color);
94 * Gets the background color of the item that is displayed when the item is in the specified state.
98 * @return The background color of the item
99 * @param[in] status The item drawing state, @n
100 * else RGBA(0, 0, 0, 0) if an error has occurs
101 * @see SetBackgroundColor()
103 Tizen::Graphics::Color GetBackgroundColor(ListItemDrawingStatus status) const;
106 * Sets ContextItem that is displayed when an item is swept.
110 * @return An error code
111 * @param[in] pItem The %ListContextItem instance
112 * @exception E_SUCCESS The method is successful.
113 * @exception E_INVALID_ARG A specified input parameter is invalid.
114 * @exception E_SYSTEM A system error has occurred.
116 * - If the context item is not set, ListView() or GroupedListView() does not display the context item and an item sweep event is generated when an
118 * - The specified @c pItem should be deleted by the applications when it is no longer used.
120 result SetContextItem(const ListContextItem* pItem);
123 * Sets the description text.
127 * @return An error code
128 * @param[in] text Description text
129 * @exception E_SUCCESS The method is successful.
130 * @exception E_SYSTEM A system error has occurred.
132 result SetDescriptionText(const Tizen::Base::String& text);
135 * Sets the color of the description text.
139 * @return An error code
140 * @param[in] color The color of the description text
141 * @exception E_SUCCESS The method is successful.
142 * @exception E_SYSTEM A system error has occurred.
144 result SetDescriptionTextColor(const Tizen::Graphics::Color& color);
147 * Gets the width of the annex area.
151 * @return The width of the annex
152 * @param[in] style The style of the annex
153 * @remarks The width of the annex area is different among annex styles.
155 static int GetAnnexWidth(ListAnnexStyle style);
158 * Gets the width of the annex area.
162 * @return The width of the annex
163 * @param[in] style The style of the annex
164 * @remarks The width of the annex area is different among annex styles.
166 static float GetAnnexWidthF(ListAnnexStyle style);
169 friend class _ListItemBaseImpl;
173 // This default constructor is intentionally declared as private so that only the platform can create an instance.
179 // Initializes this instance of ListItem with the specified parameter.
183 // @return An error code
185 // @param[in] itemSize The size of the item
186 // @param[in] style The style of Annex
187 // @exception E_SUCCESS The method is successful.
188 // @exception E_SYSTEM A system error has occurred.
190 result Construct(const Tizen::Graphics::Dimension& itemSize, ListAnnexStyle style);
193 // Initializes this instance of ListItem with the specified parameter.
197 // @return An error code
199 // @param[in] itemSize The size of the item
200 // @param[in] style The style of Annex
201 // @exception E_SUCCESS The method is successful.
202 // @exception E_SYSTEM A system error has occurred.
204 result Construct(const Tizen::Graphics::FloatDimension& itemSize, ListAnnexStyle style);
207 // The following methods are reserved and may change its name at any time without prior notice.
209 virtual void ListItemBase_Reserved1(void) {}
210 virtual void ListItemBase_Reserved2(void) {}
211 virtual void ListItemBase_Reserved3(void) {}
215 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
217 ListItemBase(const ListItemBase& rhs);
220 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
222 ListItemBase& operator =(const ListItemBase& rhs);
225 _ListItemBaseImpl* _pImpl;
228 }}} // Tizen::Ui::Controls
230 #endif // _FUI_CTRL_LIST_ITEM_BASE_H_