Merge "Unchecked GetCharacter func when index is over string length" into tizen_2.2
[platform/framework/native/uifw.git] / inc / FUiCtrlTableViewSimpleItem.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 FUiCtrlTableViewSimpleItem.h
20 * @brief This is the header file for the %TableViewSimpleItem class.
21 *
22 * This header file contains the declarations of the %TableViewSimpleItem class and its helper classes.
23 */
24
25 #ifndef _FUI_CTRL_TABLE_VIEW_SIMPLE_ITEM_H_
26 #define _FUI_CTRL_TABLE_VIEW_SIMPLE_ITEM_H_
27
28 #include <FUiCtrlTableViewItem.h>
29
30 namespace Tizen { namespace Ui { namespace Controls
31 {
32 /**
33  * @class   TableViewSimpleItem
34  * @brief   This class defines common behavior for a %TableViewSimpleItem.
35  *
36  * @since 2.0
37  *
38  * The %TableViewSimpleItem class is a class which represents a table view item which has one label and one bitmap.
39  *
40  */
41
42 class _OSP_EXPORT_ TableViewSimpleItem
43         : public TableViewItem
44 {
45 public:
46         /**
47          * The object is not fully constructed after this constructor is called. @n
48          * For full construction, the %Construct() method must be called right after calling this constructor.
49          *
50          * @since 2.0
51          */
52         TableViewSimpleItem(void);
53
54         /**
55          * This destructor overrides Tizen::Base::Object::~Object().
56          *
57          * @since 2.0
58          */
59         virtual ~TableViewSimpleItem(void);
60
61         /**
62          * Initializes this instance of %TableViewSimpleItem with the specified parameter.
63          *
64          * @since 2.0
65          *
66          * @return  An error code
67          * @param[in] itemSize          The size of the item
68          * @param[in] style             The style of Annex
69          * @exception E_SUCCESS         The method is successful.
70          * @exception E_INVALID_ARG     A specified input parameter is invalid.
71          */
72         result Construct(const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL);
73
74         /**
75          * Initializes this instance of TableViewItem with the specified parameter.
76          *
77          * @since 2.0
78          *
79          * @return  An error code
80          * @param[in] layout            The layout for both of the portrait and landscape modes
81          * @param[in] itemSize          The size of the item
82          * @param[in] style             The style of Annex
83          * @exception E_SUCCESS         The method is successful.
84          * @exception E_INVALID_ARG     A specified input parameter is invalid.
85          */
86         result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL);
87
88         /**
89          * Initializes this instance of %TableViewSimpleItem with the specified parameter.
90          *
91          * @since 2.1
92          *
93          * @return  An error code
94          * @param[in] itemSize          The size of the item
95          * @param[in] style             The style of Annex
96          * @exception E_SUCCESS         The method is successful.
97          * @exception E_INVALID_ARG     A specified input parameter is invalid.
98          */
99         result Construct(const Tizen::Graphics::FloatDimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL);
100
101         /**
102          * Initializes this instance of TableViewItem with the specified parameter.
103          *
104          * @since 2.1
105          *
106          * @return  An error code
107          * @param[in] layout            The layout for both of the portrait and landscape modes
108          * @param[in] itemSize          The size of the item
109          * @param[in] style             The style of Annex
110          * @exception E_SUCCESS         The method is successful.
111          * @exception E_INVALID_ARG     A specified input parameter is invalid.
112          */
113         result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::FloatDimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL);
114
115         /**
116          * Sets the text string and bitmap image for %TableViewSimpleItem.
117          *
118          * @since 2.0
119          *
120          * @return An error code
121          * @param[in] text                                         The text string to add
122          * @param[in] pBitmap                         The bitmap image to display
123          * @exception E_SUCCESS                                The method is successful.
124          * @exception E_OUT_OF_MEMORY   The memory is insufficient.
125          */
126         result SetItemContents(const Tizen::Base::String& text, const Tizen::Graphics::Bitmap* pBitmap = null);
127
128         /**
129          * Sets the color of the text.
130          *
131          * @since 2.0
132          *
133          * @return  An error code
134          * @param[in]   color               The text color
135          * @param[in]    status              The item drawing state
136          * @see     GetTextColor()
137          */
138         void SetTextColor(const Tizen::Graphics::Color& color, TableViewItemDrawingStatus status = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL);
139
140         /**
141          * Gets the color of the text.
142          *
143          * @since 2.0
144          *
145          * @return        The text color,
146          * @param[in]    status                                   The item drawing state
147          * @see           SetTextColor()
148          */
149         Tizen::Graphics::Color GetTextColor(TableViewItemDrawingStatus status = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL) const;
150
151         /**
152          * Sets the size of the text.
153          *
154          * @since 2.0
155          *
156          * @return        An error code
157          * @param[in]    size                The size of the text
158          * @exception    E_SUCCESS           The method is successful.
159          * @exception    E_INVALID_ARG       The given text size is less than 1.
160          * @see     GetTextSize()
161          */
162         result SetTextSize(int size);
163
164         /**
165          * Gets the size of the text.
166          *
167          * @since 2.0
168          *
169          * @return  The size of the text,
170          * @see     SetTextSize()
171          */
172         int GetTextSize(void) const;
173
174 private:
175         friend class _TableViewItemImpl;
176
177         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
178         TableViewSimpleItem(const TableViewSimpleItem& rhs);
179
180         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
181         TableViewSimpleItem& operator =(const TableViewSimpleItem& rhs);
182 }; // TableViewSimpleItem
183
184 }}} // Tizen::Ui::Controls
185
186 #endif // _FUI_CTRL_TABLE_VIEW_SIMPLE_ITEM_H_