2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://www.apache.org/licenses/LICENSE-2.0/
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.
20 * @brief This is the header file for the %Control class.
22 * This header file contains the declarations of the %Control class.
25 #ifndef _FUI_CONTROL_H_
26 #define _FUI_CONTROL_H_
28 #include <FBaseTypes.h>
29 #include <FBaseString.h>
30 #include <FGrpCanvas.h>
31 #include <FGrpColor.h>
32 #include <FGrpPoint.h>
33 #include <FGrpRectangle.h>
34 #include <FUiIFocusEventListener.h>
35 #include <FUiIKeyEventListener.h>
36 #include <FUiITouchEventListener.h>
37 #include <FUiITouchModeChangedEventListener.h>
38 #include <FUiIDragDropEventListener.h>
39 #include <FUiIDragDropEventListenerF.h>
40 #include <FUiCompositeMode.h>
41 #include <FUiIPropagatedKeyEventListener.h>
42 #include <FUiIPropagatedTouchEventListener.h>
44 namespace Tizen { namespace Ui { namespace Animations {
45 class ControlAnimator;
49 namespace Tizen { namespace Ui {
51 class AccessibilityContainer;
54 class TouchGestureDetector;
58 * @brief This class is the abstract base class of all the UI control classes.
62 * @remarks In order for a control to be displayed, it must first be bound to a window of the underlying window system. The control's window is
63 * created when it (or its ancestor) is added to a valid control containment hierarchy. A containment hierarchy is valid if and
64 * only if the root of the hierarchy is an instance of the Window class.
66 * The %Control class is the abstract base class of all user interface elements. It encapsulates a
67 * "window" of the underlying window system, and provides the infrastructure necessary for the
68 * elements to respond to user inputs. The %Control class also determines how a key event is dispatched
71 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/ui/controls.htm">UI Controls</a>.
74 * The following examples demonstrate how to use the %Control class.
80 * pControl->SetSize(100, 100); // 100 pixels wide and 100 pixels long
82 * // Sets the position
83 * pControl->SetPosition(5, 5); // Control is drawn 5 pixels down and 5 pixels left from the top-left corner of its parent
89 * // Gets a instance of Canvas
90 * Canvas* pCanvas = pControl->GetCanvasN();
92 * // Fills the canvas with white color
93 * pCanvas->Clear(Tizen::Graphics::Color(255, 255, 255));
95 * // Shows changes on screen
96 * pControl->Invalidate(true);
101 * Key and input focus
104 * // Implements MyKeyEventListener
105 * IKeyEventListener* pKeyListener = new MyKeyEventListener();
106 * pControl->SetFocus();
108 * // The added key listener should be deleted after use
109 * pControl->AddKeyEventListener(*pKeyListener);
113 class _OSP_EXPORT_ Control
114 : public Tizen::Base::Object
119 * This destructor overrides Tizen::Base::Object::~Object().
123 virtual ~Control(void);
126 * Adds the IFocusEventListener instance to the %Control instance. @n
127 * The added listener gets notified when the control gains or loses its focus.
131 * @param[in] listener The event listener to add
132 * @see RemoveFocusEventListener()
134 void AddFocusEventListener(IFocusEventListener& listener);
137 * Adds the IKeyEventListener instance to the %Control instance. @n
138 * The added listener gets notified when a key is pressed, released, or long pressed.
142 * @param[in] listener The event listener to add
143 * @see RemoveKeyEventListener()
145 void AddKeyEventListener(IKeyEventListener& listener);
148 * Adds the ITouchEventListener instance to the %Control instance. @n
149 * The added listener gets notified when a touch event such as a press or a release is fired.
153 * @param[in] listener The event listener to add
154 * @see RemoveTouchEventListener()
156 void AddTouchEventListener(ITouchEventListener& listener);
159 * Adds the ITouchModeChangedEventListener instance to the %Control instance. @n
160 * The added listener gets notified when the device's touch mode is changed.
164 * @param[in] listener The event listener to add
165 * @see RemoveTouchModeChangedEventListener()
167 void AddTouchModeChangedEventListener(Tizen::Ui::ITouchModeChangedEventListener& listener);
170 * Adds the IDragDropEventListener instance to the %Control instance. @n
171 * The added listener gets notified when a drag or a drop happens in the control.
175 * @param[in] listener The event listener to add
176 * @see RemoveDragDropEventListener()
178 void AddDragDropEventListener(IDragDropEventListener& listener);
181 * Adds the IDragDropEventListenerF instance to the %Control instance. @n
182 * The added listener gets notified when a drag or a drop happens in the control.
186 * @param[in] listener The event listener to add
187 * @see RemoveDragDropEventListenerF()
189 void AddDragDropEventListener(IDragDropEventListenerF& listener);
192 * Removes the focus listener instance. @n
193 * The removed listener is not notified even when focus events are fired.
197 * @param[in] listener The listener to remove
198 * @see AddFocusEventListener()
200 void RemoveFocusEventListener(IFocusEventListener& listener);
203 * Removes the key event listener instance. @n
204 * The removed listener is not notified even when key events are fired.
208 * @param[in] listener The listener to remove
209 * @see AddKeyEventListener()
211 void RemoveKeyEventListener(IKeyEventListener& listener);
214 * Removes the touch event listener instance. @n
215 * The removed listener is not notified even when touch events are fired.
219 * @param[in] listener The listener to remove
220 * @see AddTouchEventListener()
222 void RemoveTouchEventListener(ITouchEventListener& listener);
225 * Removes the touch mode changed event listener instance. @n
226 * The removed listener is not notified even when the touch mode changed events are fired.
230 * @param[in] listener The listener to remove
231 * @see AddTouchModeChangedEventListener()
233 void RemoveTouchModeChangedEventListener(Tizen::Ui::ITouchModeChangedEventListener& listener);
236 * Adds the IDragDropEventListener instance to the %Control instance. @n
237 * The added listener gets notified when a drag or a drop happens in the control.
241 * @param[in] listener The event listener to add
242 * @see Tizen::Ui::IDragDropEventListener::OnTouchDragged()
243 * @see Tizen::Ui::IDragDropEventListener::OnTouchDropped()
244 * @see RemoveDragDropEventListener()
246 void RemoveDragDropEventListener(IDragDropEventListener& listener);
249 * Adds the IDragDropEventListenerF instance to the %Control instance. @n
250 * The added listener gets notified when a drag or a drop happens in the control.
254 * @param[in] listener The event listener to add
255 * @see Tizen::Ui::IDragDropEventListenerF::OnTouchDraggedF()
256 * @see Tizen::Ui::IDragDropEventListenerF::OnTouchDroppedF()
257 * @see RemoveDragDropEventListenerF()
259 void RemoveDragDropEventListenerF(IDragDropEventListenerF& listener);
262 * Overrides this method to provide user-specific initialization code before the control is added to a container.
266 * @return An error code
267 * @exception E_SUCCESS The method is successful.
268 * @exception E_FAILURE The method has failed.
269 * @remarks This method is called when the control is about to be added to a container.
270 * @remarks To cancel adding this control to the parent, return @c E_FAILURE in this method.
271 * @see OnTerminating()
273 virtual result OnInitializing(void);
276 * Overrides this method to provide user-specific termination code.
279 * @brief <i> [Compatibility] </i>
284 * @compatibility This method has compatibility issues with OSP compatible applications. @n
285 * For more information, see @ref CompOnTerminatingPage "here".
287 * @return An error code
288 * @exception E_SUCCESS The method is successful.
289 * @exception E_FAILURE The method has failed.
291 * - This method is called right before the control is removed from the container, or Destroy() method is called.
292 * - To cancel the removal or Destroy() operation, return any exception other than @c E_SUCCESS.
293 * @see OnInitializing()
295 virtual result OnTerminating(void);
299 * @page CompOnTerminatingPage Compatibility for OnTerminating()
300 * @section CompOnterminatingPageIssueSection Issues
301 * Implementation of this method in %Tizen API versions prior to 2.1 has the following issue: @n
302 * -# OnTerminating() callback is called from child to parent.
304 * @section CompOnTerminatingPageSolutionSection Resolutions
305 * The issue mentioned above is resolved in %Tizen API version 2.1 as follows: @n
306 * -# OnTerminating() callback is called from parent to child.
311 * Called asynchronously when the user event that is sent by SendUserEvent() method is
312 * dispatched to the control.
316 * @param[in] requestId The user-defined event ID
317 * @param[in] pArgs A pointer to the argument list
318 * @see SendUserEvent()
320 virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
323 * Deallocates this instance after removing all child controls of this control.
327 * @exception E_SUCCESS The method is successful.
328 * @remarks The control is deleted from memory. Before it is deleted, OnTerminating() is called if it is attached to the main tree.
329 * @remarks If OnTerminating() method is overridden and returns an exception, that exception is propagated.
330 * @see Tizen::Ui::Control:OnTerminating()
332 result Destroy(void);
335 * Checks whether the control is movable.
339 * @return @c true if the control is movable, @n
341 * @exception E_SUCCESS The method is successful.
342 * @remarks The specific error code can be accessed using the GetLastResult() method.
343 * @remarks When control is not movable SetPosition() and SetBounds() return @c E_UNSUPPORTED_OPERATION.
347 bool IsMovable(void) const;
350 * Checks whether the control is resizable.
354 * @return @c true if the control is resizable, @n
356 * @exception E_SUCCESS The method is successful.
357 * @remarks Even if this method returns @c true, the size can be changed internally.
358 * @remarks The specific error code can be accessed using the GetLastResult() method.
359 * @remarks When control is not resizable,
360 * SetSize(), SetBounds(), SetMinimumSize() and SetMaximumSize() return @c E_UNSUPPORTED_OPERATION.
363 * @see SetMinimumSize()
364 * @see SetMaximumSize()
366 bool IsResizable(void) const;
369 * Gets the position and the size of the control.
373 * @return An instance of the Tizen::Graphics::Rectangle that represents the position of top-left corner,
374 * the width, and the height of the control
375 * @remarks The shape of the control is rectangular that is defined by the top-left point,
376 * and the width or height. The position
377 * of the top-left point is relative to the top-left corner of the parent container.
380 Tizen::Graphics::Rectangle GetBounds(void) const;
383 * Gets the position and the size of the control.
387 * @return An instance of the Tizen::Graphics::FloatRectangle that represents the position of top-left corner,
388 * the width, and the height of the control
389 * @remarks The shape of the control is rectangular that is defined by the top-left point,
390 * and the width or height. The position
391 * of the top-left point is relative to the top-left corner of the parent container.
394 Tizen::Graphics::FloatRectangle GetBoundsF(void) const;
397 * Gets the position and the size of the control.
401 * @param[out] x The x position of top-left corner of the control
402 * @param[out] y The y position of top-left corner of the control
403 * @param[out] width The width of the rectangular region
404 * @param[out] height The height of the rectangular region
405 * @remarks The shape of the control is regarded as a rectangle that is defined
406 * by the top-left point and the width or height.
407 * The position of the top-left point is relative to the top-left corner of
408 * the parent container.
411 void GetBounds(int& x, int& y, int& width, int& height) const;
414 * Gets the position and the size of the control.
418 * @param[out] x The x position of top-left corner of the control
419 * @param[out] y The y position of top-left corner of the control
420 * @param[out] width The width of the rectangular region
421 * @param[out] height The height of the rectangular region
422 * @remarks The shape of the control is regarded as a rectangle that is defined
423 * by the top-left point and the width or height.
424 * The position of the top-left point is relative to the top-left corner of
425 * the parent container.
428 void GetBounds(float& x, float& y, float& width, float& height) const;
431 * Gets the position of the control's top-left corner.
435 * @return The position of the control's top-left corner
436 * @remarks The position of top-left corner is relative to the top-left corner of its parent container.
439 Tizen::Graphics::Point GetPosition(void) const;
442 * Gets the position of the control's top-left corner.
446 * @return The position of the control's top-left corner
447 * @remarks The position of top-left corner is relative to the top-left corner of its parent container.
450 Tizen::Graphics::FloatPoint GetPositionF(void) const;
453 * Gets the position of the control's top-left corner.
457 * @param[out] x The x position of the control's top-left corner
458 * @param[out] y The y position of the control's top-left corner
459 * @remarks The position of top-left corner is relative to the top-left corner of its parent container.
462 void GetPosition(int& x, int& y) const;
465 * Gets the position of the control's top-left corner.
469 * @param[out] x The x position of the control's top-left corner
470 * @param[out] y The y position of the control's top-left corner
471 * @remarks The position of top-left corner is relative to the top-left corner of its parent container.
474 void GetPosition(float& x, float& y) const;
477 * Gets the size of the control.
481 * @return The size of the control
484 Tizen::Graphics::Dimension GetSize(void) const;
487 * Gets the size of the control.
491 * @return The size of the control
494 Tizen::Graphics::FloatDimension GetSizeF(void) const;
497 * Gets the size of the control.
501 * @param[out] width The width of the control
502 * @param[out] height The height of the control
505 void GetSize(int& width, int& height) const;
508 * Gets the size of the control.
512 * @param[out] width The width of the control
513 * @param[out] height The height of the control
516 void GetSize(float& width, float& height) const;
519 * Gets the x position of the control. @n
520 * The position of control is relative to the top-left corner of its parent container.
524 * @return The x position of the control
529 int GetX(void) const;
532 * Gets the x position of the control. @n
533 * The position of control is relative to the top-left corner of its parent container.
537 * @return The x position of the control
542 float GetXF(void) const;
545 * Gets the y position of the control. @n
546 * The position of control is relative to the top-left corner of its parent container.
550 * @return The y position of the control
555 int GetY(void) const;
558 * Gets the y position of the control. @n
559 * The position of control is relative to the top-left corner of its parent container.
563 * @return The y position of the control
568 float GetYF(void) const;
571 * Gets the width of the control.
575 * @return The width of the control
580 int GetWidth(void) const;
583 * Gets the width of the control.
587 * @return The width of the control
592 float GetWidthF(void) const;
595 * Gets the height of the control.
599 * @return The height of the control
604 int GetHeight(void) const;
607 * Gets the height of the control.
611 * @return The height of the control
616 float GetHeightF(void) const;
619 * Gets the minimum size of the control.
623 * @return The minimum size of the control
624 * @exception E_SUCCESS The method is successful.
625 * @exception E_SYSTEM A system error has occurred.
626 * @remarks The first call of the method returns the system-defined minimum size.
627 * @remarks The specific error code can be accessed using the GetLastResult() method.
629 Tizen::Graphics::Dimension GetMinimumSize(void) const;
632 * Gets the minimum size of the control.
636 * @return The minimum size of the control
637 * @exception E_SUCCESS The method is successful.
638 * @exception E_SYSTEM A system error has occurred.
639 * @remarks The first call of the method returns the system-defined minimum size.
640 * @remarks The specific error code can be accessed using the GetLastResult() method.
642 Tizen::Graphics::FloatDimension GetMinimumSizeF(void) const;
645 * Gets the maximum size of the control.
649 * @return The maximum size of the control
650 * @exception E_SUCCESS The method is successful.
651 * @exception E_SYSTEM A system error has occurred.
652 * @remarks The first call of the method returns the system-defined maximum size.
653 * @remarks The specific error code can be accessed using the GetLastResult() method.
655 Tizen::Graphics::Dimension GetMaximumSize(void) const;
658 * Gets the maximum size of the control.
662 * @return The maximum size of the control
663 * @exception E_SUCCESS The method is successful.
664 * @exception E_SYSTEM A system error has occurred.
665 * @remarks The first call of the method returns the system-defined maximum size.
666 * @remarks The specific error code can be accessed using the GetLastResult() method.
668 Tizen::Graphics::FloatDimension GetMaximumSizeF(void) const;
671 * Gets a font of the control.
675 * @return The font name set in the control @n
676 * else an empty string if the font is not set
679 Tizen::Base::String GetFont(void) const;
682 * Sets the position and size of the control.
686 * @return An error code
687 * @param[in] rect The new bounds of the control
688 * @exception E_SUCCESS The method is successful.
689 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
690 * @exception E_UNSUPPORTED_OPERATION This control is neither movable nor resizable.
691 * @exception E_INVALID_ARG The specified input parameter is invalid.
692 * @exception E_SYSTEM A system error has occurred.
693 * @remarks Do not override this method.
694 * @remarks The size of the control must be within the range defined by the minimum size and the maximum size.
697 * @see GetMinimumSize()
698 * @see GetMaximumSize()
702 result SetBounds(const Tizen::Graphics::Rectangle& rect);
705 * Sets the position and size of the control.
709 * @return An error code
710 * @param[in] rect The new bounds of the control
711 * @exception E_SUCCESS The method is successful.
712 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
713 * @exception E_UNSUPPORTED_OPERATION This control is neither movable nor resizable.
714 * @exception E_INVALID_ARG The specified input parameter is invalid.
715 * @exception E_SYSTEM A system error has occurred.
716 * @remarks Do not override this method.
717 * @remarks The size of the control must be within the range defined by the minimum size and the maximum size.
720 * @see GetMinimumSize()
721 * @see GetMaximumSize()
725 result SetBounds(const Tizen::Graphics::FloatRectangle& rect);
728 * Sets the position and size of the control. @n
729 * The position is set at (x, y), and the @c width and @c height parameters contain
730 * the width and height values of the object, respectively.
734 * @return An error code
735 * @param[in] x The new x position of the control
736 * @param[in] y The new y position of the control
737 * @param[in] width The new width of the control
738 * @param[in] height The new height of the control
739 * @exception E_SUCCESS The method is successful.
740 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
741 * @exception E_UNSUPPORTED_OPERATION This control is neither movable nor resizable.
742 * @exception E_INVALID_ARG A specified input parameter is invalid.
743 * @exception E_SYSTEM A system error has occurred.
744 * @remarks Do not override this method.
745 * @remarks The size of the control must be within the range defined by the minimum size and the maximum size.
748 * @see GetMinimumSize()
749 * @see GetMaximumSize()
753 result SetBounds(int x, int y, int width, int height);
756 * Sets the position and size of the control. @n
757 * The position is set at (x, y), and the @c width and @c height parameters contain
758 * the width and height values of the object, respectively.
762 * @return An error code
763 * @param[in] x The new x position of the control
764 * @param[in] y The new y position of the control
765 * @param[in] width The new width of the control
766 * @param[in] height The new height of the control
767 * @exception E_SUCCESS The method is successful.
768 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
769 * @exception E_UNSUPPORTED_OPERATION This control is neither movable nor resizable.
770 * @exception E_INVALID_ARG A specified input parameter is invalid.
771 * @exception E_SYSTEM A system error has occurred.
772 * @remarks Do not override this method.
773 * @remarks The size of the control must be within the range defined by the minimum size and the maximum size.
776 * @see GetMinimumSize()
777 * @see GetMaximumSize()
781 result SetBounds(float x, float y, float width, float height);
784 * Sets the relative position of the control.
788 * @return An error code
789 * @param[in] position The new position
790 * @exception E_SUCCESS The method is successful.
791 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
792 * @exception E_UNSUPPORTED_OPERATION This control is not movable.
793 * @exception E_SYSTEM A system error has occurred.
794 * @remarks Do not override this method.
795 * @remarks The position of the control are relative to the top-left corner of its parent.
799 result SetPosition(const Tizen::Graphics::Point& position);
802 * Sets the relative position of the control.
806 * @return An error code
807 * @param[in] position The new position
808 * @exception E_SUCCESS The method is successful.
809 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
810 * @exception E_UNSUPPORTED_OPERATION This control is not movable.
811 * @exception E_SYSTEM A system error has occurred.
812 * @remarks Do not override this method.
813 * @remarks The position of the control are relative to the top-left corner of its parent.
817 result SetPosition(const Tizen::Graphics::FloatPoint& position);
820 * Sets the position of the control.
823 * @return An error code
824 * @param[in] x The new x position of the control
825 * @param[in] y The new y position of the control
826 * @exception E_SUCCESS The method is successful.
827 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
828 * @exception E_UNSUPPORTED_OPERATION This control is not movable.
829 * @exception E_SYSTEM A system error has occurred.
830 * @remarks Do not override this method.
831 * @remarks The x,y position of the control are relative to the top-left corner of its parent.
835 result SetPosition(int x, int y);
838 * Sets the position of the control.
841 * @return An error code
842 * @param[in] x The new x position of the control
843 * @param[in] y The new y position of the control
844 * @exception E_SUCCESS The method is successful.
845 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
846 * @exception E_UNSUPPORTED_OPERATION This control is not movable.
847 * @exception E_SYSTEM A system error has occurred.
848 * @remarks Do not override this method.
849 * @remarks The x,y position of the control are relative to the top-left corner of its parent.
853 result SetPosition(float x, float y);
856 * Sets the size of the control. @n
857 * The @c width and @c height parameters contain the width and height values of the object, respectively.
861 * @return An error code
862 * @param[in] size The new width and height
863 * @exception E_SUCCESS The method is successful.
864 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
865 * @exception E_UNSUPPORTED_OPERATION This control is not resizable.
866 * @exception E_INVALID_ARG The specified input parameter is invalid.
867 * @exception E_SYSTEM A system error has occurred.
868 * @remarks Do not override this method.
869 * @remarks The size of the control must be within the range defined by the minimum size and the maximum size.
871 * @see GetMinimumSize()
872 * @see GetMaximumSize()
875 result SetSize(const Tizen::Graphics::Dimension& size);
878 * Sets the size of the control.
879 * The @c width and @c height parameters contain the width and height values of the object, respectively.
883 * @return An error code
884 * @param[in] size The new width and height
885 * @exception E_SUCCESS The method is successful.
886 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
887 * @exception E_UNSUPPORTED_OPERATION This control is not resizable.
888 * @exception E_INVALID_ARG The specified input parameter is invalid.
889 * @exception E_SYSTEM A system error has occurred.
890 * @remarks Do not override this method.
891 * @remarks The size of the control must be within the range defined by the minimum size and the maximum size.
893 * @see GetMinimumSize()
894 * @see GetMaximumSize()
897 result SetSize(const Tizen::Graphics::FloatDimension& size);
900 * Sets the size of the control. @n
901 * The @c width and @c height parameters contain the width and height values of the object, respectively.
905 * @return An error code
906 * @param[in] width The new width of the control
907 * @param[in] height The new height of the control
908 * @exception E_SUCCESS The method is successful.
909 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
910 * @exception E_UNSUPPORTED_OPERATION This control is not resizable.
911 * @exception E_INVALID_ARG A specified input parameter is invalid.
912 * @exception E_SYSTEM A system error has occurred.
913 * @remarks Do not override this method.
914 * @remarks The size of the control must be within the range defined by the minimum size and the maximum size.
916 * @see GetMinimumSize()
917 * @see GetMaximumSize()
920 result SetSize(int width, int height);
923 * Sets the size of the control.
924 * The @c width and @c height parameters contain the width and height values of the object, respectively.
928 * @return An error code
929 * @param[in] width The new width of the control
930 * @param[in] height The new height of the control
931 * @exception E_SUCCESS The method is successful.
932 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
933 * @exception E_UNSUPPORTED_OPERATION This control is not resizable.
934 * @exception E_INVALID_ARG A specified input parameter is invalid.
935 * @exception E_SYSTEM A system error has occurred.
936 * @remarks Do not override this method.
937 * @remarks The size of the control must be within the range defined by the minimum size and the maximum size.
939 * @see GetMinimumSize()
940 * @see GetMaximumSize()
943 result SetSize(float width, float height);
946 * Sets the minimum size of the control.
950 * @return An error code
951 * @param[in] newMinDim The new minimum size of the control
952 * @exception E_SUCCESS The method is successful.
953 * @exception E_UNSUPPORTED_OPERATION This control is not resizable.
954 * @exception E_INVALID_ARG The specified input parameter is invalid.
955 * @exception E_SYSTEM A system error has occurred.
956 * @remarks This method can affect the maximum size and the current size of the control. @n
957 * The control needs to be redrawn to reflect the change in its size. @n
958 * If the current maximum size or the control size is smaller than the new minimum size,
959 * it becomes the same as the new minimum size.
962 result SetMinimumSize(const Tizen::Graphics::Dimension& newMinDim);
965 * Sets the minimum size of the control.
969 * @return An error code
970 * @param[in] newMinDim The new minimum size of the control
971 * @exception E_SUCCESS The method is successful.
972 * @exception E_UNSUPPORTED_OPERATION This control is not resizable.
973 * @exception E_INVALID_ARG The specified input parameter is invalid.
974 * @exception E_SYSTEM A system error has occurred.
975 * @remarks This method can affect the maximum size and the current size of the control. @n
976 * The control needs to be redrawn to reflect the change in its size. @n
977 * If the current maximum size or the control size is smaller than the new minimum size,
978 * it becomes the same as the new minimum size.
981 result SetMinimumSize(const Tizen::Graphics::FloatDimension& newMinDim);
984 * Sets the maximum size of the control.
988 * @return An error code
989 * @param[in] newMaxDim The new maximum size of the control
990 * @exception E_SUCCESS The method is successful.
991 * @exception E_UNSUPPORTED_OPERATION This control is not resizable.
992 * @exception E_INVALID_ARG The specified input parameter is invalid.
993 * @exception E_SYSTEM A system error has occurred.
994 * @remarks This method can affect the minimum size and the current size of the control. @n
995 * The control needs to be redrawn to reflect the change in its size. @n
996 * If the current minimum size or the control size is greater than the new maximum size,
997 * it becomes the same as the new maximum size.
1000 result SetMaximumSize(const Tizen::Graphics::Dimension& newMaxDim);
1003 * Sets the maximum size of the control.
1007 * @return An error code
1008 * @param[in] newMaxDim The new maximum size of the control
1009 * @exception E_SUCCESS The method is successful.
1010 * @exception E_UNSUPPORTED_OPERATION This control is not resizable.
1011 * @exception E_INVALID_ARG The specified input parameter is invalid.
1012 * @exception E_SYSTEM A system error has occurred.
1013 * @remarks This method can affect the minimum size and the current size of the control. @n
1014 * The control needs to be redrawn to reflect the change in its size. @n
1015 * If the current minimum size or the control size is greater than the new maximum size,
1016 * it becomes the same as the new maximum size.
1017 * @see IsResizable()
1019 result SetMaximumSize(const Tizen::Graphics::FloatDimension& newMaxDim);
1022 * Converts the specified screen position to the position in control's coordinate system.
1026 * @return The position relative to the top-left corner of the control's client-area
1027 * @param[in] screenPosition The position relative to the top-left corner of the screen
1028 * @see ConvertToScreenPosition()
1030 Tizen::Graphics::Point ConvertToControlPosition(const Tizen::Graphics::Point& screenPosition) const;
1033 * Converts the specified screen position to the position in control's coordinate system.
1037 * @return The position relative to the top-left corner of the control's client-area
1038 * @param[in] screenPosition The position relative to the top-left corner of the screen
1039 * @see ConvertToScreenPosition()
1041 Tizen::Graphics::FloatPoint ConvertToControlPosition(const Tizen::Graphics::FloatPoint& screenPosition) const;
1044 * Converts the specified position in the control's coordinate system to the screen position.
1048 * @return The position relative to the top-left corner of the screen
1049 * @param[in] controlPosition The position relative to the top-left corner of the control's client-area
1050 * @see ConvertToControlPosition()
1052 Tizen::Graphics::Point ConvertToScreenPosition(const Tizen::Graphics::Point& controlPosition) const;
1055 * Converts the specified position in the control's coordinate system to the screen position.
1059 * @return The position relative to the top-left corner of the screen
1060 * @param[in] controlPosition The position relative to the top-left corner of the control's client-area
1061 * @see ConvertToControlPosition()
1063 Tizen::Graphics::FloatPoint ConvertToScreenPosition(const Tizen::Graphics::FloatPoint& controlPosition) const;
1066 * Sets the font of the control.
1070 * @return An error code
1071 * @param[in] fontName The app font name or system font name @n
1072 * The app font name is retrieved using Tizen::Graphics::Font::GetFaceName(Tizen::Base::String& filepath). @n
1073 * The system font name is retrieved using Tizen::Graphics::Font::GetSystemFontListN().
1074 * Sets an empty string to reset.
1075 * @exception E_SUCCESS The method is successful.
1076 * @exception E_FILE_NOT_FOUND The specified font cannot be found or accessed.
1077 * @remarks At first, the value of @c fontName is considered app font name if it matches one of the face names of the font files which are located in @b '/res/font'.
1078 * If not, the value of @c fontName is considered system font name if it matches one of the retrieved values using Tizen::Graphics::Font::GetSystemFontListN().
1079 * @remarks The control first attempts to find the control font. If it fails, then it searches for the application default font and the system font, in sequence.
1082 result SetFont(const Tizen::Base::String& fontName);
1085 * Checks whether the specified @c point is inside the control.
1089 * @return @c true if the specified @c point is inside the control, @n
1091 * @param[in] point The point to check
1092 * @remarks The specified @c point must be defined relative to the top-left corner of the control.
1094 bool Contains(const Tizen::Graphics::Point& point) const;
1097 * Checks whether the specified @c point is inside the control.
1101 * @return @c true if the specified @c point is inside the control, @n
1103 * @param[in] point The point to check
1104 * @remarks The specified @c point must be defined relative to the top-left corner of the control.
1106 bool Contains(const Tizen::Graphics::FloatPoint& point) const;
1109 * Checks whether the specified point is inside the control.
1113 * @return @c true if the specified point is inside the control, @n
1115 * @param[in] x The x position of the point to check
1116 * @param[in] y The y position of the point to check
1117 * @remarks The specified point must be defined relative to the top-left corner of the control.
1119 bool Contains(int x, int y) const;
1122 * Checks whether the specified point is inside the control.
1126 * @return @c true if the specified point is inside the control, @n
1128 * @param[in] x The x position of the point to check
1129 * @param[in] y The y position of the point to check
1130 * @remarks The specified point must be defined relative to the top-left corner of the control.
1132 bool Contains(float x, float y) const;
1135 * Draws child controls recursively.
1138 * @brief <i> [Compatibility] </i>
1143 * @compatibility This method has compatibility issues with OSP compatible applications. @n
1144 * For more information, see @ref CompDrawPage "here".
1146 * @return An error code
1147 * @exception E_SUCCESS The method is successful.
1148 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1149 * Note: This control cannot be displayed.
1150 * @exception E_SYSTEM A system error has occurred.
1151 * @remarks This method calls OnDraw() immediately in a synchronous way.
1158 * @page CompDrawPage Compatibility for Draw()
1159 * @section CompDrawPageIssueSection Issues
1160 * Implementation of this method in %Tizen API versions prior to 2.1 has the following issue: @n
1161 * -# Draw() method draws child controls in a recursive way regardless of the visibility of the parent.
1163 * @section CompDrawPageSolutionSection Resolutions
1164 * The issue mentioned above is resolved in %Tizen API version 2.1 as follows: @n
1165 * -# Draw() method does not draw child controls if the control itself is not visible.
1170 * Draws the control.
1174 * @param[in] recursive Set to @c true to draw child controls recursively, @n
1176 * @return An error code
1177 * @exception E_SUCCESS The method is successful.
1178 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1179 * Note: This control cannot be displayed.
1180 * @exception E_SYSTEM A system error has occurred.
1181 * @remarks This method calls OnDraw() immediately in a synchronous way.
1184 result Draw(bool recursive);
1187 * Shows the control on the screen.
1190 * @final Although this method is virtual, it should not be overridden.
1191 * If overridden, it may not work as expected.
1193 * @return An error code
1194 * @exception E_SUCCESS The method is successful.
1195 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1196 * Note: This control cannot be displayed.
1197 * @exception E_SYSTEM A system error has occurred.
1198 * @remarks Do not override this method.
1200 virtual result Show(void);
1203 * Invalidates the control.
1207 * @param[in] recursive Set to @c true to invalidate child controls recursively, @n
1209 * @exception E_SUCCESS The method is successful.
1210 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1211 * Note: This control cannot be displayed.
1212 * @exception E_SYSTEM A system error has occurred.
1213 * @remarks The specific error code can be accessed using the GetLastResult() method.
1214 * @remarks OnDraw() is not called immediately, but called asynchronously just before the screen is updated.
1215 * @see InvalidateBounds()
1218 void Invalidate(bool recursive);
1221 * Invalidates the control of the specified position and size.
1225 * @param[in] bounds The position relative to the top-left corner of the control
1226 * @exception E_SUCCESS The method is successful.
1227 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1228 * Note: This control cannot be displayed.
1229 * @remarks The specific error code can be accessed using the GetLastResult() method.
1233 void InvalidateBounds(const Tizen::Graphics::Rectangle& bounds);
1236 * Invalidates the control of the specified position and size.
1240 * @param[in] bounds The position relative to the top-left corner of the control
1241 * @exception E_SUCCESS The method is successful.
1242 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1243 * Note: This control cannot be displayed.
1244 * @remarks The specific error code can be accessed using the GetLastResult() method.
1248 void InvalidateBounds(const Tizen::Graphics::FloatRectangle& bounds);
1251 * Draws the control asynchronously.
1255 * @param[in] show Set to @c true to also show the %Control, @n
1257 * @remarks This method posts a draw event in the event queue. @n
1258 * Drawing requested by %RequestRedraw() occurs when the draw event is fired to the control.
1260 void RequestRedraw(bool show = true) const;
1263 * Creates and returns a graphics canvas whose bounds (that is, position and size) are equal to those
1268 * @return The graphic canvas of the control, @n
1269 * else @c null if an exception occurs
1270 * @exception E_SUCCESS The method is successful.
1271 * @exception E_SYSTEM A system error has occurred.
1272 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
1273 * @remarks The method allocates a Tizen::Graphics::Canvas whose bounds are equal to that of the control.
1274 * It is the developer's responsibility to deallocate the canvas after use.
1275 * The canvas is guaranteed to be valid only if the properties of the parent controls of the canvas remain unchanged.
1276 * Therefore, one must delete previously allocated canvas and create a new canvas using the %GetCanvasN() method
1277 * if the size or position of the control is changed.
1278 * @remarks The specific error code can be accessed using the GetLastResult() method.
1279 * @remarks The Frame and Form (and between different Form instances) share a single frame-buffer. Therefore,
1280 * if custom drawing is performed on the graphic canvas of Frame and Form
1281 * then it will appear on the screen regardless of which control is currently visible on the screen.
1282 * @see GetCanvasN(const Tizen::Graphics::Rectangle& bounds) const
1283 * @see GetCanvasN(int x, int y, int width, int height) const
1286 * MyForm::OnDraw(void)
1288 * result r = E_SUCCESS;
1289 * Canvas* pCanvas = GetCanvasN();
1290 * if (pCanvas != null)
1292 * // add your drawing code here
1296 * // Do not call Show(). It will be called automatically after OnDraw() callback.
1301 Tizen::Graphics::Canvas* GetCanvasN(void) const;
1304 * Creates and returns a graphic canvas of the control of the specified position and size.
1308 * @return The graphic canvas of the control, @n
1309 * else @c null if an exception occurs
1310 * @param[in] bounds The bounds of the graphic canvas
1311 * @exception E_SUCCESS The method is successful.
1312 * @exception E_OUT_OF_RANGE The specified bounds does not intercept with the bounds of the control.
1313 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
1314 * @remarks Only the graphic canvas of displayable controls can be obtained.
1315 * If the specified area is not inside the control,
1316 * the graphics canvas of overlapped area between the control and the specified bound is returned. @n
1317 * @remarks The method allocates an Tizen::Graphics::Canvas whose bounds are equal to that of the control.
1318 * It is the developer's responsibility to deallocate the canvas after use.
1319 * The canvas is guaranteed to be valid only if the properties of the parent controls of the canvas remain unchanged.
1320 * Therefore, one must delete previously allocated canvas and create a new canvas using the %GetCanvasN() method
1321 * if the size or position of the control is changed.
1322 * @remarks The specific error code can be accessed using the GetLastResult() method.
1323 * @remarks The Frame and Form (and between different Form instances) share a single frame-buffer. Therefore,
1324 * if custom drawing is performed on the graphic canvas of Frame and Form
1325 * then it will appear on the screen regardless of which control is currently visible on the screen.
1326 * @see GetCanvasN(void) const
1327 * @see GetCanvasN(int x, int y, int width, int height) const
1329 Tizen::Graphics::Canvas* GetCanvasN(const Tizen::Graphics::Rectangle& bounds) const;
1332 * Creates and returns a graphic canvas of the control of the specified position and size.
1336 * @return The graphic canvas of the control, @n
1337 * else @c null if an exception occurs
1338 * @param[in] bounds The bounds of the graphic canvas
1339 * @exception E_SUCCESS The method is successful.
1340 * @exception E_OUT_OF_RANGE The specified bounds does not intercept with the bounds of the control.
1341 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
1342 * @remarks Only the graphic canvas of displayable controls can be obtained.
1343 * If the specified area is not inside the control,
1344 * the graphics canvas of overlapped area between the control and the specified bound is returned. @n
1345 * @remarks The method allocates an Tizen::Graphics::Canvas whose bounds are equal to that of the control.
1346 * It is the developer's responsibility to deallocate the canvas after use.
1347 * The canvas is guaranteed to be valid only if the properties of the parent controls of the canvas remain unchanged.
1348 * Therefore, one must delete previously allocated canvas and create a new canvas using the %GetCanvasN() method
1349 * if the size or position of the control is changed.
1350 * @remarks The specific error code can be accessed using the GetLastResult() method.
1351 * @remarks The Frame and Form (and between different Form instances) share a single frame-buffer. Therefore,
1352 * if custom drawing is performed on the graphic canvas of Frame and Form
1353 * then it will appear on the screen regardless of which control is currently visible on the screen.
1354 * @see GetCanvasN(void) const
1355 * @see GetCanvasN(float x, float y, float width, float height) const
1357 Tizen::Graphics::Canvas* GetCanvasN(const Tizen::Graphics::FloatRectangle& bounds) const;
1360 * Creates and returns a graphic canvas of the specified position and size in the control.
1364 * @return The graphic canvas of the control, @n
1365 * else @c null if an exception occurs
1366 * @param[in] x The x position relative to the top-left corner of the control
1367 * @param[in] y The y position relative to the top-left corner of the control
1368 * @param[in] width The width of a graphic canvas
1369 * @param[in] height The height of a graphic canvas
1370 * @exception E_SUCCESS The method is successful.
1371 * @exception E_OUT_OF_RANGE The specified bounds do not intercept with the bounds of the control.
1372 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
1373 * @remarks Only the graphic canvas of displayable controls can be obtained.
1374 * If the specified area is not inside the control,
1375 * the graphics canvas of the overlapped area between the control and the specified bound is returned. @n
1376 * @remarks The method allocates an Tizen::Graphics::Canvas whose bounds are equal to that of the control.
1377 * It is the developer's responsibility to deallocate the canvas after use.
1378 * The canvas is guaranteed to be valid only if properties of the parent controls of the canvas remain unchanged.
1379 * Therefore, one must delete the previously allocated canvas and create a new canvas using the %GetCanvasN() method
1380 * if the size or position of the control is changed.
1381 * @remarks The specific error code can be accessed using the GetLastResult() method.
1382 * @remarks The Frame and Form (and between different Form instances) share a single frame-buffer. Therefore,
1383 * if custom drawing is performed on the graphic canvas of Frame and Form
1384 * then it will appear on the screen regardless of which control is currently visible on the screen.
1385 * @see GetCanvasN(void) const
1386 * @see GetCanvasN(const Tizen::Graphics::Rectangle& bounds) const
1388 Tizen::Graphics::Canvas* GetCanvasN(int x, int y, int width, int height) const;
1391 * Creates and returns a graphic canvas of the specified position and size in the control.
1395 * @return The graphic canvas of the control, @n
1396 * else @c null if an exception occurs
1397 * @param[in] x The x position relative to the top-left corner of the control
1398 * @param[in] y The y position relative to the top-left corner of the control
1399 * @param[in] width The width of a graphic canvas
1400 * @param[in] height The height of a graphic canvas
1401 * @exception E_SUCCESS The method is successful.
1402 * @exception E_OUT_OF_RANGE The specified bounds do not intercept with the bounds of the control.
1403 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
1404 * @remarks Only the graphic canvas of displayable controls can be obtained.
1405 * If the specified area is not inside the control,
1406 * the graphics canvas of the overlapped area between the control and the specified bound is returned. @n
1407 * @remarks The method allocates an Tizen::Graphics::Canvas whose bounds are equal to that of the control.
1408 * It is the developer's responsibility to deallocate the canvas after use.
1409 * The canvas is guaranteed to be valid only if properties of the parent controls of the canvas remain unchanged.
1410 * Therefore, one must delete the previously allocated canvas and create a new canvas using the %GetCanvasN() method
1411 * if the size or position of the control is changed.
1412 * @remarks The specific error code can be accessed using the GetLastResult() method.
1413 * @remarks The Frame and Form (and between different Form instances) share a single frame-buffer. Therefore,
1414 * if custom drawing is performed on the graphic canvas of Frame and Form
1415 * then it will appear on the screen regardless of which control is currently visible on the screen.
1416 * @see GetCanvasN(void) const
1417 * @see GetCanvasN(const Tizen::Graphics::FloatRectangle& bounds) const
1419 Tizen::Graphics::Canvas* GetCanvasN(float x, float y, float width, float height) const;
1422 * Checks whether the control is currently visible on the screen.
1426 * @return @c true if the control is currently visible on the screen, @n
1428 * @remarks If this method is called before the control is added to a parent, @c false is returned.
1429 * @see GetShowState()
1430 * @see SetShowState()
1432 bool IsVisible(void) const;
1435 * Gets the current show state of the control.
1439 * @return The show state of the control
1440 * @remarks Even if the control's state is "show", the control may not be visible.
1441 * @see SetShowState()
1444 bool GetShowState(void) const;
1447 * Sets the show state of the control.
1451 * @return An error code
1452 * @param[in] state The new show state
1453 * @exception E_SUCCESS The method is successful.
1454 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
1455 * Note: This control cannot be displayed.
1456 * @exception E_SYSTEM A system error has occurred.
1457 * @remarks Do not override this method.
1458 * @remarks Even if this method is invoked, the control is not drawn or shown. @n
1459 * To display the control, use the Invalidate() methods. @n
1460 * Once the control's show state is set to @c false,
1461 * the show state needs to be set to @c true again before you invalidate the control.
1462 * @see GetShowState()
1465 result SetShowState(bool state);
1468 * Gets the dedicated %VisualElement instance for this control.
1472 * @return An instance of the VisualElement
1473 * @remarks If an application developer modifies the state of the returned VisualElement
1474 * and the host control is not aware of this change, then the control may behave egregiously.
1475 * It is highly recommended to restore the %VisualElement state to avoid such conflicts.
1477 Tizen::Ui::Animations::VisualElement* GetVisualElement(void) const;
1480 * Gets the parent of the control.
1484 * @return The current parent of the control
1486 Container* GetParent(void) const;
1489 * Gets the name of the control.
1493 * @return The name of the control
1495 Tizen::Base::String GetName(void) const;
1498 * Sets the name of the control.
1502 * @param[in] name The name of the control
1504 void SetName(const Tizen::Base::String& name);
1507 * Checks whether the control is focusable.
1511 * @return @c true if control is focusable, @n
1513 * @remarks The focus ability of the container classes like Panel is @c false by default.
1515 bool IsFocusable(void) const;
1518 * Sets the focus ability of the control. @n
1519 * Non-Focusable controls cannot take the key focus.
1523 * @return An error code
1524 * @exception E_SUCCESS The method is successful.
1525 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
1526 * Note: The control does not permit to change its focus ability.
1527 * @exception E_SYSTEM A system error has occurred.
1528 * @remarks The focus ability of the container classes like Panel is @c false by default.
1529 * @remarks The RadioGroup class does not render the UI.
1530 * Therefore, RadioGroup::SetFocusable() returns @c E_SYSTEM.
1532 result SetFocusable(bool focusable);
1535 * Checks whether the control currently has the input focus.
1539 * @return @c true if the control currently has the input focus, @n
1541 * @remarks If this method is called before the control is added to a parent, @c false is returned.
1544 bool HasFocus(void) const;
1547 * Sets the focus to the control. @n
1548 * This method is called if the control needs to listen to user input events such as key pressed.
1552 * @return An error code
1553 * @exception E_SUCCESS The method is successful.
1554 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
1555 * Note: This control cannot be displayed.
1556 * @exception E_INVALID_CONDITION The control is not contained in, or is not the top z-order frame or form.
1557 * @remarks Do not override this method.
1559 result SetFocus(void);
1562 * Checks whether the control is enabled.
1566 * @return @c true if the control is enabled, @n
1568 * @remarks If this method is called before the control is added to a parent, @c false is returned.
1571 bool IsEnabled(void) const;
1574 * Enables or disables the control. @n
1575 * Only an enabled control can respond to the user input. By default, the control is enabled.
1579 * @return An error code
1580 * @param[in] enable The new state of the object
1581 * @exception E_SUCCESS The method is successful.
1582 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
1583 * @exception E_SYSTEM A system error has occurred.
1584 * @remarks Do not override this method.
1586 result SetEnabled(bool enable);
1589 * Checks whether the device is in touch mode. @n
1590 * When the user interacts with the device by touching it, the device is in touch mode.
1594 * @return @c true if the device is in touch mode, @n
1596 * @remarks This method returns @c false, for devices with QWERTY keyboard.
1597 * The user can navigate the UI using directional keys.
1599 bool IsInTouchMode(void) const;
1602 * Enables or disables the drag operation in the %Control.
1606 * @param[in] enable Set to @c true to enable the drag operation, @n
1608 * @see SetDropEnabled()
1610 void SetDragEnabled(bool enable);
1613 * Enables or disables the drop operations in the %Control.
1617 * @param[in] enable Set to @c true to enable drop operations, @n
1619 * @remarks To receive drop event, control's drag property has to be enabled.
1620 * @see SetDragEnabled()
1622 void SetDropEnabled(bool enable);
1625 * Sends a user event to the control.
1629 * @param[in] requestId The user-defined event ID
1630 * @param[in] pArgs A pointer to the argument list
1631 * @remarks This method posts a user event in the event queue
1632 * and returns immediately to support asynchronous actions of the framework.
1633 * @see OnUserEventReceived()
1635 void SendUserEvent(RequestId requestId, const Tizen::Base::Collection::IList* pArgs) const;
1638 * Stops the current UI event dispatch sequence by indicating the current input event is consumed.
1640 * @brief <i> [Deprecated] </i>
1641 * @deprecated This method is deprecated. Instead of using this method, use IPropagatedKeyEventListener or IPropagatedTouchEventListener to consume event. @n To propagate the event, return @c true inside the implementation of IPropagatedKeyEventListener or IPropagatedTouchEventListener.
1644 * @return An error code
1645 * @exception E_SUCCESS The method is successful.
1646 * @exception E_SYSTEM A system error has occurred.
1647 * @remarks If this method is invoked during an UI event (key or touch) propagation sequence,
1648 * the method will stop the propagation and consequently the system will not be notified of the event.@n
1649 * The method will not have any effect if no UI event is being dispatched. @n
1650 * It is recommended that this method is called within IKeyEventListener or
1651 * ITouchEventListener to stop the event from propagating to the next step.
1653 result ConsumeInputEvent(void);
1656 * Gets the control animator of the current instance of %Control.
1660 * @return A pointer to ControlAnimator, @n
1661 * else @c null if this instance is not constructed or not added to a parent or non-animatable
1663 Tizen::Ui::Animations::ControlAnimator* GetControlAnimator(void) const;
1666 * Adds the gesture detector to the %Control. @n
1667 * The added gesture detector receives touch events prior to %Control.
1669 * @brief <i> [Deprecated] </i>
1670 * @deprecated This method is deprecated.
1673 * @return An error code
1674 * @param[in] gestureDetector The gesture detector
1675 * @exception E_SUCCESS The method is successful.
1676 * @see RemoveGestureDetector()
1678 result AddGestureDetector(const TouchGestureDetector& gestureDetector);
1681 * Adds a gesture detector to the %Control. @n
1682 * The added gesture detector receives touch events prior to %Control.
1686 * @return An error code
1687 * @param[in] pGestureDetector A pointer to gesture detector
1688 * @exception E_SUCCESS The method is successful.
1689 * @exception E_INVALID_ARG The specified @c pGestureDetector is @c null.
1690 * @see RemoveGestureDetector()
1692 result AddGestureDetector(TouchGestureDetector* pGestureDetector);
1695 * Removes the gesture detector from the %Control.
1697 * @brief <i> [Deprecated] </i>
1698 * @deprecated This method is deprecated.
1701 * @return An error code
1702 * @param[in] gestureDetector The gesture detector
1703 * @exception E_SUCCESS The method is successful.
1704 * @see AddGestureDetector()
1706 result RemoveGestureDetector(const TouchGestureDetector& gestureDetector);
1709 * Removes a gesture detector from the %Control.
1713 * @return An error code
1714 * @param[in] pGestureDetector A pointer to gesture detector
1715 * @exception E_SUCCESS The method is successful.
1716 * @exception E_INVALID_ARG The specified @c pGestureDetector is @c null.
1717 * @see AddGestureDetector()
1719 result RemoveGestureDetector(TouchGestureDetector* pGestureDetector);
1723 * Gets the composite mode for merging with other controls.
1725 * @brief <i> [Deprecated] </i>
1726 * @deprecated This method is deprecated because changing composition mode is not allowed any more.
1729 * @return The composite mode
1730 * @exception E_SUCCESS The method is successful.
1731 * @remarks Since API version 2.1, this method only returns COMPOSITE_MODE_ALPHA_BLENDING.
1732 * @remarks The specific error code can be accessed using the GetLastResult() method.
1735 Tizen::Ui::CompositeMode GetCompositeMode(void) const;
1739 * Sets the composite mode for merging with other controls.
1741 * @brief <i> [Deprecated] </i>
1742 * @deprecated This method is deprecated because changing composition mode is not allowed any more.
1745 * @return An error code
1746 * @param[in] compositeMode The composite mode
1747 * @exception E_SUCCESS The method is successful.
1748 * @exception E_UNSUPPORTED_OPERATION The method is not supported.
1749 * @remarks In Tizen, only @c COMPOSITE_MODE_ALPHA_BLENDING is allowed.
1750 * Otherwise, this method returns @c E_UNSUPPORTED_OPERATION.
1753 result SetCompositeMode(Tizen::Ui::CompositeMode compositeMode);
1757 * Gets the chroma key color value that is used for the control composition.
1759 * @brief <i> [Deprecated] </i>
1760 * @deprecated This method is deprecated because chromakey color is not supported any more.
1763 * @return The chroma key color
1764 * @exception E_UNSUPPORTED_OPERATION The method is not supported.
1765 * @remarks In Tizen, this method always fails and returns Tizen::Graphics::Color(0, 0, 0, 0).
1766 * @remarks The specific error code can be accessed using the GetLastResult() method.
1769 Tizen::Graphics::Color GetChromaKeyColor(void) const;
1773 * Sets the chroma key color value that is used for the control composition.
1775 * @brief <i> [Deprecated] </i>
1776 * @deprecated This method is deprecated because chromakey color is not supported any more.
1779 * @return An error code
1780 * @param[in] chromaKeyColor The chroma key color
1781 * @exception E_UNSUPPORTED_OPERATION The method is not supported.
1782 * @remarks In Tizen, this method always fails.
1785 result SetChromaKeyColor(Tizen::Graphics::Color chromaKeyColor);
1788 * Sets the bounds of the content area.
1792 * @param[in] rect The bounds of the content area
1793 * @see GetContentAreaBounds()
1795 void SetContentAreaBounds(const Tizen::Graphics::Rectangle& rect);
1798 * Sets the bounds of the content area.
1802 * @param[in] rect The bounds of the content area
1803 * @see GetContentAreaBoundsF()
1805 void SetContentAreaBounds(const Tizen::Graphics::FloatRectangle& rect);
1808 * Gets the bounds of the content area.
1812 * @return The bounds of the content area
1813 * @see SetContentAreaBounds()
1815 Tizen::Graphics::Rectangle GetContentAreaBounds(void) const;
1818 * Gets the bounds of the content area.
1822 * @return The bounds of the content area
1823 * @see SetContentAreaBoundsF()
1825 Tizen::Graphics::FloatRectangle GetContentAreaBoundsF(void) const;
1828 * Captures the composited scene of the %Panel control.
1832 * @return A Tizen::Graphics::Bitmap instance that captures the current composited scene of the Panel control, @n
1833 * else @c null if an error occurs
1834 * @exception E_SUCCESS The method is successful.
1835 * @exception E_UNSUPPORTED_OPERATION This method is not supported.
1836 * @exception E_SYSTEM A system error has occurred.
1837 * @remarks The specific error code can be accessed using the GetLastResult() method.
1838 * @remarks This method is not supported in the following class that is derived from Panel class:
1840 * @remarks The bounds of the %Panel control must be within the client area of the Form control to get a valid composited scene.
1842 Tizen::Graphics::Bitmap* GetCapturedBitmapN(void) const;
1845 * Gets the position and the size of the invalidated bounds.
1849 * @return An instance of Tizen::Graphics::Rectangle that represents the position of top-left corner,
1850 * the width, and the height of the invalidated bounds
1852 Tizen::Graphics::Rectangle GetInvalidatedBounds(void) const;
1855 * Gets the position and the size of the invalidated bounds.
1859 * @return An instance of Tizen::Graphics::Rectangle that represents the position of top-left corner,
1860 * the width, and the height of the invalidated bounds
1862 Tizen::Graphics::FloatRectangle GetInvalidatedBoundsF(void) const;
1865 * Enables or disables the multi-point touch of the %Control.
1869 * @param[in] enable A Boolean flag indicating whether to enable the multi-point touch
1871 * @see IsMultipointTouchEnabled()
1873 void SetMultipointTouchEnabled(bool enable);
1876 * Checks whether the multi-point touch is enabled.
1880 * @return @c true if the multi-point touch is enabled, @n
1882 * @see SetMultipointTouchEnabled()
1884 bool IsMultipointTouchEnabled(void) const;
1887 * Gets the accessibility container.
1891 * @return The accessibility container of the control, if the control supports accessibility feature, @n
1893 * @see AccessibilityContainer::GetOwner()
1895 const AccessibilityContainer* GetAccessibilityContainer(void) const;
1898 * Gets the accessibility container.
1902 * @return The accessibility container of the control, if the control supports accessibility feature, @n
1904 * @see AccessibilityContainer::GetOwner()
1906 AccessibilityContainer* GetAccessibilityContainer(void);
1909 * Sets a propagated touch event listener to the %Control instance. @n
1910 * The registered listener is notified when a touch event occurs in the control. Using the propagated touch event listener, an application can control the touch event routing path.
1914 * @param[in] pListener The event listener to which the propagated touch events are dispatched
1915 * @remarks The specified event listener should be allocated in heap memory.
1916 * To unregister the event listener, pass @c null to @c pListener.
1919 void SetPropagatedTouchEventListener(IPropagatedTouchEventListener* pListener);
1922 * Sets a propagated key event listener to the %Control instance.
1923 * The registered listener is notified when a key event occurs in the control. Using the propagated key event listener, an application can control the key event routing path.
1927 * @param[in] pListener The event listener to which the propagated touch events are dispatched
1928 * @remarks The specified event listener should be allocated in heap memory.
1929 * To unregister the event listener, pass @c null to @c pListener.
1932 void SetPropagatedKeyEventListener(IPropagatedKeyEventListener* pListener);
1936 * Sets the previous focus of the control.
1940 * @param[in] pPreviousFocus The pointer to the previous focus of the control
1941 * @remarks Focus UI supports linear navigation of controls from top-left to bottom-right direction. This method allows for customizing the default navigation behavior.
1942 * @remarks The platform will not take the ownership of @c pPreviousFocus after this call.
1943 * @see SetNextFocus()
1944 * @see GetPreviousFocus()
1946 void SetPreviousFocus(Control* pPreviousFocus);
1949 * Sets the next focus of the control.
1953 * @param[in] pNextFocus The pointer to the next focus of the control
1954 * @remarks Focus UI supports linear navigation of controls from top-left to bottom-right direction. This method allows for customizing the default navigation behavior.
1955 * @remarks The platform will not take the ownership of @c pNextFocus after this call.
1956 * @see SetPreviousFocus()
1957 * @see GetNextFocus()
1959 void SetNextFocus(Control* pNextFocus);
1962 * Gets the previous focus of the control.
1966 * @return The pointer to the previous focus of the control, @n
1967 * else @c null if the previous focus of the control is not set
1968 * @see GetNextFocus()
1969 * @see SetNextFocus ()
1971 Control* GetPreviousFocus(void) const;
1975 * Gets the next focus of the control.
1979 * @return The pointer to the next focus of the control, @n
1980 * else @c null if the next focus of the control is not set
1981 * @see GetPreviousFocus()
1982 * @see SetPreviousFocus ()
1984 Control* GetNextFocus(void) const;
1987 * Sets the touch press threshold of the Control in inch.
1991 * @param[in] distance The logical threshold to fire touch move event
1992 * @remarks A touch move events will start to fire if the move distance exceeds the set allowance value.
1993 * For example, Set 0.5 if the distance is 0.5 inch.
1994 * This method is offered to control sensitivity of move events.
1996 void SetTouchPressThreshold(float distance);
1999 * Gets the touch press threshold of the Control in inch.
2000 * If the threshold has not been set, it returns the default value.
2004 * @return The threshold to fire touch move event
2006 float GetTouchPressThreshold(void) const;
2010 * Sets the font of the control with the specified file name.
2014 * @return An error code
2015 * @param[in] fileName The file name of a font-resource located in @b ‘/res/font’, @n
2016 * else an empty string to reset
2017 * @exception E_SUCCESS The method is successful.
2018 * @exception E_FILE_NOT_FOUND The specified font cannot be found or accessed.
2019 * @exception E_UNSUPPORTED_FORMAT The specified font format is not supported.
2020 * @see GetFontFile()
2022 result SetFontFromFile(const Tizen::Base::String& fileName);
2025 * Gets a font file name of the control.
2029 * @return The font name set in the control, @n
2030 * else an empty string if the font is not set
2031 * @see SetFontFromFile()
2033 Tizen::Base::String GetFontFile(void) const;
2036 * Enables or disables the effect sound for this control.
2040 * @param[in] enable Set to @c true to enable effect sound, @n
2042 * @remarks If the effect sound is disabled for a container, then all of its child controls also will have the effect sound disabled.
2044 void SetEffectSoundEnabled (bool enable);
2047 * Checks whether the effect sound for this control is enabled.
2051 * @return @c true if the effect sound is enabled, @n
2054 bool IsEffectSoundEnabled (void) const ;
2058 * Gets the default key event listener.
2060 * @brief <i> [Deprecated] </i>
2061 * @deprecated This method is deprecated.
2064 * @return The default key event listener @n
2065 * If no listener has been set or a system error has occurred @c null is returned.
2066 * @see SetDefaultKeyEventListener()
2068 IKeyEventListener* GetDefaultkeyEventListener(void) const;
2071 * Gets the default touch event listener.
2073 * @brief <i> [Deprecated] </i>
2074 * @deprecated This method is deprecated.
2077 * @return The default touch event listener @n
2078 * If no listener has been set or a system error has occurred @c null is returned.
2079 * @see SetDefaultTouchEventListener()
2081 ITouchEventListener* GetDefaultTouchEventListener(void) const;
2084 * Sets the default key event listener.
2086 * @brief <i> [Deprecated] </i>
2087 * @deprecated This method is deprecated. Instead of using this method, use the SetPropagatedKeyEventListener() method.
2090 * @return An error code
2091 * @param[in] pDefaultListener The default key event listener
2092 * @exception E_SUCCESS The method is successful.
2093 * @exception E_SYSTEM A system error has occurred.
2094 * @remarks The registered listener will be notified to handle the key events
2095 * after all application event listeners has been notified.
2096 * @see GetDefaultkeyEventListener()
2098 result SetDefaultKeyEventListener(IKeyEventListener* pDefaultListener);
2101 * Sets the default touch event listener.
2103 * @brief <i> [Deprecated] </i>
2104 * @deprecated This method is deprecated. Instead of using this method, use the SetPropagatedTouchEventListener() method.
2107 * @return An error code
2108 * @param[in] pDefaultListener The default key event listener
2109 * @exception E_SUCCESS The method is successful.
2110 * @exception E_SYSTEM A system error has occurred.
2111 * @remarks The registered listener will be notified to handle the touch events
2112 * after all application event listeners has been notified.
2113 * @see GetDefaultTouchEventListener()
2115 result SetDefaultTouchEventListener(ITouchEventListener* pDefaultListener);
2118 * The object is not fully constructed after this constructor is called. For full construction, the Construct() method must be called right after calling this constructor.
2125 * This method is for internal use only. Using this method can cause behavioral, security-related,
2126 * and consistency-related issues in the application.
2128 * Initializes this instance of %Control.
2131 * @return An error code
2132 * @exception E_SUCCESS The method is successful.
2133 * @exception E_SYSTEM A system error has occurred.
2135 result Construct(void);
2138 * Frees the resources allocated by Construct().
2145 _ControlImpl* _pControlImpl;
2148 // This method is for internal use only. Using this method can cause behavioral, security-related,
2149 // and consistency-related issues in the application.
2151 // This method is reserved and may change its name at any time without prior notice.
2153 virtual void Control_Reserved1(void) {}
2156 // This method is for internal use only. Using this method can cause behavioral, security-related,
2157 // and consistency-related issues in the application.
2159 // This method is reserved and may change its name at any time without prior notice.
2161 virtual void Control_Reserved2(void) {}
2164 // This method is for internal use only. Using this method can cause behavioral, security-related,
2165 // and consistency-related issues in the application.
2167 // This method is reserved and may change its name at any time without prior notice.
2169 virtual void Control_Reserved3(void) {}
2172 // This method is for internal use only. Using this method can cause behavioral, security-related,
2173 // and consistency-related issues in the application.
2175 // This method is reserved and may change its name at any time without prior notice.
2177 virtual void Control_Reserved4(void) {}
2180 // This method is for internal use only. Using this method can cause behavioral, security-related,
2181 // and consistency-related issues in the application.
2183 // This method is reserved and may change its name at any time without prior notice.
2186 virtual void Control_Reserved5(void) {}
2189 // This method is for internal use only. Using this method can cause behavioral, security-related,
2190 // and consistency-related issues in the application.
2192 // This method is reserved and may change its name at any time without prior notice.
2194 virtual void Control_Reserved6(void) {}
2198 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
2200 Control(const Control& rhs);
2203 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
2205 Control& operator =(const Control& rhs);
2208 friend class _ControlImpl;
2213 #endif // _FUI_CONTROL_H_