Merge "Fix Ime Rotation" into tizen_2.1
[platform/framework/native/uifw.git] / inc / FUiCtrlFooterItem.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        FUiCtrlFooterItem.h
20  * @brief       This is the header file for the %FooterItem class.
21  *
22  * This header file contains the declarations of the %FooterItem class.
23  */
24 #ifndef _FUI_CTRL_FOOTER_ITEM_H_
25 #define _FUI_CTRL_FOOTER_ITEM_H_
26
27 #include <FBaseObject.h>
28 #include <FBaseString.h>
29 #include <FBaseTypes.h>
30 #include <FGrpBitmap.h>
31
32 namespace Tizen { namespace Ui { namespace Controls
33 {
34 /**
35  * @enum        FooterItemStatus
36  *
37  * Defines the possible status of %FooterItem.
38  *
39  * @since       2.0
40  */
41 enum FooterItemStatus
42 {
43         FOOTER_ITEM_STATUS_NORMAL,      /**< The normal state */
44         FOOTER_ITEM_STATUS_PRESSED,     /**< The pressed state */
45         FOOTER_ITEM_STATUS_SELECTED,    /**< The selected state */
46         FOOTER_ITEM_STATUS_HIGHLIGHTED, /**< The highlighted state */
47         FOOTER_ITEM_STATUS_DISABLED             /**< The disabled state */
48 };
49
50 /**
51  * @class       FooterItem
52  * @brief       This class is an implementation of %FooterItem.
53  *
54  * @since       2.0
55  *
56  * The %FooterItem class is a helper class that specifies the contents of the footer item.
57  *
58  *For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_footer.htm">Footer</a>.
59  */
60 class _OSP_EXPORT_ FooterItem
61         : public Tizen::Base::Object
62 {
63 public:
64         /**
65          * This is the default constructor for this class.
66          *
67          * @since               2.0
68          */
69         FooterItem(void);
70
71
72         /**
73          * This is the destructor for this class.
74          *
75          * @since               2.0
76          */
77         virtual ~FooterItem(void);
78
79
80         /**
81          * Initializes this instance of %FooterItem with the specified parameter.
82          *
83          * @since               2.0
84          *
85          * @return      An error code
86          * @param[in]   actionId            The action ID of this item
87          * @exception   E_SUCCESS       The method is successful.
88          * @exception   E_INVALID_ARG   The specified input parameter is invalid. @n
89          *                                                              The specified @c actionId of the specified item must be a positive integer.
90          */
91         result Construct(int actionId);
92
93
94         /**
95          * Gets the action ID of the item.
96          *
97          * @since               2.0
98          *
99          * @return      The action ID, @n
100          *                              else @c -1 if an error occurs
101          * @exception   E_SUCCESS           The method is successful.
102          * @remarks     The specific error code can be accessed using the GetLastResult() method.
103          */
104         int GetActionId(void) const;
105
106
107         /**
108          * Gets the text of the footer item.
109          *
110          * @since               2.0
111          *
112          * @return          The item text, @n
113          *                              else an empty string if an error occurs
114          * @exception   E_SUCCESS           The method is successful.
115          * @remarks     The specific error code can be accessed using the GetLastResult() method.
116          */
117         Tizen::Base::String GetText(void) const;
118
119
120         /**
121          * Sets the action ID of the footer item.
122          *
123          * @since               2.0
124          *
125          * @return      An error code
126          * @param[in]   actionId                The specified action ID of the footer item
127          * @exception   E_SUCCESS       The method is successful.
128          * @exception   E_INVALID_ARG   The specified input parameter is invalid. @n
129          *                                                              The specified @c actionId of the specified item must be a positive integer.
130          */
131         result SetActionId(int actionId);
132
133
134         /**
135          * Sets the background bitmap of the footer item.
136          *
137          * @since               2.0
138          *
139          * @return      An error code
140          * @param[in]   status              The status of the footer item
141          * @param[in]   pBitmap             The background bitmap to set, @n
142          *                                  else @c null if no bitmap is displayed.
143          * @exception   E_SUCCESS           The method is successful.
144          * @remarks     If the size of the bitmap is greater than the size of the item, the bitmap is scaled down.
145          */
146         result SetBackgroundBitmap(FooterItemStatus status, const Tizen::Graphics::Bitmap* pBitmap);
147
148
149         /**
150          * Sets the icon of the footer item.
151          *
152          * @since               2.0
153          *
154          * @return      An error code
155          * @param[in]   status              The status of the footer item
156          * @param[in]   pIcon               The icon to set, @n
157          *                                              else @c null if no bitmap is displayed
158          * @exception   E_SUCCESS           The method is successful.
159          * @remarks     If the size of the bitmap is greater than the default icon size, the bitmap is scaled down. @n
160          *              The bitmap specified for the @c FOOTER_ITEM_STATUS_NORMAL will be applied for all other statues unless different bitmaps are explicitly
161          *                              set for those by using this method. @n
162          *              Furthermore, the icon button does not support @c FOOTER_ITEM_STATUS_SELECTED status and the bitmap for the status is also ignored.
163          */
164         result SetIcon(FooterItemStatus status, const Tizen::Graphics::Bitmap* pIcon);
165
166
167         /**
168          * Sets the text of the footer item.
169          *
170          * @since               2.0
171          *
172          * @return          An error code
173          * @param[in]   text                    The text to set
174          * @exception   E_SUCCESS           The method is successful.
175          * @remarks         If the text cannot be displayed in a line, then the text is automatically displayed in two lines and the ellipsis is applied if the text
176          *                              is longer than two lines. @n
177          *                              Use @htmlonly '\n' @endhtmlonly to denote the end of the first line.
178          */
179         result SetText(const Tizen::Base::String& text);
180
181
182 private:
183         FooterItem(const FooterItem& footerItem);
184         FooterItem& operator =(const FooterItem& footerItem);
185
186 private:
187         friend class _FooterImpl;
188         friend class _FooterItemImpl;
189
190         class _FooterItemImpl* __pImpl;
191 };
192
193 }}} // Tizen::Ui::Controls
194
195 #endif // _FUI_CTRL_FOOTER_ITEM_H_