Merge "Unchecked GetCharacter func when index is over string length" into tizen_2.2
[platform/framework/native/uifw.git] / inc / FUiCtrlTabBarItem.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  * @file    FUiCtrlTabBarItem.h
19  * @brief   This is the header file for the %TabBarItem class.
20  *
21  * This header file contains the declarations of the %TabBarItem class.
22  */
23 #ifndef _FUI_CTRL_TAB_BAR_ITEM_H_
24 #define _FUI_CTRL_TAB_BAR_ITEM_H_
25
26 #include <FBaseObject.h>
27
28 namespace Tizen { namespace Ui { namespace Controls
29 {
30 class _TabBarItemImpl;
31 };
32 };
33 };
34
35
36 namespace Tizen { namespace Ui { namespace Controls
37 {
38 /**
39  * @class       TabBarItem
40  * @brief       This class is an implementation of %TabBarItem.
41  *
42  * @since       2.0
43  *
44  * The %TabBarItem class is a helper class that specifies the contents of a tab bar item.
45  *
46  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_tab_bar.htm">TabBar</a>.
47  */
48 class _OSP_EXPORT_ TabBarItem
49         : public Tizen::Base::Object
50 {
51 // Lifecycle
52 public:
53         /**
54          * The object is not fully constructed after this constructor is called. @n
55          * For full construction, the TabBarItem::Construct() method must be called right after calling this constructor.
56          *
57          * @since 2.0
58          */
59         TabBarItem(void);
60
61
62         /**
63          * This destructor overrides Tizen::Base::Object::~Object().
64          *
65          * @since 2.0
66          */
67         virtual ~TabBarItem(void);
68
69
70         /**
71          * Initializes this instance of %TabBarItem with the specified parameters.
72          *
73          * @since               2.0
74          *
75          * @return      An error code
76          * @param[in]   text                The item text
77          * @param[in]   actionId                The action ID of this item
78          * @exception   E_SUCCESS           The method is successful.
79          * @exception   E_INVALID_ARG       A specified input parameter is invalid. @n
80          *                                                                      The @c actionId of the specified item must be greater than or equal to @c 0.
81          */
82         result Construct(const Tizen::Base::String& text, int actionId);
83
84
85 // Operation
86 public:
87         /**
88          * Sets the action ID of the item.
89          *
90          * @since               2.0
91          *
92          * @return      An error code
93          * @param[in]   actionId                    The action ID for this item
94          * @exception   E_SUCCESS           The method is successful.
95          * @exception   E_INVALID_ARG       The specified input parameter is invalid. @n
96          *                                                                      The @c actionId of the specified item must be a positive integer.
97          * @exception   E_INVALID_STATE     This instance is in an invalid state.
98          */
99         result SetActionId(int actionId);
100
101
102         /**
103          * Gets the action ID of the item.
104          *
105          * @since               2.0
106          *
107          * @return      The action ID, @n
108          *                              else @c -1 if an error occurs
109          * @exception   E_SUCCESS                       The method is successful.
110          * @exception   E_INVALID_STATE         This instance is in an invalid state.
111          * @remarks     The specific error code can be accessed using the GetLastResult() method.
112          */
113         int GetActionId(void) const;
114
115
116         /**
117          * Gets the text of the item.
118          *
119          * @since               2.0
120          *
121          * @return              The item text, @n
122          *                              else an empty string if an error occurs
123          * @exception   E_SUCCESS           The method is successful.
124          * @exception   E_INVALID_STATE     This instance is in an invalid state.
125          * @remarks     The specific error code can be accessed using the GetLastResult() method.
126          */
127         Tizen::Base::String GetText(void) const;
128
129
130         /**
131          * Sets the text of the item.
132          *
133          * @since       2.0
134          *
135          * @return              An error code
136          * @param[in]   text                    The text to set
137          * @exception   E_SUCCESS           The method is successful.
138          * @exception   E_INVALID_STATE     This instance is in an invalid state.
139          * @remarks             If the size of the text exceeds the displayable area, the font size of the text is decreased automatically.
140          */
141         result SetText(const Tizen::Base::String& text);
142
143
144 private:
145         friend class TabBar;
146
147         //
148         //This method is for internal use only. Using this method can cause behavioral, security-related,
149         //and consistency-related issues in the application.
150         //
151         _TabBarItemImpl* __pTabBarItemImpl;
152
153         //
154         // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
155         //
156         TabBarItem(const TabBarItem& rhs);
157
158         //
159         // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
160         //
161         TabBarItem& operator =(const TabBarItem& rhs);
162
163 }; // TabBarItem
164
165 }}} // Tizen::Ui: Control
166
167 #endif //_FUI_CTRL_TAB_BAR_ITEM_H_