Fix to adjust the position of the partial Frame
[platform/framework/native/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 <FGrpBitmap.h>
29 #include <FUiCtrlListViewTypes.h>
30
31 namespace Tizen { namespace Ui { namespace Controls
32 {
33
34 class _ListContextItemImpl;
35
36 /**
37  * @class       ListContextItem
38  * @brief    This class defines common behavior for %ListContextItem.
39  *
40  * @since       2.0
41  *
42  * The %ListContextItem class displays the context item for a ListView or GroupedListView.
43  *
44  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_listviews.htm">ListViews</a>.
45  */
46
47 class _OSP_EXPORT_ ListContextItem
48         : public Tizen::Base::Object
49 {
50 public:
51         /**
52          * The object is not fully constructed after this constructor is
53          * called. For full construction, the Construct() method must be
54          * called right after calling this constructor.
55          *
56          * @since       2.0
57          */
58         ListContextItem(void);
59
60         /**
61          * This destructor overrides Tizen::Base::Object::~Object().
62          *
63          * @since       2.0
64          */
65         virtual ~ListContextItem(void);
66
67         /**
68          * Initializes this instance of %ListContextItem with the specified parameter.
69          *
70          * @since       2.0
71          *
72          * @return  An error code
73          * @exception E_SUCCESS         The method is successful.
74          * @exception E_SYSTEM          A system error has occurred.
75          */
76         result Construct(void);
77
78         /**
79          * Adds the text element to the context item.
80          *
81          * @since       2.0
82          *
83          * @return  An error code
84          * @param[in] elementId         The ID of the element
85          * @param[in] text              The text to display
86          * @param[in] enable            Set to @c true, to enable this element @n
87          *                              else @c false
88          * @exception E_SUCCESS         The method is successful.
89          * @exception E_INVALID_ARG     A specified input parameter is invalid.
90          * @exception E_SYSTEM          A system error has occurred.
91          */
92         result AddElement(int elementId, const Tizen::Base::String& text, bool enable = true);
93
94         /**
95          * Adds the bitmap element to the context item.
96          *
97          * @since       2.0
98          * @return  An error code
99          * @param[in] elementId           The ID of the element
100          * @param[in] normalBitmap        The bitmap displayed when the item is in normal status
101          * @param[in] pressedBitmap       The bitmap displayed when the item is pressed
102          * @param[in] pHighlightedBitmap  The bitmap displayed when the item is highlighted
103          * @param[in] enable              Set to @c true, to enable this element, @n
104          *                                else @c false
105          * @exception E_SUCCESS         The method is successful.
106          * @exception E_INVALID_ARG     A specified input parameter is invalid.
107          * @exception E_SYSTEM          A system error has occurred.
108          */
109         result AddElement(int elementId, const Tizen::Graphics::Bitmap& normalBitmap, const Tizen::Graphics::Bitmap& pressedBitmap, const Tizen::Graphics::Bitmap* pHighlightedBitmap = null, bool enable = true);
110
111         /**
112          * Adds the text and the bitmap element to the context item.
113          *
114          * @since       2.0
115          *
116          * @return  An error code
117          * @param[in] elementId           The ID of the element
118          * @param[in] text                                The text to display
119          * @param[in] normalBitmap        The bitmap displayed when the item is in normal status
120          * @param[in] pressedBitmap       The bitmap displayed when the item is pressed
121          * @param[in] pHighlightedBitmap  The bitmap displayed when the item is highlighted
122          * @param[in] enable              Set to @c true, to enable this element, @n
123          *                                else @c false
124          * @exception E_SUCCESS         The method is successful.
125          * @exception E_INVALID_ARG     A specified input parameter is invalid.
126          * @exception E_SYSTEM          A system error has occurred.
127          */
128         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);
129
130         /**
131          * Sets the background image of a context item.
132          *
133          * @since   2.0
134          *
135          * @return  An error code
136          * @param[in] pBitmap           The background bitmap image
137          * @exception E_SUCCESS         The method is successful.
138          * @exception E_SYSTEM          A system error has occurred.
139          * @remarks  The background bitmap has priority over the background color. When both the background bitmap and the background color are specified, only
140          *                      the bitmap is displayed. @n
141          *                      When @c pBitmap is set as @c null, the background color of the context item is drawn.
142          */
143         result SetBackgroundBitmap(const Tizen::Graphics::Bitmap* pBitmap);
144
145         /**
146          * Sets the background color of a context item.
147          *
148          * @since   2.0
149          *
150          * @return  An error code
151          * @param[in] color             The background color
152          * @exception E_SUCCESS         The method is successful.
153          * @exception E_SYSTEM          A system error has occurred.
154          * @remarks  The background bitmap has priority over the background color. When both the background bitmap and the background color are specified, only
155          *                      the bitmap is displayed.
156          */
157         result SetBackgroundColor(const Tizen::Graphics::Color& color);
158
159         /**
160          * Gets the background color of a context item.
161          *
162          * @since   2.0
163          *
164          * @return  The background color of a context item
165          */
166         Tizen::Graphics::Color GetBackgroundColor(void) const;
167
168         /**
169          * Sets the background color of the context item element.
170          *
171          * @since   2.1
172          *
173          * @return      An error code
174          * @param[in] elementId                 The ID of the element
175          * @param[in] status                    The stauts of the context item element
176          * @param[in] backgroundColor                           The background color of the context item element
177          * @exception E_SUCCESS                         The method is successful.
178          * @exception E_INVALID_ARG                     A specified @ elementId is invalid.
179          * @exception E_INVALID_OPERATION       The current state of the instance prohibits the execution of the specified operation.
180          * @remarks     If the specified @c backgroundColor is not set, the default color set by configuration is used.
181          * @see         GetElementBackgroundColor()
182          */
183         result SetElementBackgroundColor(int elementId, ListContextItemElementStatus status, const Tizen::Graphics::Color& backgroundColor);
184
185         /**
186          * Gets the background color of the context item element.
187          *
188          * @since   2.1
189          *
190          * @return      The background color of the element
191          * @param[in] elementId                 The ID of the element
192          * @param[in] status                    The stauts of the context item element
193          * @exception E_SUCCESS                         The method is successful.
194          * @exception E_INVALID_ARG                     A specified @c elementId is invalid.
195          * @exception E_INVALID_OPERATION       The current state of the instance prohibits the execution of the specified operation.
196          * @remarks     The specific error code can be accessed using the GetLastResult() method.
197          * @see         SetElementBackgroundColor()
198          */
199         Tizen::Graphics::Color GetElementBackgroundColor(int elementId, ListContextItemElementStatus status) const;
200
201         /**
202          * Sets the text color of the context item element.
203          *
204          * @since   2.1
205          *
206          * @return      An error code
207          * @param[in] elementId                 The ID of the element
208          * @param[in] status                    The stauts of the context item element
209          * @param[in] textColor                         The text color of the context item element
210          * @exception E_SUCCESS                         The method is successful.
211          * @exception E_INVALID_ARG                     A specified @ elementId is invalid.
212          * @exception E_INVALID_OPERATION       The current state of the instance prohibits the execution of the specified operation.
213          * @remarks     If the element text color is not set by application, the default color set by theme.
214          * @see         GetElementTextColor()
215          */
216         result SetElementTextColor(int elementId, ListContextItemElementStatus status, const Tizen::Graphics::Color& textColor);
217
218         /**
219          * Gets the text color of the context item element.
220          *
221          * @since   2.1
222          *
223          * @return      The text color of the element
224          * @param[in] elementId                 The ID of the element
225          * @param[in] status                    The stauts of the context item element
226          * @exception E_SUCCESS                         The method is successful.
227          * @exception E_INVALID_ARG                     A specified @c elementId is invalid.
228          * @exception E_INVALID_OPERATION       The current state of the instance prohibits the execution of the specified operation.
229          * @remarks     The specific error code can be accessed using the GetLastResult() method.
230          * @see         SetElementTextColor()
231          */
232         Tizen::Graphics::Color GetElementTextColor(int elementId, ListContextItemElementStatus status) const;
233
234 protected:
235         friend class _ListContextItemImpl;
236
237 private:
238         //
239         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
240         //
241         ListContextItem(const ListContextItem& rhs);
242
243         //
244         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
245         //
246         ListContextItem& operator =(const ListContextItem& rhs);
247
248 private:
249         _ListContextItemImpl* __pImpl;
250 }; // ListContextItem
251
252 }}} // Tizen::Ui::Controls
253
254 #endif  // _FUI_CTRL_LIST_CONTEXT_ITEM_H_