2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.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://www.apache.org/licenses/LICENSE-2.0/
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 FUiCtrlTableViewItem.h
20 * @brief This is the header file for the %TableViewItem class.
22 * This header file contains the declarations of the %TableViewItem class and its helper classes.
25 #ifndef _FUI_CTRL_TABLE_VIEW_ITEM_H_
26 #define _FUI_CTRL_TABLE_VIEW_ITEM_H_
28 #include <FUiCtrlTableViewItemBase.h>
30 namespace Tizen { namespace Ui { namespace Controls
32 class TableViewContextItem;
35 * @class TableViewItem
36 * @brief This class defines common behavior for a %TableViewItem.
40 * The %TableViewItem class is a base class which represents a table view item which is the unit of handling of TableView.
44 class _OSP_EXPORT_ TableViewItem
45 : public TableViewItemBase
49 * The object is not fully constructed after this constructor is called. @n
50 * For full construction, the %Construct() method must be called right after calling this constructor.
57 * This destructor overrides Tizen::Base::Object::~Object().
61 virtual ~TableViewItem(void);
64 * Initializes this instance of %TableViewItem with the specified parameter.
68 * @return An error code
69 * @param[in] itemSize The size of the item
70 * @param[in] style The style of Annex
71 * @exception E_SUCCESS The method is successful.
72 * @exception E_INVALID_ARG A specified input parameter is invalid.
74 result Construct(const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL);
77 * Initializes this instance of %TableViewItem with the specified parameter.
81 * @return An error code
82 * @param[in] layout The layout for both of the portrait and landscape modes
83 * @param[in] itemSize The size of the item
84 * @param[in] style The style of Annex
85 * @exception E_SUCCESS The method is successful.
86 * @exception E_INVALID_ARG A specified input parameter is invalid.
88 result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL);
91 * Initializes this instance of %TableViewItem with the specified parameter.
95 * @return An error code
96 * @param[in] portraitLayout The layout for portrait mode
97 * @param[in] landscapeLayout The layout for landscape mode
98 * @param[in] itemSize The size of the item
99 * @param[in] style The style of Annex
100 * @exception E_SUCCESS The method is successful.
101 * @exception E_INVALID_ARG A specified input parameter is invalid.
103 result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL);
106 * Initializes this instance of %TableViewItem with the specified parameter.
110 * @return An error code
111 * @param[in] itemSize The size of the item
112 * @param[in] style The style of Annex
113 * @exception E_SUCCESS The method is successful.
114 * @exception E_INVALID_ARG A specified input parameter is invalid.
116 result Construct(const Tizen::Graphics::FloatDimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL);
119 * Initializes this instance of %TableViewItem with the specified parameter.
123 * @return An error code
124 * @param[in] layout The layout for both of the portrait and landscape modes
125 * @param[in] itemSize The size of the item
126 * @param[in] style The style of Annex
127 * @exception E_SUCCESS The method is successful.
128 * @exception E_INVALID_ARG A specified input parameter is invalid.
130 result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::FloatDimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL);
133 * Initializes this instance of %TableViewItem with the specified parameter.
137 * @return An error code
138 * @param[in] portraitLayout The layout for portrait mode
139 * @param[in] landscapeLayout The layout for landscape mode
140 * @param[in] itemSize The size of the item
141 * @param[in] style The style of Annex
142 * @exception E_SUCCESS The method is successful.
143 * @exception E_INVALID_ARG A specified input parameter is invalid.
145 result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::FloatDimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL);
148 * Sets context item that is displayed when an item is swept.
152 * @return An error code
153 * @param[in] pItem The object of TableViewContextItem
154 * @remarks If context item is not set, TableView() does not display context item and an item sweep event is generated when an item is swept.
155 * pItem must be deleted by applications when it is no longer used.
157 void SetContextItem(const TableViewContextItem* pItem);
160 * Get the width of the annex area.
164 * @return The width of the annex
165 * @param[in] style The style of the annex
166 * @remarks The width of the annex area is different among annex styles.
168 static int GetAnnexWidth(TableViewAnnexStyle style);
171 * Get the width of the annex area.
175 * @return The width of the annex
176 * @param[in] style The style of the annex
177 * @remarks The width of the annex area is different among annex styles.
179 static float GetAnnexWidthF(TableViewAnnexStyle style);
182 friend class _TableViewItemImpl;
184 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
185 TableViewItem(const TableViewItem& rhs);
187 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
188 TableViewItem& operator =(const TableViewItem& rhs);
191 }}} // Tizen::Ui::Controls
193 #endif // _FUI_CTRL_TABLE_VIEW_ITEM_H_