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.
20 * @file FUiCtrlICustomElement.h
21 * @brief This is the header file for the %ICustomElement interface.
23 * This header file contains the declarations of %ICustomElement and its helper classes.
26 #ifndef _FUI_CTRL_ICUSTOM_ELEMENT_H_
27 #define _FUI_CTRL_ICUSTOM_ELEMENT_H_
29 #include <FBaseObject.h>
30 #include <FGrpCanvas.h>
31 #include <FUiCtrlListViewTypes.h>
33 namespace Tizen { namespace Ui { namespace Controls
37 * @interface ICustomElement
38 * @brief This interface represents the common behaviors of a custom element.
42 * The %ICustomElement interface is the listener interface for custom drawing in a list item.
43 * The class that processes a custom drawing event implements this interface. The list items are added by calling the
44 * AddElement(int elementId, const %ICustomElement &element) method. When the custom drawing event occurs and the list item must be
45 * redrawn, the OnDraw() method is invoked.
47 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_listviews.htm">ListViews</a>.
50 class _OSP_EXPORT_ ICustomElement
54 * This polymorphic destructor should be overridden if required. This way, the destructors of the derived classes are called when the destructor of this interface is called.
58 virtual ~ICustomElement(void) {}
63 * Called when a custom element of the item is drawn.
67 * @return @c true if the drawing is successful, @n
69 * @param[in] canvas The graphic canvas of the list control
70 * @param[in] rect The position and size of the element
71 * @param[in] status The status of the element
72 * @remarks This method must return @c true if the drawing is successful, else @c false.
74 virtual bool OnDraw(Tizen::Graphics::Canvas& canvas, const Tizen::Graphics::Rectangle& rect, Tizen::Ui::Controls::ListItemDrawingStatus status) = 0;
78 // The following methods are reserved and may change its name at any time without prior notice.
80 virtual void ICustomElement_Reserved1(void) {}
81 virtual void ICustomElement_Reserved2(void) {}
82 virtual void ICustomElement_Reserved3(void) {}
85 }}} // Tizen::Ui::Controls
87 #endif // _FUI_CTRL_ICUSTOM_ELEMENT_H_