Tizen 2.1 base
[framework/osp/uifw.git] / inc / FUiCtrlTableViewSimpleItem.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 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. Hence, the Construct() method must be called after calling this constructor.
48          *
49          * @since 2.0
50          */
51         TableViewSimpleItem(void);
52
53         /**
54          * This destructor overrides Tizen::Base::Object::~Object().
55          *
56          * @since 2.0
57          */
58         virtual ~TableViewSimpleItem(void);
59
60         /**
61          * Initializes this instance of %TableViewSimpleItem with the specified parameter.
62          *
63          * @since 2.0
64          *
65          * @return  An error code
66          * @param[in] itemSize          The size of the item
67          * @param[in] style             The style of Annex
68          * @exception E_SUCCESS         The method is successful.
69          * @exception E_INVALID_ARG     A specified input parameter is invalid.
70          */
71         result Construct(const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL);
72
73         /**
74          * Initializes this instance of TableViewItem with the specified parameter.
75          *
76          * @since 2.0
77          *
78          * @return  An error code
79          * @param[in] layout            The layout for both of the portrait and landscape modes
80          * @param[in] itemSize          The size of the item
81          * @param[in] style             The style of Annex
82          * @exception E_SUCCESS         The method is successful.
83          * @exception E_INVALID_ARG     A specified input parameter is invalid.
84          */
85         result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Dimension& itemSize, TableViewAnnexStyle style = TABLE_VIEW_ANNEX_STYLE_NORMAL);
86
87         /**
88          * Sets the text string and bitmap image for %TableViewSimpleItem.
89          *
90          * @since 2.0
91          *
92          * @return An error code
93          * @param[in] text                                         The text string to be added
94          * @param[in] pBitmap                         The bitmap image to be displayed
95          * @exception E_SUCCESS                                The method is successful.
96          * @exception E_OUT_OF_MEMORY   The memory is insufficient.
97          */
98         result SetItemContents(const Tizen::Base::String& text, const Tizen::Graphics::Bitmap* pBitmap = null);
99
100         /**
101          * Sets the color of the text.
102          *
103          * @since 2.0
104          *
105          * @return  An error code
106          * @param[in]   color               The text color
107          * @param[in]    status              The item drawing state
108          * @see     GetTextColor()
109          */
110         void SetTextColor(const Tizen::Graphics::Color& color, TableViewItemDrawingStatus status = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL);
111
112         /**
113          * Gets the color of the text.
114          *
115          * @since 2.0
116          *
117          * @return        The text color,
118          * @param[in]    status                                   The item drawing state
119          * @see           SetTextColor()
120          */
121         Tizen::Graphics::Color GetTextColor(TableViewItemDrawingStatus status = TABLE_VIEW_ITEM_DRAWING_STATUS_NORMAL) const;
122
123         /**
124          * Sets the size of the text.
125          *
126          * @since 2.0
127          *
128          * @return        An error code
129          * @param[in]    size                The size of the text
130          * @exception    E_SUCCESS           The method is successful.
131          * @exception    E_INVALID_ARG       The given text size is less than 1.
132          * @see     GetTextSize()
133          */
134         result SetTextSize(int size);
135
136         /**
137          * Gets the size of the text.
138          *
139          * @since 2.0
140          *
141          * @return  The size of the text,
142          * @see     SetTextSize()
143          */
144         int GetTextSize(void) const;
145
146 private:
147         friend class _TableViewItemImpl;
148
149         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
150         TableViewSimpleItem(const TableViewSimpleItem& rhs);
151
152         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
153         TableViewSimpleItem& operator =(const TableViewSimpleItem& rhs);
154 }; // TableViewSimpleItem
155
156 }}} // Tizen::Ui::Controls
157
158 #endif // _FUI_CTRL_TABLE_VIEW_SIMPLE_ITEM_H_