Fix to adjust the position of the partial Frame
[platform/framework/native/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         * Initializes this instance of %TableViewItem with the specified parameter.
106         *
107         * @since 2.1
108         *
109         * @return  An error code
110         * @param[in] itemSize          The size of the item
111         * @param[in] style             The style of Annex
112         * @exception E_SUCCESS         The method is successful.
113         * @exception E_INVALID_ARG     A specified input parameter is invalid.
114         */
115         result Construct(const Tizen::Graphics::FloatDimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL);
116
117         /**
118         * Initializes this instance of %TableViewItem with the specified parameter.
119         *
120         * @since 2.1
121         *
122         * @return  An error code
123         * @param[in] layout            The layout for both of the portrait and landscape modes
124         * @param[in] itemSize          The size of the item
125         * @param[in] style             The style of Annex
126         * @exception E_SUCCESS         The method is successful.
127         * @exception E_INVALID_ARG     A specified input parameter is invalid.
128         */
129         result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::FloatDimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL);
130
131         /**
132         * Initializes this instance of %TableViewItem with the specified parameter.
133         *
134         * @since 2.1
135         *
136         * @return  An error code
137         * @param[in] portraitLayout    The layout for portrait mode
138         * @param[in] landscapeLayout   The layout for landscape mode
139         * @param[in] itemSize          The size of the item
140         * @param[in] style             The style of Annex
141         * @exception E_SUCCESS         The method is successful.
142         * @exception E_INVALID_ARG     A specified input parameter is invalid.
143         */
144         result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::FloatDimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL);
145
146         /**
147         * Sets context item that is displayed when an item is swept.
148         *
149         * @since 2.0
150         *
151         * @return  An error code
152         * @param[in] pItem             The object of TableViewContextItem
153         * @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.
154         *           pItem must be deleted by applications when it is no longer used.
155         */
156         void SetContextItem(const TableViewContextItem* pItem);
157
158         /**
159         * Get the width of the annex area.
160         *
161         * @since 2.0
162         *
163         * @return  The width of the annex
164         * @param[in] style             The style of the annex
165         * @remarks  The width of the annex area is different among annex styles.
166         */
167         static int GetAnnexWidth(TableViewAnnexStyle style);
168
169         /**
170         * Get the width of the annex area.
171         *
172         * @since 2.1
173         *
174         * @return  The width of the annex
175         * @param[in] style             The style of the annex
176         * @remarks  The width of the annex area is different among annex styles.
177         */
178         static float GetAnnexWidthF(TableViewAnnexStyle style);
179
180 private:
181         friend class _TableViewItemImpl;
182
183         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
184         TableViewItem(const TableViewItem& rhs);
185
186         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
187         TableViewItem& operator =(const TableViewItem& rhs);
188 }; //TableViewItem
189
190 }}} // Tizen::Ui::Controls
191
192 #endif  // _FUI_CTRL_TABLE_VIEW_ITEM_H_