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