Tizen 2.1 base
[framework/osp/uifw.git] / inc / FUiCtrlTableViewItemBase.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 FUiCtrlTableViewItemBase.h
20 * @brief This is the header file for the %TableViewItemBase class.
21 *
22 * This header file contains the declarations of the %TableViewItemBase class and its helper classes.
23 */
24
25 #ifndef _FUI_CTRL_TABLE_VIEW_ITEM_BASE_H_
26 #define _FUI_CTRL_TABLE_VIEW_ITEM_BASE_H_
27
28 #include <FOspConfig.h>
29 #include <FUiContainer.h>
30 #include <FUiCtrlTableViewTypes.h>
31
32 namespace Tizen { namespace Ui { namespace Controls
33 {
34
35 /**
36  * @class TableViewItemBase
37  * @brief    This class defines common behavior for a %TableViewItemBase.
38  *
39  * @since 2.0
40  *
41  * The %TableViewItemBase class is a base class which represents a table view item which is the unit of handling of TableView.
42  *
43  */
44
45 class _OSP_EXPORT_ TableViewItemBase
46         : public Tizen::Ui::Container
47 {
48 public:
49         /**
50          * Sets the background image of the item which is displayed when the item is in specified state.
51          *
52          * @since 2.0
53          *
54          * @return  An error code
55          * @param[in] pBitmap           The background bitmap image
56          * @param[in] status            The item drawing state
57          * @exception E_SUCCESS         The method is successful.
58          * @exception E_OUT_OF_MEMORY          The memory is insufficient.
59          * @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.
60          */
61         result SetBackgroundBitmap(const Tizen::Graphics::Bitmap* pBitmap, TableViewItemDrawingStatus status = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL);
62
63         /**
64          * Sets the background color of the item which is displayed when the item is in specified state.
65          *
66          * @since 2.0
67          *
68          * @return  An error code
69          * @param[in] color             The background color
70          * @param[in] status            The item drawing state
71          */
72         void SetBackgroundColor(const Tizen::Graphics::Color& color, TableViewItemDrawingStatus status = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL);
73
74         /**
75          * Gets the background color of the item which is displayed when the item is in the specified state.
76          *
77          * @since 2.0
78          *
79          * @return  The background color of the item
80          * @param[in] status            The item drawing state
81          *
82          * @remarks  If an error occurs, this method returns RGBA(0, 0, 0, 0).
83          * @see     SetBackgroundColor()
84          */
85         Tizen::Graphics::Color GetBackgroundColor(TableViewItemDrawingStatus status = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL) const;
86
87         /**
88          * Enables or disables the individual selection of a control.
89          *
90          * @since 2.0
91          *
92          * @return        An error code
93          * @param[in] pControl          The child control to be selected individually.
94          * @param[in] enable            Set to @c true to enable the individual selection of a control, else @c false
95          * @exception E_SUCCESS         The method is successful.
96          * @exception E_INVALID_ARG     A specified input parameter is invalid.
97          */
98         result SetIndividualSelectionEnabled(const Tizen::Ui::Control* pControl, bool enable);
99
100         /**
101          * Returns whether the individual selection of a control is enabled or not.
102          *
103          * @since 2.0
104          *
105          * @return @c true if the individual selection of a control is enabled, else @c false
106          * @param[in] pControl          The target control.
107          * @exception E_SUCCESS         The method is successful.
108          * @exception E_INVALID_ARG     A specified input parameter is invalid.
109          */
110         bool IsIndividualSelectionEnabled(const Tizen::Ui::Control* pControl);
111
112 protected:
113         //
114         // This class is constructible only as a subobject of a derived class.
115         //
116         // @since 2.0
117         //
118         TableViewItemBase(void);
119
120         //
121         // This class is destructible only as a subobject of a derived class.
122         //
123         // @since 2.0
124         //
125         virtual ~TableViewItemBase(void);
126
127         //
128         // This method is for internal use only. Using this method can cause behavioral, security-related,
129         // and consistency-related issues in the application.
130         //
131         // The following method is reserved, and its name can be changed at any time without prior notice.
132         //
133         // @since 2.0
134         //
135         virtual void TableViewItemBase_Reserved1(void) {}
136
137         //
138         // This method is for internal use only. Using this method can cause behavioral, security-related,
139         // and consistency-related issues in the application.
140         //
141         // The following method is reserved, and its name can be changed at any time without prior notice.
142         //
143         // @since 2.0
144         //
145         virtual void TableViewItemBase_Reserved2(void) {}
146
147         //
148         // This method is for internal use only. Using this method can cause behavioral, security-related,
149         // and consistency-related issues in the application.
150         //
151         // The following method is reserved, and its name can be changed at any time without prior notice.
152         //
153         // @since 2.0
154         //
155         virtual void TableViewItemBase_Reserved3(void) {}
156
157 private:
158         friend class _TableViewItemImpl;
159
160         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
161         TableViewItemBase(const TableViewItemBase& rhs);
162
163         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
164         TableViewItemBase& operator =(const TableViewItemBase& rhs);
165 }; // TableViewItemBase
166
167 }}} // Tizen::Ui::Controls
168
169 #endif  // _FUI_CTRL_TABLE_VIEW_ITEM_BASE_H_