Tizen 2.1 base
[framework/osp/uifw.git] / inc / FUiCtrlTableViewItem.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 FUiCtrlTableViewItem.h
20  * @brief This is the header file for the %TableViewItem class.
21  *
22  * This header file contains the declarations of the %TableViewItem class and its helper classes.
23  */
24
25 #ifndef _FUI_CTRL_TABLE_VIEW_ITEM_H_
26 #define _FUI_CTRL_TABLE_VIEW_ITEM_H_
27
28 #include <FUiCtrlTableViewItemBase.h>
29
30 namespace Tizen { namespace Ui { namespace Controls
31 {
32 class TableViewContextItem;
33
34 /**
35  * @class   TableViewItem
36  * @brief   This class defines common behavior for a %TableViewItem.
37  *
38  * @since 2.0
39  *
40  * The %TableViewItem class is a base class which represents a table view item which is the unit of handling of TableView.
41  *
42  */
43
44 class _OSP_EXPORT_ TableViewItem
45         : public TableViewItemBase
46 {
47 public:
48         /**
49          * The object is not fully constructed after this constructor is called. Hence, the Construct() method must be called after calling this constructor.
50          *
51          * @since 2.0
52          */
53         TableViewItem(void);
54
55         /**
56          * This destructor overrides Tizen::Base::Object::~Object().
57          *
58          * @since 2.0
59          */
60         virtual ~TableViewItem(void);
61
62         /**
63          * Initializes this instance of %TableViewItem with the specified parameter.
64          *
65          * @since 2.0
66          *
67          * @return  An error code
68          * @param[in] itemSize          The size of the item
69          * @param[in] style             The style of Annex
70          * @exception E_SUCCESS         The method is successful.
71          * @exception E_INVALID_ARG     A specified input parameter is invalid.
72          */
73         result Construct(const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL);
74
75         /**
76          * Initializes this instance of %TableViewItem with the specified parameter.
77          *
78          * @since 2.0
79          *
80          * @return  An error code
81          * @param[in] layout            The layout for both of the portrait and landscape modes
82          * @param[in] itemSize          The size of the item
83          * @param[in] style             The style of Annex
84          * @exception E_SUCCESS         The method is successful.
85          * @exception E_INVALID_ARG     A specified input parameter is invalid.
86          */
87         result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL);
88
89         /**
90          * Initializes this instance of %TableViewItem with the specified parameter.
91          *
92          * @since 2.0
93          *
94          * @return  An error code
95          * @param[in] portraitLayout    The layout for portrait mode
96          * @param[in] landscapeLayout   The layout for landscape mode
97          * @param[in] itemSize          The size of the item
98          * @param[in] style             The style of Annex
99          * @exception E_SUCCESS         The method is successful.
100          * @exception E_INVALID_ARG     A specified input parameter is invalid.
101          */
102         result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL);
103
104         /**
105          * Sets context item that is displayed when an item is swept.
106          *
107          * @since 2.0
108          *
109          * @return  An error code
110          * @param[in] pItem             The object of TableViewContextItem
111          * @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.
112          *           pItem must be deleted by applications when it is no longer used.
113          */
114         void SetContextItem(const TableViewContextItem* pItem);
115
116         /**
117          * Get the width of the annex area.
118          *
119          * @since 2.0
120          *
121          * @return  The width of the annex
122          * @param[in] style             The style of the annex
123          * @remarks  The width of the annex area is different among annex styles.
124          */
125         static int GetAnnexWidth(TableViewAnnexStyle style);
126
127 private:
128         friend class _TableViewItemImpl;
129
130         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
131         TableViewItem(const TableViewItem& rhs);
132
133         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
134         TableViewItem& operator =(const TableViewItem& rhs);
135 }; //TableViewItem
136
137 }}} // Tizen::Ui::Controls
138
139 #endif  // _FUI_CTRL_TABLE_VIEW_ITEM_H_