Merge "Fix Ime Rotation" into tizen_2.1
[platform/framework/native/uifw.git] / inc / FUiCustomControlBase.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        FUiCustomControlBase.h
20  * @brief       This is the header file for the %CustomControlBase class.
21  *
22  * This header file contains the declarations of the %CustomControlBase class and its helper classes.
23  */
24
25 #ifndef _FUI_CUSTOM_CONTROL_BASE_H_
26 #define _FUI_CUSTOM_CONTROL_BASE_H_
27
28 #include <FUiContainer.h>
29
30 namespace Tizen { namespace Ui
31 {
32
33 class _CustomControlBaseImpl;
34
35 /**
36  * @if OSPDEPREC
37  * @class   CustomControlBase
38  * @brief   <i> [Deprecated] </i> This is the base class for the user-defined UI control classes.
39  *
40  * @deprecated  This class is deprecated. Instead of using this class, use the Container class.
41  * @since   2.0
42  *
43  * The %CustomControlBase class is the base class for the user-defined UI control classes.
44  * @n
45  * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/implementing_customcontrolbase.htm">CustomControlBase</a>.
46  * @endif
47  */
48 class _OSP_EXPORT_ CustomControlBase
49         : public Container
50 {
51 // Lifecycle
52 public:
53         /**
54          * @if OSPDEPREC
55          * This destructor overrides Tizen::Base::Object::~Object().
56          *
57          * @brief               <i> [Deprecated] </i>
58          * @deprecated  This class is deprecated. Instead of using this class, use the Container class.
59          * @since   2.0
60          * @endif
61          */
62         virtual ~CustomControlBase(void);
63
64         /**
65          * @if OSPDEPREC
66          * Notifies that the bounds of the control is about to change.
67          *
68          * @brief               <i> [Deprecated] </i>
69          * @deprecated  This class is deprecated. Instead of using this class, use the Container class.
70          * @since       2.0
71          *
72          * @return      An error code
73          * @param[in]   oldRect  The old position and size values of the control
74          * @param[in]   newRect  The new position and size values of the control
75          * @remarks     If the method returns an exception, the resulting exception
76          *              is propagated and the control's size is unchanged. @n
77          *              Provide control specific exceptions.
78          * @see         Tizen::Ui::Control::SetBounds()
79          * @see         Tizen::Ui::Control::SetSize()
80          * @endif
81          */
82         virtual result PrepareBoundsChange(const Tizen::Graphics::Rectangle& oldRect, const Tizen::Graphics::Rectangle& newRect);
83
84         /**
85          * @if OSPDEPREC
86          * Overrides this method to indicate that the specified @c width and @c height
87          * can be supported or a new @c width and @c height must be applied instead
88          * of the specified values.
89          *
90          * @brief               <i> [Deprecated] </i>
91          * @deprecated  This class is deprecated. Instead of using this class, use the Container class.
92          * @since           2.0
93          *
94          * @return          A Boolean flag that indicates whether the specified @c width
95          *                  and @ height are supported
96          * @param[in, out]  width   The width that needs to  evaluate
97          * @param[in, out]  height  The height that needs to evaluate
98          * @endif
99          */
100         virtual bool EvaluateSize(int& width, int& height);
101
102 protected:
103         /**
104          * @if OSPDEPREC
105          * The object is not fully constructed after this constructor is called. For full construction, one of the %Construct() method must be called right after calling this constructor.
106          *
107          * @brief               <i> [Deprecated] </i>
108          * @deprecated  This class is deprecated. Instead of using this class, use the Container class.
109          * @since       2.0
110          * @endif
111          */
112         CustomControlBase(void);
113
114         /**
115          * @if OSPDEPREC
116          * Initializes this instance of %CustomControlBase.
117          *
118          * @brief               <i> [Deprecated] </i>
119          * @deprecated  This class is deprecated. Instead of using this class, use the Container class.
120          * @since       2.0
121          *
122          * @return      An error code
123          * @param[in]   rect                            The rectangle bounds to set
124          * @param[in]   resizable                       Set to @c true to make the control resizable, @n
125          *                                  else @c false
126          * @param[in]   movable                         Set to @c true to make the control movable, @n
127          *                                  else @c false
128          * @exception   E_SUCCESS           The method is successful.
129          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
130          * @exception   E_SYSTEM            A system error has occurred.
131          * @remarks     This method must be called from the derived classes's construct methods.
132          * @remarks     If the @c resizable is @c false, IsResizable() returns @c false.
133          * @see IsResizable()
134          * @endif
135          */
136         result Construct(const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true);
137
138         /**
139          * @if OSPDEPREC
140          * Initializes this instance of %CustomControlBase with the specified layout and rectangular region.
141          *
142          * @brief               <i> [Deprecated] </i>
143          * @deprecated  This class is deprecated. Instead of using this class, use the Container class.
144          * @since               2.0
145          *
146          * @return              An error code
147          * @param[in]   layout                          The layout for both the portrait and landscape mode
148          * @param[in]   rect                            The location and size of the %CustomControlBase
149          * @param[in]   resizable                       Set to @c true to make the control resizable, @n
150          *                                  else @c false
151          * @param[in]   movable                         Set to @c true to make the control movable, @n
152          *                                  else @c false
153          * @exception   E_SUCCESS               The method is successful.
154          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
155          * @exception   E_SYSTEM                A system error has occurred.
156          * @remarks     This method must be called from the derived classes's construct methods.
157          * @remarks     If the @c resizable is @c false, IsResizable() returns @c false.
158          * @see IsResizable()
159          * @see Tizen::Ui::Layout
160          * @see Tizen::Ui::Container::GetLayoutN()
161          * @endif
162          */
163         result Construct(const Tizen::Ui::Layout& layout, const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true);
164
165         /**
166          * @if OSPDEPREC
167          * Initializes this instance of %CustomControlBase with the specified layouts and rectangular region.
168          *
169          * @brief               <i> [Deprecated] </i>
170          * @deprecated  This class is deprecated. Instead of using this class, use the Container class.
171          * @since               2.0
172          *
173          * @return              An error code
174          * @param[in]   portraitLayout          The layout for the portrait mode
175          * @param[in]   landscapeLayout         The layout for the landscape mode
176          * @param[in]   rect                            The location and size of the %CustomControlBase
177          * @param[in]   resizable                       Set to @c true to make the control resizable, @n
178          *                                  else @c false
179          * @param[in]   movable                         Set to @c true to make the control movable, @n
180          *                                  else @c false
181          * @exception   E_SUCCESS               The method is successful.
182          * @exception   E_INVALID_ARG           A specified input parameter is invalid.
183          * @exception   E_SYSTEM                A system error has occurred.
184          * @remarks     If the @c resizable is @c false, IsResizable() returns @c false.
185          * @see IsResizable()
186          * @see Tizen::Ui::Layout
187          * @see Tizen::Ui::Container::GetLayoutN()
188          * @see Tizen::Ui::Container::GetPortraitLayoutN()
189          * @see Tizen::Ui::Container::GetLandscapeLayoutN()
190          * @endif
191          */
192         result Construct(const Tizen::Ui::Layout& portraitLayout, const Tizen::Ui::Layout& landscapeLayout, const Tizen::Graphics::Rectangle& rect, bool resizable = true, bool movable = true);
193
194 private:
195         /**
196          * @if OSPDEPREC
197          * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
198          *
199          * @brief               <i> [Deprecated] </i>
200          * @deprecated  This class is deprecated. Instead of using this class, use the Container class.
201          * @since       2.0
202          * @endif
203          */
204         CustomControlBase(const CustomControlBase& rhs);
205
206         /**
207          * @if OSPDEPREC
208          * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
209          *
210          * @brief               <i> [Deprecated] </i>
211          * @deprecated  This class is deprecated. Instead of using this class, use the Container class.
212          * @since       2.0
213          * @endif
214          */
215         CustomControlBase& operator =(const CustomControlBase& rhs);
216
217 protected:
218         friend class _CustomControlBaseImpl;
219
220         //
221         // This method is for internal use only.
222         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
223         //
224         // This method is reserved and may change its name at any time without prior notice.
225         //
226         virtual void CustomControlBase_Reserved1(void) {}
227
228         //
229         // This method is for internal use only.
230         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
231         //
232         // This method is reserved and may change its name at any time without prior notice.
233         //
234         virtual void CustomControlBase_Reserved2(void) {}
235
236         //
237         // This method is for internal use only.
238         // Using this method can cause behavioral, security-related, and consistency-related issues in the application.
239         //
240         // This method is reserved and may change its name at any time without prior notice.
241         //
242         virtual void CustomControlBase_Reserved3(void) {}
243 }; // CustomControlBase
244
245 }} // Tizen::Ui
246
247 #endif // _FUI_CUSTOM_CONTROL_BASE_H_