Merge "Unchecked GetCharacter func when index is over string length" into tizen_2.2
[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 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
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0/
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. @n
50         * For full construction, the %Construct() method must be called right after calling this constructor.
51         *
52         * @since 2.0
53         */
54         TableViewItem(void);
55
56         /**
57         * This destructor overrides Tizen::Base::Object::~Object().
58         *
59         * @since 2.0
60         */
61         virtual ~TableViewItem(void);
62
63         /**
64         * Initializes this instance of %TableViewItem with the specified parameter.
65         *
66         * @since 2.0
67         *
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.
73         */
74         result Construct(const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL);
75
76         /**
77         * Initializes this instance of %TableViewItem with the specified parameter.
78         *
79         * @since 2.0
80         *
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.
87         */
88         result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL);
89
90         /**
91         * Initializes this instance of %TableViewItem with the specified parameter.
92         *
93         * @since 2.0
94         *
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.
102         */
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);
104
105         /**
106         * Initializes this instance of %TableViewItem with the specified parameter.
107         *
108         * @since 2.1
109         *
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.
115         */
116         result Construct(const Tizen::Graphics::FloatDimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL);
117
118         /**
119         * Initializes this instance of %TableViewItem with the specified parameter.
120         *
121         * @since 2.1
122         *
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.
129         */
130         result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::FloatDimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL);
131
132         /**
133         * Initializes this instance of %TableViewItem with the specified parameter.
134         *
135         * @since 2.1
136         *
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.
144         */
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);
146
147         /**
148         * Sets context item that is displayed when an item is swept.
149         *
150         * @since 2.0
151         *
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.
156         */
157         void SetContextItem(const TableViewContextItem* pItem);
158
159         /**
160         * Get the width of the annex area.
161         *
162         * @since 2.0
163         *
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.
167         */
168         static int GetAnnexWidth(TableViewAnnexStyle style);
169
170         /**
171         * Get the width of the annex area.
172         *
173         * @since 2.1
174         *
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.
178         */
179         static float GetAnnexWidthF(TableViewAnnexStyle style);
180
181 private:
182         friend class _TableViewItemImpl;
183
184         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
185         TableViewItem(const TableViewItem& rhs);
186
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);
189 }; //TableViewItem
190
191 }}} // Tizen::Ui::Controls
192
193 #endif  // _FUI_CTRL_TABLE_VIEW_ITEM_H_