2 // Open Service Platform
3 // Copyright (c) 2012-2013 Samsung Electronics Co., Ltd.
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
9 // http://floralicense.org/license/
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.
290 * @remarks This method is called right before the control is removed from the container, or Destroy() method is being called.
291 * @remarks To cancel the removal or Destroy() operation, return any exception other than E_SUCCESS.
292 * @see OnInitializing()
294 virtual result OnTerminating(void);
298 * @page CompOnTerminatingPage Compatibility for OnTerminating()
299 * @section CompOnterminatingPageIssueSection Issues
300 * Implementation of this method in %Tizen API versions prior to 2.1 has the following issue: @n
301 * -# OnTerminating() callback is called from child to parent.
303 * @section CompOnTerminatingPageSolutionSection Resolutions
304 * The issue mentioned above is resolved in %Tizen API version 2.1 as follows: @n
305 * -# OnTerminating() callback is called from parent to child.
310 * Called asynchronously when the user event that is sent by SendUserEvent() method is
311 * dispatched to the control.
315 * @param[in] requestId The user-defined event ID
316 * @param[in] pArgs A pointer to the argument list
317 * @see SendUserEvent()
319 virtual void OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs);
322 * Deallocates this instance after removing all child controls of this control
326 * @exception E_SUCCESS The method is successful.
327 * @remarks The control will be deleted from memory. Before it is deleted, OnTerminating() is called if it is attached to the main tree.
328 * @remarks If OnTerminating() method is overrided and returns an exception, that exception will be propagated.
329 * @see Tizen::Ui::Control:OnTerminating()
331 result Destroy(void);
334 * Checks whether the control is movable.
338 * @return @c true if the control is movable, @n
340 * @exception E_SUCCESS The method is successful.
341 * @remarks The specific error code can be accessed using the GetLastResult() method.
342 * @remarks When control is not movable SetPosition() and SetBounds() return @c E_UNSUPPORTED_OPERATION.
346 bool IsMovable(void) const;
349 * Checks whether the control is resizable.
353 * @return @c true if the control is resizable, @n
355 * @exception E_SUCCESS The method is successful.
356 * @remarks Even if this method returns @c true, the size can be changed internally.
357 * @remarks The specific error code can be accessed using the GetLastResult() method.
358 * @remarks When control is not resizable,
359 * SetSize(), SetBounds(), SetMinimumSize() and SetMaximumSize() return @c E_UNSUPPORTED_OPERATION.
362 * @see SetMinimumSize()
363 * @see SetMaximumSize()
365 bool IsResizable(void) const;
368 * Gets the position and the size of the control.
372 * @return An instance of the Tizen::Graphics::Rectangle that represents the position of top-left corner,
373 * the width, and the height of the control
374 * @remarks The shape of the control is rectangular that is defined by the top-left point,
375 * and the width or height. The position
376 * of the top-left point is relative to the top-left corner of the parent container.
379 Tizen::Graphics::Rectangle GetBounds(void) const;
382 * Gets the position and the size of the control.
386 * @return An instance of the Tizen::Graphics::FloatRectangle that represents the position of top-left corner,
387 * the width, and the height of the control
388 * @remarks The shape of the control is rectangular that is defined by the top-left point,
389 * and the width or height. The position
390 * of the top-left point is relative to the top-left corner of the parent container.
393 Tizen::Graphics::FloatRectangle GetBoundsF(void) const;
396 * Gets the position and the size of the control.
400 * @param[out] x The x position of top-left corner of the control
401 * @param[out] y The y position of top-left corner of the control
402 * @param[out] width The width of the rectangular region
403 * @param[out] height The height of the rectangular region
404 * @remarks The shape of the control is regarded as a rectangle that is defined
405 * by the top-left point and the width or height.
406 * The position of the top-left point is relative to the top-left corner of
407 * the parent container.
410 void GetBounds(int& x, int& y, int& width, int& height) const;
413 * Gets the position and the size of the control.
417 * @param[out] x The x position of top-left corner of the control
418 * @param[out] y The y position of top-left corner of the control
419 * @param[out] width The width of the rectangular region
420 * @param[out] height The height of the rectangular region
421 * @remarks The shape of the control is regarded as a rectangle that is defined
422 * by the top-left point and the width or height.
423 * The position of the top-left point is relative to the top-left corner of
424 * the parent container.
427 void GetBounds(float& x, float& y, float& width, float& height) const;
430 * Gets the position of the control's top-left corner.
434 * @return The position of the control's top-left corner
435 * @remarks The position of top-left corner is relative to the top-left corner of its parent container.
438 Tizen::Graphics::Point GetPosition(void) const;
441 * Gets the position of the control's top-left corner.
445 * @return The position of the control's top-left corner
446 * @remarks The position of top-left corner is relative to the top-left corner of its parent container.
449 Tizen::Graphics::FloatPoint GetPositionF(void) const;
452 * Gets the position of the control's top-left corner.
456 * @param[out] x The x position of the control's top-left corner
457 * @param[out] y The y position of the control's top-left corner
458 * @remarks The position of top-left corner is relative to the top-left corner of its parent container.
461 void GetPosition(int& x, int& y) const;
464 * Gets the position of the control's top-left corner.
468 * @param[out] x The x position of the control's top-left corner
469 * @param[out] y The y position of the control's top-left corner
470 * @remarks The position of top-left corner is relative to the top-left corner of its parent container.
473 void GetPosition(float& x, float& y) const;
476 * Gets the size of the control.
480 * @return The size of the control
483 Tizen::Graphics::Dimension GetSize(void) const;
486 * Gets the size of the control.
490 * @return The size of the control
493 Tizen::Graphics::FloatDimension GetSizeF(void) const;
496 * Gets the size of the control.
500 * @param[out] width The width of the control
501 * @param[out] height The height of the control
504 void GetSize(int& width, int& height) const;
507 * Gets the size of the control.
511 * @param[out] width The width of the control
512 * @param[out] height The height of the control
515 void GetSize(float& width, float& height) const;
518 * Gets the x position of the control. @n
519 * The position of control is relative to the top-left corner of its parent container.
523 * @return The x position of the control
528 int GetX(void) const;
531 * Gets the x position of the control. @n
532 * The position of control is relative to the top-left corner of its parent container.
536 * @return The x position of the control
541 float GetXF(void) const;
544 * Gets the y position of the control. @n
545 * The position of control is relative to the top-left corner of its parent container.
549 * @return The y position of the control
554 int GetY(void) const;
557 * Gets the y position of the control. @n
558 * The position of control is relative to the top-left corner of its parent container.
562 * @return The y position of the control
567 float GetYF(void) const;
570 * Gets the width of the control.
574 * @return The width of the control
579 int GetWidth(void) const;
582 * Gets the width of the control.
586 * @return The width of the control
591 float GetWidthF(void) const;
594 * Gets the height of the control.
598 * @return The height of the control
603 int GetHeight(void) const;
606 * Gets the height of the control.
610 * @return The height of the control
615 float GetHeightF(void) const;
618 * Gets the minimum size of the control.
622 * @return The minimum size of the control
623 * @exception E_SUCCESS The method is successful.
624 * @exception E_SYSTEM A system error has occurred.
625 * @remarks The first call of the method returns the system-defined minimum size.
626 * @remarks The specific error code can be accessed using the GetLastResult() method.
628 Tizen::Graphics::Dimension GetMinimumSize(void) const;
631 * Gets the minimum size of the control.
635 * @return The minimum size of the control
636 * @exception E_SUCCESS The method is successful.
637 * @exception E_SYSTEM A system error has occurred.
638 * @remarks The first call of the method returns the system-defined minimum size.
639 * @remarks The specific error code can be accessed using the GetLastResult() method.
641 Tizen::Graphics::FloatDimension GetMinimumSizeF(void) const;
644 * Gets the maximum size of the control.
648 * @return The maximum size of the control
649 * @exception E_SUCCESS The method is successful.
650 * @exception E_SYSTEM A system error has occurred.
651 * @remarks The first call of the method returns the system-defined maximum size.
652 * @remarks The specific error code can be accessed using the GetLastResult() method.
654 Tizen::Graphics::Dimension GetMaximumSize(void) const;
657 * Gets the maximum size of the control.
661 * @return The maximum size of the control
662 * @exception E_SUCCESS The method is successful.
663 * @exception E_SYSTEM A system error has occurred.
664 * @remarks The first call of the method returns the system-defined maximum size.
665 * @remarks The specific error code can be accessed using the GetLastResult() method.
667 Tizen::Graphics::FloatDimension GetMaximumSizeF(void) const;
670 * Gets a font of the control.
674 * @return The font name set in the control @n
675 * else an empty string if the font is not set
678 Tizen::Base::String GetFont(void) const;
681 * Sets the position and size of the control.
685 * @return An error code
686 * @param[in] rect The new bounds of the control
687 * @exception E_SUCCESS The method is successful.
688 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
689 * @exception E_UNSUPPORTED_OPERATION This control is neither movable nor resizable.
690 * @exception E_INVALID_ARG The specified input parameter is invalid.
691 * @exception E_SYSTEM A system error has occurred.
692 * @remarks Do not override this method.
693 * @remarks The size of the control must be within the range defined by the minimum size and the maximum size.
696 * @see GetMinimumSize()
697 * @see GetMaximumSize()
701 result SetBounds(const Tizen::Graphics::Rectangle& rect);
704 * Sets the position and size of the control.
708 * @return An error code
709 * @param[in] rect The new bounds of the control
710 * @exception E_SUCCESS The method is successful.
711 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
712 * @exception E_UNSUPPORTED_OPERATION This control is neither movable nor resizable.
713 * @exception E_INVALID_ARG The specified input parameter is invalid.
714 * @exception E_SYSTEM A system error has occurred.
715 * @remarks Do not override this method.
716 * @remarks The size of the control must be within the range defined by the minimum size and the maximum size.
719 * @see GetMinimumSize()
720 * @see GetMaximumSize()
724 result SetBounds(const Tizen::Graphics::FloatRectangle& rect);
727 * Sets the position and size of the control. @n
728 * The position is set at (x, y), and the @c width and @c height parameters contain
729 * the width and height values of the object, respectively.
733 * @return An error code
734 * @param[in] x The new x position of the control
735 * @param[in] y The new y position of the control
736 * @param[in] width The new width of the control
737 * @param[in] height The new height of the control
738 * @exception E_SUCCESS The method is successful.
739 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
740 * @exception E_UNSUPPORTED_OPERATION This control is neither movable nor resizable.
741 * @exception E_INVALID_ARG A specified input parameter is invalid.
742 * @exception E_SYSTEM A system error has occurred.
743 * @remarks Do not override this method.
744 * @remarks The size of the control must be within the range defined by the minimum size and the maximum size.
747 * @see GetMinimumSize()
748 * @see GetMaximumSize()
752 result SetBounds(int x, int y, int width, int height);
755 * Sets the position and size of the control. @n
756 * The position is set at (x, y), and the @c width and @c height parameters contain
757 * the width and height values of the object, respectively.
761 * @return An error code
762 * @param[in] x The new x position of the control
763 * @param[in] y The new y position of the control
764 * @param[in] width The new width of the control
765 * @param[in] height The new height of the control
766 * @exception E_SUCCESS The method is successful.
767 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
768 * @exception E_UNSUPPORTED_OPERATION This control is neither movable nor resizable.
769 * @exception E_INVALID_ARG A specified input parameter is invalid.
770 * @exception E_SYSTEM A system error has occurred.
771 * @remarks Do not override this method.
772 * @remarks The size of the control must be within the range defined by the minimum size and the maximum size.
775 * @see GetMinimumSize()
776 * @see GetMaximumSize()
780 result SetBounds(float x, float y, float width, float height);
783 * Sets the relative position of the control.
787 * @return An error code
788 * @param[in] position The new position
789 * @exception E_SUCCESS The method is successful.
790 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
791 * @exception E_UNSUPPORTED_OPERATION This control is not movable.
792 * @exception E_SYSTEM A system error has occurred.
793 * @remarks Do not override this method.
794 * @remarks The position of the control are relative to the top-left corner of its parent.
798 result SetPosition(const Tizen::Graphics::Point& position);
801 * Sets the relative position of the control.
805 * @return An error code
806 * @param[in] position The new position
807 * @exception E_SUCCESS The method is successful.
808 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
809 * @exception E_UNSUPPORTED_OPERATION This control is not movable.
810 * @exception E_SYSTEM A system error has occurred.
811 * @remarks Do not override this method.
812 * @remarks The position of the control are relative to the top-left corner of its parent.
816 result SetPosition(const Tizen::Graphics::FloatPoint& position);
819 * Sets the position of the control.
822 * @return An error code
823 * @param[in] x The new x position of the control
824 * @param[in] y The new y position of the control
825 * @exception E_SUCCESS The method is successful.
826 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
827 * @exception E_UNSUPPORTED_OPERATION This control is not movable.
828 * @exception E_SYSTEM A system error has occurred.
829 * @remarks Do not override this method.
830 * @remarks The x,y position of the control are relative to the top-left corner of its parent.
834 result SetPosition(int x, int y);
837 * Sets the position of the control.
840 * @return An error code
841 * @param[in] x The new x position of the control
842 * @param[in] y The new y position of the control
843 * @exception E_SUCCESS The method is successful.
844 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
845 * @exception E_UNSUPPORTED_OPERATION This control is not movable.
846 * @exception E_SYSTEM A system error has occurred.
847 * @remarks Do not override this method.
848 * @remarks The x,y position of the control are relative to the top-left corner of its parent.
852 result SetPosition(float x, float y);
855 * Sets the size of the control. @n
856 * The @c width and @c height parameters contain the width and height values of the object, respectively.
860 * @return An error code
861 * @param[in] size The new width and height
862 * @exception E_SUCCESS The method is successful.
863 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
864 * @exception E_UNSUPPORTED_OPERATION This control is not resizable.
865 * @exception E_INVALID_ARG The specified input parameter is invalid.
866 * @exception E_SYSTEM A system error has occurred.
867 * @remarks Do not override this method.
868 * @remarks The size of the control must be within the range defined by the minimum size and the maximum size.
870 * @see GetMinimumSize()
871 * @see GetMaximumSize()
874 result SetSize(const Tizen::Graphics::Dimension& size);
877 * Sets the size of the control.
878 * The @c width and @c height parameters contain the width and height values of the object, respectively.
882 * @return An error code
883 * @param[in] size The new width and height
884 * @exception E_SUCCESS The method is successful.
885 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
886 * @exception E_UNSUPPORTED_OPERATION This control is not resizable.
887 * @exception E_INVALID_ARG The specified input parameter is invalid.
888 * @exception E_SYSTEM A system error has occurred.
889 * @remarks Do not override this method.
890 * @remarks The size of the control must be within the range defined by the minimum size and the maximum size.
892 * @see GetMinimumSize()
893 * @see GetMaximumSize()
896 result SetSize(const Tizen::Graphics::FloatDimension& size);
899 * Sets the size of the control. @n
900 * The @c width and @c height parameters contain the width and height values of the object, respectively.
904 * @return An error code
905 * @param[in] width The new width of the control
906 * @param[in] height The new height of the control
907 * @exception E_SUCCESS The method is successful.
908 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
909 * @exception E_UNSUPPORTED_OPERATION This control is not resizable.
910 * @exception E_INVALID_ARG A specified input parameter is invalid.
911 * @exception E_SYSTEM A system error has occurred.
912 * @remarks Do not override this method.
913 * @remarks The size of the control must be within the range defined by the minimum size and the maximum size.
915 * @see GetMinimumSize()
916 * @see GetMaximumSize()
919 result SetSize(int width, int height);
922 * Sets the size of the control.
923 * The @c width and @c height parameters contain the width and height values of the object, respectively.
927 * @return An error code
928 * @param[in] width The new width of the control
929 * @param[in] height The new height of the control
930 * @exception E_SUCCESS The method is successful.
931 * @exception E_INVALID_OPERATION The control has not been constructed as yet.
932 * @exception E_UNSUPPORTED_OPERATION This control is not resizable.
933 * @exception E_INVALID_ARG A specified input parameter is invalid.
934 * @exception E_SYSTEM A system error has occurred.
935 * @remarks Do not override this method.
936 * @remarks The size of the control must be within the range defined by the minimum size and the maximum size.
938 * @see GetMinimumSize()
939 * @see GetMaximumSize()
942 result SetSize(float width, float height);
945 * Sets the minimum size of the control.
949 * @return An error code
950 * @param[in] newMinDim The new minimum size of the control
951 * @exception E_SUCCESS The method is successful.
952 * @exception E_UNSUPPORTED_OPERATION This control is not resizable.
953 * @exception E_INVALID_ARG The specified input parameter is invalid.
954 * @exception E_SYSTEM A system error has occurred.
955 * @remarks This method can affect the maximum size and the current size of the control. @n
956 * The control needs to be redrawn to reflect the change in its size. @n
957 * If the current maximum size or the control size is smaller than the new minimum size,
958 * it becomes the same as the new minimum size.
961 result SetMinimumSize(const Tizen::Graphics::Dimension& newMinDim);
964 * Sets the minimum size of the control.
968 * @return An error code
969 * @param[in] newMinDim The new minimum size of the control
970 * @exception E_SUCCESS The method is successful.
971 * @exception E_UNSUPPORTED_OPERATION This control is not resizable.
972 * @exception E_INVALID_ARG The specified input parameter is invalid.
973 * @exception E_SYSTEM A system error has occurred.
974 * @remarks This method can affect the maximum size and the current size of the control. @n
975 * The control needs to be redrawn to reflect the change in its size. @n
976 * If the current maximum size or the control size is smaller than the new minimum size,
977 * it becomes the same as the new minimum size.
980 result SetMinimumSize(const Tizen::Graphics::FloatDimension& newMinDim);
983 * Sets the maximum size of the control.
987 * @return An error code
988 * @param[in] newMaxDim The new maximum size of the control
989 * @exception E_SUCCESS The method is successful.
990 * @exception E_UNSUPPORTED_OPERATION This control is not resizable.
991 * @exception E_INVALID_ARG The specified input parameter is invalid.
992 * @exception E_SYSTEM A system error has occurred.
993 * @remarks This method can affect the minimum size and the current size of the control. @n
994 * The control needs to be redrawn to reflect the change in its size. @n
995 * If the current minimum size or the control size is greater than the new maximum size,
996 * it becomes the same as the new maximum size.
999 result SetMaximumSize(const Tizen::Graphics::Dimension& newMaxDim);
1002 * Sets the maximum size of the control.
1006 * @return An error code
1007 * @param[in] newMaxDim The new maximum size of the control
1008 * @exception E_SUCCESS The method is successful.
1009 * @exception E_UNSUPPORTED_OPERATION This control is not resizable.
1010 * @exception E_INVALID_ARG The specified input parameter is invalid.
1011 * @exception E_SYSTEM A system error has occurred.
1012 * @remarks This method can affect the minimum size and the current size of the control. @n
1013 * The control needs to be redrawn to reflect the change in its size. @n
1014 * If the current minimum size or the control size is greater than the new maximum size,
1015 * it becomes the same as the new maximum size.
1016 * @see IsResizable()
1018 result SetMaximumSize(const Tizen::Graphics::FloatDimension& newMaxDim);
1021 * Converts the specified screen position to the position in control's coordinate system.
1025 * @return The position relative to the top-left corner of the control's client-area
1026 * @param[in] screenPosition The position relative to the top-left corner of the screen
1027 * @see ConvertToScreenPosition()
1029 Tizen::Graphics::Point ConvertToControlPosition(const Tizen::Graphics::Point& screenPosition) const;
1032 * Converts the specified screen position to the position in control's coordinate system.
1036 * @return The position relative to the top-left corner of the control's client-area
1037 * @param[in] screenPosition The position relative to the top-left corner of the screen
1038 * @see ConvertToScreenPosition()
1040 Tizen::Graphics::FloatPoint ConvertToControlPosition(const Tizen::Graphics::FloatPoint& screenPosition) const;
1043 * Converts the specified position in the control's coordinate system to the screen position.
1047 * @return The position relative to the top-left corner of the screen
1048 * @param[in] controlPosition The position relative to the top-left corner of the control's client-area
1049 * @see ConvertToControlPosition()
1051 Tizen::Graphics::Point ConvertToScreenPosition(const Tizen::Graphics::Point& controlPosition) const;
1054 * Converts the specified position in the control's coordinate system to the screen position.
1058 * @return The position relative to the top-left corner of the screen
1059 * @param[in] controlPosition The position relative to the top-left corner of the control's client-area
1060 * @see ConvertToControlPosition()
1062 Tizen::Graphics::FloatPoint ConvertToScreenPosition(const Tizen::Graphics::FloatPoint& controlPosition) const;
1065 * Sets the font of the control.
1069 * @return An error code
1070 * @param[in] fontName The app font name or system font name @n
1071 * The app font name is retrieved using Tizen::Graphics::Font::GetFaceName(Tizen::Base::String& filepath). @n
1072 * The system font name is retrieved using Tizen::Graphics::Font::GetSystemFontListN().
1073 * Sets an empty string to reset.
1074 * @exception E_SUCCESS The method is successful.
1075 * @exception E_FILE_NOT_FOUND The specified font cannot be found or accessed.
1076 * @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'.
1077 * 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().
1078 * @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.
1081 result SetFont(const Tizen::Base::String& fontName);
1084 * Checks whether the specified @c point is inside the control.
1088 * @return @c true if the specified @c point is inside the control, @n
1090 * @param[in] point The point to check
1091 * @remarks The specified @c point must be defined relative to the top-left corner of the control.
1093 bool Contains(const Tizen::Graphics::Point& point) const;
1096 * Checks whether the specified @c point is inside the control.
1100 * @return @c true if the specified @c point is inside the control, @n
1102 * @param[in] point The point to check
1103 * @remarks The specified @c point must be defined relative to the top-left corner of the control.
1105 bool Contains(const Tizen::Graphics::FloatPoint& point) const;
1108 * Checks whether the specified point is inside the control.
1112 * @return @c true if the specified point is inside the control, @n
1114 * @param[in] x The x position of the point to check
1115 * @param[in] y The y position of the point to check
1116 * @remarks The specified point must be defined relative to the top-left corner of the control.
1118 bool Contains(int x, int y) const;
1121 * Checks whether the specified point is inside the control.
1125 * @return @c true if the specified point is inside the control, @n
1127 * @param[in] x The x position of the point to check
1128 * @param[in] y The y position of the point to check
1129 * @remarks The specified point must be defined relative to the top-left corner of the control.
1131 bool Contains(float x, float y) const;
1134 * Draws child controls recursively.
1137 * @brief <i> [Compatibility] </i>
1142 * @compatibility This method has compatibility issues with OSP compatible applications. @n
1143 * For more information, see @ref CompDrawPage "here".
1145 * @return An error code
1146 * @exception E_SUCCESS The method is successful.
1147 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1148 * Note: This control cannot be displayed.
1149 * @exception E_SYSTEM A system error has occurred.
1150 * @remarks This method calls OnDraw() immediately in a synchronous way.
1157 * @page CompDrawPage Compatibility for Draw()
1158 * @section CompDrawPageIssueSection Issues
1159 * Implementation of this method in %Tizen API versions prior to 2.1 has the following issue: @n
1160 * -# Draw() method draws child controls in a recursive way regardless of the visibility of the parent.
1162 * @section CompDrawPageSolutionSection Resolutions
1163 * The issue mentioned above is resolved in %Tizen API version 2.1 as follows: @n
1164 * -# Draw() method does not draw child controls if the control itself is not visible.
1169 * Draws the control.
1173 * @param[in] recursive Set to @c true to draw child controls recursively, @n
1175 * @return An error code
1176 * @exception E_SUCCESS The method is successful.
1177 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1178 * Note: This control cannot be displayed.
1179 * @exception E_SYSTEM A system error has occurred.
1180 * @remarks This method calls OnDraw() immediately in a synchronous way.
1183 result Draw(bool recursive);
1186 * Shows the control on the screen.
1189 * @final Although this method is virtual, it should not be overridden.
1190 * If overridden, it may not work as expected.
1192 * @return An error code
1193 * @exception E_SUCCESS The method is successful.
1194 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1195 * Note: This control cannot be displayed.
1196 * @exception E_SYSTEM A system error has occurred.
1197 * @remarks Do not override this method.
1199 virtual result Show(void);
1202 * Invalidates the control.
1206 * @param[in] recursive Set to @c true to invalidate child controls recursively, @n
1208 * @exception E_SUCCESS The method is successful.
1209 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1210 * Note: This control cannot be displayed.
1211 * @exception E_SYSTEM A system error has occurred.
1212 * @remarks The specific error code can be accessed using the GetLastResult() method.
1213 * @remarks OnDraw() is not called immediately, but called asynchronously just before the screen is updated.
1214 * @see InvalidateBounds()
1217 void Invalidate(bool recursive);
1220 * Invalidates the control of the specified position and size.
1224 * @param[in] bounds The position relative to the top-left corner of the control
1225 * @exception E_SUCCESS The method is successful.
1226 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1227 * Note: This control cannot be displayed.
1228 * @remarks The specific error code can be accessed using the GetLastResult() method.
1232 void InvalidateBounds(const Tizen::Graphics::Rectangle& bounds);
1235 * Invalidates the control of the specified position and size.
1239 * @param[in] bounds The position relative to the top-left corner of the control
1240 * @exception E_SUCCESS The method is successful.
1241 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation. @n
1242 * Note: This control cannot be displayed.
1243 * @remarks The specific error code can be accessed using the GetLastResult() method.
1247 void InvalidateBounds(const Tizen::Graphics::FloatRectangle& bounds);
1250 * Draws the control asynchronously.
1254 * @param[in] show Set to @c true to also show the %Control, @n
1256 * @remarks This method posts a draw event in the event queue. @n
1257 * Drawing requested by %RequestRedraw() occurs when the draw event is fired to the control.
1259 void RequestRedraw(bool show = true) const;
1262 * Creates and returns a graphics canvas whose bounds (that is, position and size) are equal to those
1267 * @return The graphic canvas of the control, @n
1268 * else @c null if an exception occurs
1269 * @exception E_SUCCESS The method is successful.
1270 * @exception E_SYSTEM A system error has occurred.
1271 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
1272 * @remarks The method allocates a Tizen::Graphics::Canvas whose bounds are equal to that of the control.
1273 * It is the developer's responsibility to deallocate the canvas after use.
1274 * The canvas is guaranteed to be valid only if the properties of the parent controls of the canvas remain unchanged.
1275 * Therefore, one must delete previously allocated canvas and create a new canvas using the %GetCanvasN() method
1276 * if the size or position of the control is changed.
1277 * @remarks The specific error code can be accessed using the GetLastResult() method.
1278 * @remarks The Frame and Form (and between different Form instances) share a single frame-buffer. Therefore,
1279 * if custom drawing is performed on the graphic canvas of Frame and Form
1280 * then it will appear on the screen regardless of which control is currently visible on the screen.
1281 * @see GetCanvasN(const Tizen::Graphics::Rectangle& bounds) const
1282 * @see GetCanvasN(int x, int y, int width, int height) const
1285 * MyForm::OnDraw(void)
1287 * result r = E_SUCCESS;
1288 * Canvas* pCanvas = GetCanvasN();
1289 * if (pCanvas != null)
1291 * // add your drawing code here
1295 * // Do not call Show(). It will be called automatically after OnDraw() callback.
1300 Tizen::Graphics::Canvas* GetCanvasN(void) const;
1303 * Creates and returns a graphic canvas of the control of the specified position and size.
1307 * @return The graphic canvas of the control, @n
1308 * else @c null if an exception occurs
1309 * @param[in] bounds The bounds of the graphic canvas
1310 * @exception E_SUCCESS The method is successful.
1311 * @exception E_OUT_OF_RANGE The specified bounds does not intercept with the bounds of the control.
1312 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
1313 * @remarks Only the graphic canvas of displayable controls can be obtained.
1314 * If the specified area is not inside the control,
1315 * the graphics canvas of overlapped area between the control and the specified bound is returned. @n
1316 * @remarks The method allocates an Tizen::Graphics::Canvas whose bounds are equal to that of the control.
1317 * It is the developer's responsibility to deallocate the canvas after use.
1318 * The canvas is guaranteed to be valid only if the properties of the parent controls of the canvas remain unchanged.
1319 * Therefore, one must delete previously allocated canvas and create a new canvas using the %GetCanvasN() method
1320 * if the size or position of the control is changed.
1321 * @remarks The specific error code can be accessed using the GetLastResult() method.
1322 * @remarks The Frame and Form (and between different Form instances) share a single frame-buffer. Therefore,
1323 * if custom drawing is performed on the graphic canvas of Frame and Form
1324 * then it will appear on the screen regardless of which control is currently visible on the screen.
1325 * @see GetCanvasN(void) const
1326 * @see GetCanvasN(int x, int y, int width, int height) const
1328 Tizen::Graphics::Canvas* GetCanvasN(const Tizen::Graphics::Rectangle& bounds) const;
1331 * Creates and returns a graphic canvas of the control of the specified position and size.
1335 * @return The graphic canvas of the control, @n
1336 * else @c null if an exception occurs
1337 * @param[in] bounds The bounds of the graphic canvas
1338 * @exception E_SUCCESS The method is successful.
1339 * @exception E_OUT_OF_RANGE The specified bounds does not intercept with the bounds of the control.
1340 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
1341 * @remarks Only the graphic canvas of displayable controls can be obtained.
1342 * If the specified area is not inside the control,
1343 * the graphics canvas of overlapped area between the control and the specified bound is returned. @n
1344 * @remarks The method allocates an Tizen::Graphics::Canvas whose bounds are equal to that of the control.
1345 * It is the developer's responsibility to deallocate the canvas after use.
1346 * The canvas is guaranteed to be valid only if the properties of the parent controls of the canvas remain unchanged.
1347 * Therefore, one must delete previously allocated canvas and create a new canvas using the %GetCanvasN() method
1348 * if the size or position of the control is changed.
1349 * @remarks The specific error code can be accessed using the GetLastResult() method.
1350 * @remarks The Frame and Form (and between different Form instances) share a single frame-buffer. Therefore,
1351 * if custom drawing is performed on the graphic canvas of Frame and Form
1352 * then it will appear on the screen regardless of which control is currently visible on the screen.
1353 * @see GetCanvasN(void) const
1354 * @see GetCanvasN(float x, float y, float width, float height) const
1356 Tizen::Graphics::Canvas* GetCanvasN(const Tizen::Graphics::FloatRectangle& bounds) const;
1359 * Creates and returns a graphic canvas of the specified position and size in the control.
1363 * @return The graphic canvas of the control, @n
1364 * else @c null if an exception occurs
1365 * @param[in] x The x position relative to the top-left corner of the control
1366 * @param[in] y The y position relative to the top-left corner of the control
1367 * @param[in] width The width of a graphic canvas
1368 * @param[in] height The height of a graphic canvas
1369 * @exception E_SUCCESS The method is successful.
1370 * @exception E_OUT_OF_RANGE The specified bounds do not intercept with the bounds of the control.
1371 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
1372 * @remarks Only the graphic canvas of displayable controls can be obtained.
1373 * If the specified area is not inside the control,
1374 * the graphics canvas of the overlapped area between the control and the specified bound is returned. @n
1375 * @remarks The method allocates an Tizen::Graphics::Canvas whose bounds are equal to that of the control.
1376 * It is the developer's responsibility to deallocate the canvas after use.
1377 * The canvas is guaranteed to be valid only if properties of the parent controls of the canvas remain unchanged.
1378 * Therefore, one must delete the previously allocated canvas and create a new canvas using the %GetCanvasN() method
1379 * if the size or position of the control is changed.
1380 * @remarks The specific error code can be accessed using the GetLastResult() method.
1381 * @remarks The Frame and Form (and between different Form instances) share a single frame-buffer. Therefore,
1382 * if custom drawing is performed on the graphic canvas of Frame and Form
1383 * then it will appear on the screen regardless of which control is currently visible on the screen.
1384 * @see GetCanvasN(void) const
1385 * @see GetCanvasN(const Tizen::Graphics::Rectangle& bounds) const
1387 Tizen::Graphics::Canvas* GetCanvasN(int x, int y, int width, int height) const;
1390 * Creates and returns a graphic canvas of the specified position and size in the control.
1394 * @return The graphic canvas of the control, @n
1395 * else @c null if an exception occurs
1396 * @param[in] x The x position relative to the top-left corner of the control
1397 * @param[in] y The y position relative to the top-left corner of the control
1398 * @param[in] width The width of a graphic canvas
1399 * @param[in] height The height of a graphic canvas
1400 * @exception E_SUCCESS The method is successful.
1401 * @exception E_OUT_OF_RANGE The specified bounds do not intercept with the bounds of the control.
1402 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
1403 * @remarks Only the graphic canvas of displayable controls can be obtained.
1404 * If the specified area is not inside the control,
1405 * the graphics canvas of the overlapped area between the control and the specified bound is returned. @n
1406 * @remarks The method allocates an Tizen::Graphics::Canvas whose bounds are equal to that of the control.
1407 * It is the developer's responsibility to deallocate the canvas after use.
1408 * The canvas is guaranteed to be valid only if properties of the parent controls of the canvas remain unchanged.
1409 * Therefore, one must delete the previously allocated canvas and create a new canvas using the %GetCanvasN() method
1410 * if the size or position of the control is changed.
1411 * @remarks The specific error code can be accessed using the GetLastResult() method.
1412 * @remarks The Frame and Form (and between different Form instances) share a single frame-buffer. Therefore,
1413 * if custom drawing is performed on the graphic canvas of Frame and Form
1414 * then it will appear on the screen regardless of which control is currently visible on the screen.
1415 * @see GetCanvasN(void) const
1416 * @see GetCanvasN(const Tizen::Graphics::FloatRectangle& bounds) const
1418 Tizen::Graphics::Canvas* GetCanvasN(float x, float y, float width, float height) const;
1421 * Checks whether the control is currently visible on the screen.
1425 * @return @c true if the control is currently visible on the screen, @n
1427 * @remarks If this method is called before the control is added to a parent, @c false is returned.
1428 * @see GetShowState()
1429 * @see SetShowState()
1431 bool IsVisible(void) const;
1434 * Gets the current show state of the control.
1438 * @return The show state of the control
1439 * @remarks Even if the control's state is "show", the control may not be visible.
1440 * @see SetShowState()
1443 bool GetShowState(void) const;
1446 * Sets the show state of the control.
1450 * @return An error code
1451 * @param[in] state The new show state
1452 * @exception E_SUCCESS The method is successful.
1453 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
1454 * Note: This control cannot be displayed.
1455 * @exception E_SYSTEM A system error has occurred.
1456 * @remarks Do not override this method.
1457 * @remarks Even if this method is invoked, the control is not drawn or shown. @n
1458 * To display the control, use the Invalidate() methods. @n
1459 * Once the control's show state is set to @c false,
1460 * the show state needs to be set to @c true again before you invalidate the control.
1461 * @see GetShowState()
1464 result SetShowState(bool state);
1467 * Gets the dedicated %VisualElement instance for this control.
1471 * @return An instance of the VisualElement
1472 * @remarks If an application developer modifies the state of the returned VisualElement
1473 * and the host control is not aware of this change, then the control may behave egregiously.
1474 * It is highly recommended to restore the %VisualElement state to avoid such conflicts.
1476 Tizen::Ui::Animations::VisualElement* GetVisualElement(void) const;
1479 * Gets the parent of the control.
1483 * @return The current parent of the control
1485 Container* GetParent(void) const;
1488 * Gets the name of the control.
1492 * @return The name of the control
1494 Tizen::Base::String GetName(void) const;
1497 * Sets the name of the control.
1501 * @param[in] name The name of the control
1503 void SetName(const Tizen::Base::String& name);
1506 * Checks whether the control is focusable.
1510 * @return @c true if control is focusable, @n
1512 * @remarks The focus ability of the container classes like Panel is @c false by default.
1514 bool IsFocusable(void) const;
1517 * Sets the focus ability of the control. @n
1518 * Non-Focusable controls cannot take the key focus.
1522 * @return An error code
1523 * @exception E_SUCCESS The method is successful.
1524 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
1525 * Note: The control does not permit to change its focus ability.
1526 * @exception E_SYSTEM A system error has occurred.
1527 * @remarks The focus ability of the container classes like Panel is @c false by default.
1528 * @remarks The RadioGroup class does not render the UI.
1529 * Therefore, RadioGroup::SetFocusable() returns @c E_SYSTEM.
1531 result SetFocusable(bool focusable);
1534 * Checks whether the control currently has the input focus.
1538 * @return @c true if the control currently has the input focus, @n
1540 * @remarks If this method is called before the control is added to a parent, @c false is returned.
1543 bool HasFocus(void) const;
1546 * Sets the focus to the control. @n
1547 * This method is called if the control needs to listen to user input events such as key pressed.
1551 * @return An error code
1552 * @exception E_SUCCESS The method is successful.
1553 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
1554 * Note: This control cannot be displayed.
1555 * @exception E_INVALID_CONDITION The control is not contained in, or is not the top z-order frame or form.
1556 * @remarks Do not override this method.
1558 result SetFocus(void);
1561 * Checks whether the control is enabled.
1565 * @return @c true if the control is enabled, @n
1567 * @remarks If this method is called before the control is added to a parent, @c false is returned.
1570 bool IsEnabled(void) const;
1573 * Enables or disables the control. @n
1574 * Only an enabled control can respond to the user input. By default, the control is enabled.
1578 * @return An error code
1579 * @param[in] enable The new state of the object
1580 * @exception E_SUCCESS The method is successful.
1581 * @exception E_INVALID_OPERATION The current state of the instance prohibits the execution of the specified operation.
1582 * @exception E_SYSTEM A system error has occurred.
1583 * @remarks Do not override this method.
1585 result SetEnabled(bool enable);
1588 * Checks whether the device is in touch mode. @n
1589 * When the user interacts with the device by touching it, the device is in touch mode.
1593 * @return @c true if the device is in touch mode, @n
1595 * @remarks This method returns @c false, for devices with QWERTY keyboard.
1596 * The user can navigate the UI using directional keys.
1598 bool IsInTouchMode(void) const;
1601 * Enables or disables the drag operation in the %Control.
1605 * @param[in] enable Set to @c true to enable the drag operation, @n
1607 * @see SetDropEnabled()
1609 void SetDragEnabled(bool enable);
1612 * Enables or disables the drop operations in the %Control.
1616 * @param[in] enable Set to @c true to enable drop operations, @n
1618 * @remarks To receive drop event, control's drag property has to be enabled.
1619 * @see SetDragEnabled()
1621 void SetDropEnabled(bool enable);
1624 * Sends a user event to the control.
1628 * @param[in] requestId The user-defined event ID
1629 * @param[in] pArgs A pointer to the argument list
1630 * @remarks This method posts a user event in the event queue
1631 * and returns immediately to support asynchronous actions of the framework.
1632 * @see OnUserEventReceived()
1634 void SendUserEvent(RequestId requestId, const Tizen::Base::Collection::IList* pArgs) const;
1637 * Stops the current UI event dispatch sequence by indicating the current input event is consumed.
1639 * @brief <i> [Deprecated] </i>
1640 * @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.
1643 * @return An error code
1644 * @exception E_SUCCESS The method is successful.
1645 * @exception E_SYSTEM A system error has occurred.
1646 * @remarks If this method is invoked during an UI event (key or touch) propagation sequence,
1647 * the method will stop the propagation and consequently the system will not be notified of the event.@n
1648 * The method will not have any effect if no UI event is being dispatched. @n
1649 * It is recommended that this method is called within IKeyEventListener or
1650 * ITouchEventListener to stop the event from propagating to the next step.
1652 result ConsumeInputEvent(void);
1655 * Gets the control animator of the current instance of %Control.
1659 * @return A pointer to ControlAnimator, @n
1660 * else @c null if this instance is not constructed or not added to a parent or non-animatable
1662 Tizen::Ui::Animations::ControlAnimator* GetControlAnimator(void) const;
1665 * Adds the gesture detector to the %Control. @n
1666 * The added gesture detector receives touch events prior to %Control.
1668 * @brief <i> [Deprecated] </i>
1669 * @deprecated This API is deprecated.
1672 * @return An error code
1673 * @param[in] gestureDetector The gesture detector
1674 * @exception E_SUCCESS The method is successful.
1675 * @see RemoveGestureDetector()
1677 result AddGestureDetector(const TouchGestureDetector& gestureDetector);
1680 * Adds the gesture detector to the %Control. @n
1681 * The added gesture detector receives touch events prior to %Control.
1685 * @return An error code
1686 * @param[in] pGestureDetector Pointer of gesture detector
1687 * @exception E_SUCCESS The method is successful.
1688 * @exception E_INVALID_ARG The specified @c pGestureDetector is null.
1689 * @see RemoveGestureDetector()
1691 result AddGestureDetector(TouchGestureDetector* pGestureDetector);
1694 * Removes the gesture detector from the %Control.
1696 * @brief <i> [Deprecated] </i>
1697 * @deprecated This API is deprecated.
1700 * @return An error code
1701 * @param[in] gestureDetector The gesture detector
1702 * @exception E_SUCCESS The method is successful.
1703 * @see AddGestureDetector()
1705 result RemoveGestureDetector(const TouchGestureDetector& gestureDetector);
1708 * Removes the gesture detector from the %Control.
1712 * @return An error code
1713 * @param[in] pGestureDetector Pointer of gesture detector
1714 * @exception E_SUCCESS The method is successful.
1715 * @exception E_INVALID_ARG The specified @c pGestureDetector is null.
1716 * @see AddGestureDetector()
1718 result RemoveGestureDetector(TouchGestureDetector* pGestureDetector);
1722 * Gets the composite mode for merging with other controls.
1724 * @brief <i> [Deprecated] </i>
1725 * @deprecated This method is deprecated because changing composition mode is not allowed any more.
1728 * @return The composite mode
1729 * @exception E_SUCCESS The method is successful.
1730 * @remarks Since API version 2.1, this method only returns COMPOSITE_MODE_ALPHA_BLENDING.
1731 * @remarks The specific error code can be accessed using the GetLastResult() method.
1734 Tizen::Ui::CompositeMode GetCompositeMode(void) const;
1738 * Sets the composite mode for merging with other controls.
1740 * @brief <i> [Deprecated] </i>
1741 * @deprecated This method is deprecated because changing composition mode is not allowed any more.
1744 * @return An error code
1745 * @param[in] compositeMode The composite mode
1746 * @exception E_SUCCESS The method is successful.
1747 * @exception E_UNSUPPORTED_OPERATION The method is not supported.
1748 * @remarks In Tizen, only @c COMPOSITE_MODE_ALPHA_BLENDING is allowed.
1749 * Otherwise, this method returns @c E_UNSUPPORTED_OPERATION.
1752 result SetCompositeMode(Tizen::Ui::CompositeMode compositeMode);
1756 * Gets the chroma key color value that is used for the control composition.
1758 * @brief <i> [Deprecated] </i>
1759 * @deprecated This method is deprecated because chromakey color is not supported any more.
1762 * @return The chroma key color
1763 * @exception E_UNSUPPORTED_OPERATION The method is not supported.
1764 * @remarks In Tizen, this method always fails and returns Tizen::Graphics::Color(0, 0, 0, 0).
1765 * @remarks The specific error code can be accessed using the GetLastResult() method.
1768 Tizen::Graphics::Color GetChromaKeyColor(void) const;
1772 * Sets the chroma key color value that is used for the control composition.
1774 * @brief <i> [Deprecated] </i>
1775 * @deprecated This method is deprecated because chromakey color is not supported any more.
1778 * @return An error code
1779 * @param[in] chromaKeyColor The chroma key color
1780 * @exception E_UNSUPPORTED_OPERATION The method is not supported.
1781 * @remarks In Tizen, this method always fails.
1784 result SetChromaKeyColor(Tizen::Graphics::Color chromaKeyColor);
1787 * Sets the bounds of the content area.
1791 * @param[in] rect The bounds of the content area
1792 * @see GetContentAreaBounds()
1794 void SetContentAreaBounds(const Tizen::Graphics::Rectangle& rect);
1797 * Sets the bounds of the content area.
1801 * @param[in] rect The bounds of the content area
1802 * @see GetContentAreaBoundsF()
1804 void SetContentAreaBounds(const Tizen::Graphics::FloatRectangle& rect);
1807 * Gets the bounds of the content area.
1811 * @return The bounds of the content area
1812 * @see SetContentAreaBounds()
1814 Tizen::Graphics::Rectangle GetContentAreaBounds(void) const;
1817 * Gets the bounds of the content area.
1821 * @return The bounds of the content area
1822 * @see SetContentAreaBoundsF()
1824 Tizen::Graphics::FloatRectangle GetContentAreaBoundsF(void) const;
1827 * Captures the composited scene of the %Panel control.
1831 * @return A Tizen::Graphics::Bitmap instance that captures the current composited scene of the Panel control, @n
1832 * else @c null if an error occurs
1833 * @exception E_SUCCESS The method is successful.
1834 * @exception E_UNSUPPORTED_OPERATION This method is not supported.
1835 * @exception E_SYSTEM A system error has occurred.
1836 * @remarks The specific error code can be accessed using the GetLastResult() method.
1837 * @remarks This method is not supported in the following class that is derived from Panel class:
1839 * @remarks The bounds of the %Panel control must be within the client area of the Form control to get a valid composited scene.
1841 Tizen::Graphics::Bitmap* GetCapturedBitmapN(void) const;
1844 * Gets the position and the size of the invalidated bounds.
1848 * @return An instance of Tizen::Graphics::Rectangle that represents the position of top-left corner,
1849 * the width, and the height of the invalidated bounds
1851 Tizen::Graphics::Rectangle GetInvalidatedBounds(void) const;
1854 * Gets the position and the size of the invalidated bounds.
1858 * @return An instance of Tizen::Graphics::Rectangle that represents the position of top-left corner,
1859 * the width, and the height of the invalidated bounds
1861 Tizen::Graphics::FloatRectangle GetInvalidatedBoundsF(void) const;
1864 * Enables or disables the multi-point touch of the %Control.
1868 * @param[in] enable A Boolean flag indicating whether to enable the multi-point touch
1870 * @see IsMultipointTouchEnabled()
1872 void SetMultipointTouchEnabled(bool enable);
1875 * Checks whether the multi-point touch is enabled.
1879 * @return @c true if the multi-point touch is enabled, @n
1881 * @see SetMultipointTouchEnabled()
1883 bool IsMultipointTouchEnabled(void) const;
1886 * Gets the accessibility container.
1890 * @return The accessibility container of the control, if the control supports accessibility feature, @n
1892 * @see AccessibilityContainer::GetOwner()
1894 const AccessibilityContainer* GetAccessibilityContainer(void) const;
1897 * Gets the accessibility container.
1901 * @return The accessibility container of the control, if the control supports accessibility feature, @n
1903 * @see AccessibilityContainer::GetOwner()
1905 AccessibilityContainer* GetAccessibilityContainer(void);
1908 * Sets a propagated touch event listener to the %Control instance. @n
1909 * 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.
1913 * @param[in] pListener The event listener to which the propagated touch events are dispatched
1914 * @remarks The specified event listener should be allocated in heap memory.
1915 * To unregister the event listener, pass @c null to @c pListener.
1918 void SetPropagatedTouchEventListener(IPropagatedTouchEventListener* pListener);
1921 * Sets a propagated key event listener to the %Control instance.
1922 * 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.
1926 * @param[in] pListener The event listener to which the propagated touch events are dispatched
1927 * @remarks The specified event listener should be allocated in heap memory.
1928 * To unregister the event listener, pass @c null to @c pListener.
1931 void SetPropagatedKeyEventListener(IPropagatedKeyEventListener* pListener);
1935 * Sets the previous focus of the control.
1939 * @param[in] pPreviousFocus The pointer to the previous focus of the control
1940 * @remarks Focus UI supports linear navigation of controls from top-left to bottom-right direction. This method allows for customizing the default navigation behavior.
1941 * @remarks The platform will not take the ownership of @c pPreviousFocus after this call.
1942 * @see SetNextFocus()
1943 * @see GetPreviousFocus()
1945 void SetPreviousFocus(Control* pPreviousFocus);
1948 * Sets the next focus of the control.
1952 * @param[in] pNextFocus The pointer to the next focus of the control
1953 * @remarks Focus UI supports linear navigation of controls from top-left to bottom-right direction. This method allows for customizing the default navigation behavior.
1954 * @remarks The platform will not take the ownership of @c pNextFocus after this call.
1955 * @see SetPreviousFocus()
1956 * @see GetNextFocus()
1958 void SetNextFocus(Control* pNextFocus);
1961 * Gets the previous focus of the control.
1965 * @return The pointer to the previous focus of the control, @n
1966 * else @c null if the previous focus of the control is not set
1967 * @see GetNextFocus()
1968 * @see SetNextFocus ()
1970 Control* GetPreviousFocus(void) const;
1974 * Gets the next focus of the control.
1978 * @return The pointer to the next focus of the control, @n
1979 * else @c null if the next focus of the control is not set
1980 * @see GetPreviousFocus()
1981 * @see SetPreviousFocus ()
1983 Control* GetNextFocus(void) const;
1986 * Sets the touch press threshold of the Control in inch.
1990 * @param[in] distance The logical threshold to fire touch move event
1991 * @remark A touch move events will start to fire if the move distance exceeds the set allowance value.
1992 * For example, Set 0.5 if the distance is 0.5 inch.
1993 * This method is offered to control sensitivity of move events.
1995 void SetTouchPressThreshold(float distance);
1998 * Gets the touch press threshold of the Control in inch.
1999 * If the threshold has not been set, it returns the default value.
2003 * @return The threshold to fire touch move event
2005 float GetTouchPressThreshold(void) const;
2009 * Sets the font of the control with the specified file name.
2013 * @return An error code
2014 * @param[in] fileName The file name of a font-resource located in @b ‘/res/font’, @n
2015 * else an empty string to reset
2016 * @exception E_SUCCESS The method is successful.
2017 * @exception E_FILE_NOT_FOUND The specified font cannot be found or accessed.
2018 * @exception E_UNSUPPORTED_FORMAT The specified font format is not supported.
2019 * @see GetFontFile()
2021 result SetFontFromFile(const Tizen::Base::String& fileName);
2024 * Gets a font file name of the control.
2028 * @return The font name set in the control, @n
2029 * else an empty string if the font is not set
2030 * @see SetFontFromFile()
2032 Tizen::Base::String GetFontFile(void) const;
2036 * Gets the default key event listener.
2038 * @brief <i> [Deprecated] </i>
2039 * @deprecated This method is deprecated.
2042 * @return The default key event listener @n
2043 * If no listener has been set or a system error has occurred @c null is returned.
2044 * @see SetDefaultKeyEventListener()
2046 IKeyEventListener* GetDefaultkeyEventListener(void) const;
2049 * Gets the default touch event listener.
2051 * @brief <i> [Deprecated] </i>
2052 * @deprecated This method is deprecated.
2055 * @return The default touch event listener @n
2056 * If no listener has been set or a system error has occurred @c null is returned.
2057 * @see SetDefaultTouchEventListener()
2059 ITouchEventListener* GetDefaultTouchEventListener(void) const;
2062 * Sets the default key event listener.
2064 * @brief <i> [Deprecated] </i>
2065 * @deprecated This method is deprecated. Instead of using this method, use the SetPropagatedKeyEventListener() method.
2068 * @return An error code
2069 * @param[in] pDefaultListener The default key event listener
2070 * @exception E_SUCCESS The method is successful.
2071 * @exception E_SYSTEM A system error has occurred.
2072 * @remarks The registered listener will be notified to handle the key events
2073 * after all application event listeners has been notified.
2074 * @see GetDefaultkeyEventListener()
2076 result SetDefaultKeyEventListener(IKeyEventListener* pDefaultListener);
2079 * Sets the default touch event listener.
2081 * @brief <i> [Deprecated] </i>
2082 * @deprecated This method is deprecated. Instead of using this method, use the SetPropagatedTouchEventListener() method.
2085 * @return An error code
2086 * @param[in] pDefaultListener The default key event listener
2087 * @exception E_SUCCESS The method is successful.
2088 * @exception E_SYSTEM A system error has occurred.
2089 * @remarks The registered listener will be notified to handle the touch events
2090 * after all application event listeners has been notified.
2091 * @see GetDefaultTouchEventListener()
2093 result SetDefaultTouchEventListener(ITouchEventListener* pDefaultListener);
2096 * 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.
2103 * This method is for internal use only. Using this method can cause behavioral, security-related,
2104 * and consistency-related issues in the application.
2106 * Initializes this instance of %Control.
2109 * @return An error code
2110 * @exception E_SUCCESS The method is successful.
2111 * @exception E_SYSTEM A system error has occurred.
2113 result Construct(void);
2116 * Frees the resources allocated by Construct().
2123 _ControlImpl* _pControlImpl;
2126 // This method is for internal use only. Using this method can cause behavioral, security-related,
2127 // and consistency-related issues in the application.
2129 // This method is reserved and may change its name at any time without prior notice.
2131 virtual void Control_Reserved1(void) {}
2134 // This method is for internal use only. Using this method can cause behavioral, security-related,
2135 // and consistency-related issues in the application.
2137 // This method is reserved and may change its name at any time without prior notice.
2139 virtual void Control_Reserved2(void) {}
2142 // This method is for internal use only. Using this method can cause behavioral, security-related,
2143 // and consistency-related issues in the application.
2145 // This method is reserved and may change its name at any time without prior notice.
2147 virtual void Control_Reserved3(void) {}
2150 // This method is for internal use only. Using this method can cause behavioral, security-related,
2151 // and consistency-related issues in the application.
2153 // This method is reserved and may change its name at any time without prior notice.
2155 virtual void Control_Reserved4(void) {}
2158 // This method is for internal use only. Using this method can cause behavioral, security-related,
2159 // and consistency-related issues in the application.
2161 // This method is reserved and may change its name at any time without prior notice.
2164 virtual void Control_Reserved5(void) {}
2167 // This method is for internal use only. Using this method can cause behavioral, security-related,
2168 // and consistency-related issues in the application.
2170 // This method is reserved and may change its name at any time without prior notice.
2172 virtual void Control_Reserved6(void) {}
2176 // The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
2178 Control(const Control& rhs);
2181 // The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
2183 Control& operator =(const Control& rhs);
2186 friend class _ControlImpl;
2191 #endif // _FUI_CONTROL_H_