Tizen 2.1 base
[framework/osp/uifw.git] / inc / FUiCtrlListContextItem.h
1 //
2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 //     http://floralicense.org/license/
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        FUiCtrlListContextItem.h
20  * @brief       This is the header file for the %ListContextItem class.
21  *
22  * This header file contains the declarations of the %ListContextItem class and its helper classes.
23  */
24
25 #ifndef _FUI_CTRL_LIST_CONTEXT_ITEM_H_
26 #define _FUI_CTRL_LIST_CONTEXT_ITEM_H_
27
28 #include <FBaseObject.h>
29 #include <FBaseTypes.h>
30 #include <FGrpBitmap.h>
31 #include <FGrpRectangle.h>
32
33 namespace Tizen { namespace Ui { namespace Controls
34 {
35
36 class _ListContextItemImpl;
37
38 /**
39  * @class       ListContextItem
40  * @brief    This class defines common behavior for %ListContextItem.
41  *
42  * @since       2.0
43  *
44  * The %ListContextItem class displays the context item for a ListView or GroupedListView.
45  *
46  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_listviews.htm">ListViews</a>.
47  */
48
49 class _OSP_EXPORT_ ListContextItem
50         : public Tizen::Base::Object
51 {
52 public:
53         /**
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.
57          *
58          * @since       2.0
59          */
60         ListContextItem(void);
61
62         /**
63          * This destructor overrides Tizen::Base::Object::~Object().
64          *
65          * @since       2.0
66          */
67         virtual ~ListContextItem(void);
68
69         /**
70          * Initializes this instance of %ListContextItem with the specified parameter.
71          *
72          * @since       2.0
73          *
74          * @return  An error code
75          * @exception E_SUCCESS         The method is successful.
76          * @exception E_SYSTEM          A system error has occurred.
77          */
78         result Construct(void);
79
80         /**
81          * Adds the text element to the context item.
82          *
83          * @since       2.0
84          *
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
89          *                              else @c false
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.
93          */
94         result AddElement(int elementId, const Tizen::Base::String& text, bool enable = true);
95
96         /**
97          * Adds the bitmap element to the context item.
98          *
99          * @since       2.0
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
106          *                                else @c false
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.
110          */
111         result AddElement(int elementId, const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap& pressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap = null, bool enable = true);
112
113         /**
114          * Adds the text and the bitmap element to the context item.
115          *
116          * @since       2.0
117          *
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
125          *                                else @c false
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.
129          */
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);
131
132         /**
133          * Sets the background image of a context item.
134          *
135          * @since   2.0
136          *
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.
144          */
145         result SetBackgroundBitmap(const Tizen::Graphics::Bitmap* pBitmap);
146
147         /**
148          * Sets the background color of a context item.
149          *
150          * @since   2.0
151          *
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.
158          */
159         result SetBackgroundColor(const Tizen::Graphics::Color& color);
160
161         /**
162          * Gets the background color of a context item.
163          *
164          * @since   2.0
165          *
166          * @return  The background color of a context item
167          */
168         Tizen::Graphics::Color GetBackgroundColor(void) const;
169
170 protected:
171         friend class _ListContextItemImpl;
172
173 private:
174         //
175         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
176         //
177         ListContextItem(const ListContextItem& rhs);
178
179         //
180         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
181         //
182         ListContextItem& operator =(const ListContextItem& rhs);
183
184 private:
185         _ListContextItemImpl* __pImpl;
186 }; // ListContextItem
187
188 }}} // Tizen::Ui::Controls
189
190 #endif  // _FUI_CTRL_LIST_CONTEXT_ITEM_H_
191