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.h
20 * @brief This is the header file for the %ListContextItem class.
22 * This header file contains the declarations of the %ListContextItem class and its helper classes.
25 #ifndef _FUI_CTRL_LIST_CONTEXT_ITEM_H_
26 #define _FUI_CTRL_LIST_CONTEXT_ITEM_H_
28 #include <FBaseObject.h>
29 #include <FBaseTypes.h>
30 #include <FGrpBitmap.h>
31 #include <FGrpRectangle.h>
33 namespace Tizen { namespace Ui { namespace Controls
36 class _ListContextItemImpl;
39 * @class ListContextItem
40 * @brief This class defines common behavior for %ListContextItem.
44 * The %ListContextItem class displays the context item for a ListView or GroupedListView.
46 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_listviews.htm">ListViews</a>.
49 class _OSP_EXPORT_ ListContextItem
50 : public Tizen::Base::Object
54 * The object is not fully constructed after this constructor is
55 * called. For full construction, the Construct() method must be
56 * called right after calling this constructor.
60 ListContextItem(void);
63 * This destructor overrides Tizen::Base::Object::~Object().
67 virtual ~ListContextItem(void);
70 * Initializes this instance of %ListContextItem with the specified parameter.
74 * @return An error code
75 * @exception E_SUCCESS The method is successful.
76 * @exception E_SYSTEM A system error has occurred.
78 result Construct(void);
81 * Adds the text element to the context item.
85 * @return An error code
86 * @param[in] elementId The ID of the element
87 * @param[in] text The text to display
88 * @param[in] enable Set to @c true, to enable this element @n
90 * @exception E_SUCCESS The method is successful.
91 * @exception E_INVALID_ARG A specified input parameter is invalid.
92 * @exception E_SYSTEM A system error has occurred.
94 result AddElement(int elementId, const Tizen::Base::String& text, bool enable = true);
97 * Adds the bitmap element to the context item.
100 * @return An error code
101 * @param[in] elementId The ID of the element
102 * @param[in] normalBitmap The bitmap displayed when the item is in normal status
103 * @param[in] pressedBitmap The bitmap displayed when the item is pressed
104 * @param[in] pHighlightedBitmap The bitmap displayed when the item is highlighted
105 * @param[in] enable Set to @c true, to enable this element, @n
107 * @exception E_SUCCESS The method is successful.
108 * @exception E_INVALID_ARG A specified input parameter is invalid.
109 * @exception E_SYSTEM A system error has occurred.
111 result AddElement(int elementId, const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap& pressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap = null, bool enable = true);
114 * Adds the text and the bitmap element to the context item.
118 * @return An error code
119 * @param[in] elementId The ID of the element
120 * @param[in] text The text to display
121 * @param[in] normalBitmap The bitmap displayed when the item is in normal status
122 * @param[in] pressedBitmap The bitmap displayed when the item is pressed
123 * @param[in] pHighlightedBitmap The bitmap displayed when the item is highlighted
124 * @param[in] enable Set to @c true, to enable this element, @n
126 * @exception E_SUCCESS The method is successful.
127 * @exception E_INVALID_ARG A specified input parameter is invalid.
128 * @exception E_SYSTEM A system error has occurred.
130 result AddElement(int elementId, const Tizen::Base::String& text, const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap& pressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap = null, bool enable = true);
133 * Sets the background image of a context item.
137 * @return An error code
138 * @param[in] pBitmap The background bitmap image
139 * @exception E_SUCCESS The method is successful.
140 * @exception E_SYSTEM A system error has occurred.
141 * @remarks The background bitmap has priority over the background color. When both the background bitmap and the background color are specified, only
142 * the bitmap is displayed. @n
143 * When @c pBitmap is set as @c null, the background color of the context item is drawn.
145 result SetBackgroundBitmap(const Tizen::Graphics::Bitmap* pBitmap);
148 * Sets the background color of a context item.
152 * @return An error code
153 * @param[in] color The background color
154 * @exception E_SUCCESS The method is successful.
155 * @exception E_SYSTEM A system error has occurred.
156 * @remarks The background bitmap has priority over the background color. When both the background bitmap and the background color are specified, only
157 * the bitmap is displayed.
159 result SetBackgroundColor(const Tizen::Graphics::Color& color);
162 * Gets the background color of a context item.
166 * @return The background color of a context item
168 Tizen::Graphics::Color GetBackgroundColor(void) const;
171 friend class _ListContextItemImpl;
175 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
177 ListContextItem(const ListContextItem& rhs);
180 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
182 ListContextItem& operator =(const ListContextItem& rhs);
185 _ListContextItemImpl* __pImpl;
186 }; // ListContextItem
188 }}} // Tizen::Ui::Controls
190 #endif // _FUI_CTRL_LIST_CONTEXT_ITEM_H_