Tizen Native API
4.0
|
Control is the base class for all controls. More...
Classes | |
struct | KeyboardFocus |
Describes the direction to move the keyboard focus towards. More... | |
struct | Property |
Enumeration for the instance of properties belonging to the Control class. More... | |
Public Types | |
enum | PropertyRange |
Enumeration for the start and end property ranges for control. More... | |
typedef Signal< bool(Control, const KeyEvent &) > | KeyEventSignalType |
Key Event signal type. | |
typedef Signal< void(Control) > | KeyInputFocusSignalType |
Key InputFocusType signal type. | |
typedef Signal< void(Control) > | ResourceReadySignalType |
ResourceReady signal type. | |
Public Member Functions | |
Control () | |
Creates an uninitialized Control handle. | |
Control (const Control &uiControl) | |
Copy constructor. | |
~Control () | |
Dali::Control is intended as a base class. | |
Control & | operator= (const Control &handle) |
Assignment operator. | |
void | SetKeyInputFocus () |
This sets the control to receive key events. | |
bool | HasKeyInputFocus () |
Quries whether the control has key input focus. | |
void | ClearKeyInputFocus () |
Once an actor is Set to receive key input focus this function is called to stop it receiving key events. | |
PinchGestureDetector | GetPinchGestureDetector () const |
Retrieves the pinch gesture detector of the control. | |
PanGestureDetector | GetPanGestureDetector () const |
Retrieves the pan gesture detector of the control. | |
TapGestureDetector | GetTapGestureDetector () const |
Retrieves the tap gesture detector of the control. | |
LongPressGestureDetector | GetLongPressGestureDetector () const |
Retrieves the long press gesture detector of the control. | |
void | SetStyleName (const std::string &styleName) |
Sets the name of the style to be applied to the control. | |
const std::string & | GetStyleName () const |
Retrieves the name of the style to be applied to the control (if any). | |
void | SetBackgroundColor (const Vector4 &color) |
Sets the background color of the control. | |
Vector4 | GetBackgroundColor () const DALI_DEPRECATED_API |
Retrieves the background color of the control. | |
void | SetBackgroundImage (Image image) DALI_DEPRECATED_API |
Sets an image as the background of the control. | |
void | ClearBackground () |
Clears the background. | |
bool | IsResourceReady () const |
Query if all resources required by a control are loaded and ready. | |
Visual::ResourceStatus | GetVisualResourceStatus (const Dali::Property::Index index) |
Get the loading state of the visual resource. | |
KeyEventSignalType & | KeyEventSignal () |
This signal is emitted when key event is received. | |
KeyInputFocusSignalType & | KeyInputFocusGainedSignal () |
This signal is emitted when the control gets Key Input Focus. | |
KeyInputFocusSignalType & | KeyInputFocusLostSignal () |
This signal is emitted when the control loses Key Input Focus. | |
ResourceReadySignalType & | ResourceReadySignal () |
This signal is emitted after all resources required by a control are loaded and ready. | |
Control (Internal::Control &implementation) | |
Creates an initialized Control. | |
Control (Dali::Internal::CustomActor *internal) | |
This constructor is used by CustomActor within Dali core to create additional Control handles using an Internal CustomActor pointer. | |
template<typename I > | |
void | VerifyCustomActorPointer (Dali::Internal::CustomActor *internal) |
Template to allow deriving controls to verify whether the Internal::CustomActor* is actually an implementation of their class. | |
Static Public Member Functions | |
static Control | New () |
Creates a new instance of a Control. | |
static Control | DownCast (BaseHandle handle) |
Downcasts a handle to Control handle. | |
template<typename T , typename I > | |
static T | DownCast (BaseHandle handle) |
Template to allow deriving controls to DownCast handles to deriving handle classes. |
Control is the base class for all controls.
The implementation of the control must be supplied; see Internal::Control for more details.
Signals | Signal Name | Method | |------------------------|-----------------------------------------------------| | keyEvent | KeyEventSignal() | | keyInputFocusGained | KeyInputFocusGainedSignal() | | keyInputFocusLost | KeyInputFocusLostSignal() | | resourceReady | ResourceReadySignal() | | tapped | GetTapGestureDetector().DetectedSignal() | | panned | GetPanGestureDetector().DetectedSignal() | | pinched | GetPinchGestureDetector().DetectedSignal() | | longPressed | GetLongPressGestureDetector().DetectedSignal() |
Actions | Action Name | Control method called | |------------------------|----------------------------------------------------| | accessibilityActivated | OnAccessibilityActivated() |
typedef Signal<bool ( Control, const KeyEvent& ) > Dali::Toolkit::Control::KeyEventSignalType |
Key Event signal type.
typedef Signal<void ( Control ) > Dali::Toolkit::Control::KeyInputFocusSignalType |
Key InputFocusType signal type.
typedef Signal<void ( Control ) > Dali::Toolkit::Control::ResourceReadySignalType |
ResourceReady signal type.
Enumeration for the start and end property ranges for control.
PROPERTY_START_INDEX |
Start index is used by the property registration macro.
|
CONTROL_PROPERTY_START_INDEX |
Start index of Control properties.
|
CONTROL_PROPERTY_END_INDEX |
Reserving 1000 property indices.
|
Reimplemented in Dali::Toolkit::ScrollView, Dali::Toolkit::FlexContainer, Dali::Toolkit::Button, Dali::Toolkit::PushButton, Dali::Toolkit::TableView, Dali::Toolkit::ImageView, Dali::Toolkit::ItemView, Dali::Toolkit::VideoView, Dali::Toolkit::TextLabel, Dali::WidgetView::WidgetView, Dali::Toolkit::ScrollBar, Dali::Toolkit::Scrollable, Dali::Toolkit::ProgressBar, Dali::Toolkit::Slider, Dali::Toolkit::TextEditor, Dali::Toolkit::TextField, and Dali::Toolkit::Model3dView.
Creates an uninitialized Control handle.
Only derived versions can be instantiated. Calling member functions with an uninitialized Dali::Object is not allowed.
Dali::Toolkit::Control::Control | ( | const Control & | uiControl | ) |
Copy constructor.
Creates another handle that points to the same real object.
[in] | uiControl | Handle to copy |
Dali::Control is intended as a base class.
This is non-virtual since derived Handle types must not contain data or virtual methods.
Dali::Toolkit::Control::Control | ( | Internal::Control & | implementation | ) | [explicit] |
Dali::Toolkit::Control::Control | ( | Dali::Internal::CustomActor * | internal | ) | [explicit] |
This constructor is used by CustomActor within Dali core to create additional Control handles using an Internal CustomActor pointer.
[in] | internal | A pointer to a newly allocated Dali resource |
Clears the background.
Once an actor is Set to receive key input focus this function is called to stop it receiving key events.
A check is performed to ensure it was previously set, if this check fails then nothing is done.
static Control Dali::Toolkit::Control::DownCast | ( | BaseHandle | handle | ) | [static] |
Downcasts a handle to Control handle.
If handle points to a Control, the downcast produces valid handle. If not, the returned handle is left uninitialized.
[in] | handle | Handle to an object |
Reimplemented from Dali::CustomActor.
Reimplemented in Dali::Toolkit::ScrollView, Dali::Toolkit::TextField, Dali::Toolkit::TextEditor, Dali::Toolkit::TextLabel, Dali::Toolkit::FlexContainer, Dali::Toolkit::VideoView, Dali::Toolkit::ItemView, Dali::Toolkit::TableView, Dali::Toolkit::Button, Dali::Toolkit::ScrollBar, Dali::Toolkit::ImageView, Dali::Toolkit::Slider, Dali::Toolkit::ProgressBar, Dali::WidgetView::WidgetView, Dali::Toolkit::PushButton, Dali::Toolkit::Alignment, Dali::Toolkit::Model3dView, Dali::Toolkit::Scrollable, Dali::Toolkit::RadioButton, and Dali::Toolkit::CheckBoxButton.
static T Dali::Toolkit::Control::DownCast | ( | BaseHandle | handle | ) | [static] |
Template to allow deriving controls to DownCast handles to deriving handle classes.
T | The handle class |
I | The implementation class |
[in] | handle | Handle to an object |
Reimplemented from Dali::CustomActor.
Reimplemented in Dali::Toolkit::ScrollView, Dali::Toolkit::TextField, Dali::Toolkit::TextEditor, Dali::Toolkit::TextLabel, Dali::Toolkit::FlexContainer, Dali::Toolkit::VideoView, Dali::Toolkit::ItemView, Dali::Toolkit::TableView, Dali::Toolkit::Button, Dali::Toolkit::ScrollBar, Dali::Toolkit::ImageView, Dali::Toolkit::Slider, Dali::Toolkit::ProgressBar, Dali::WidgetView::WidgetView, Dali::Toolkit::PushButton, Dali::Toolkit::Alignment, Dali::Toolkit::Model3dView, Dali::Toolkit::Scrollable, Dali::Toolkit::RadioButton, and Dali::Toolkit::CheckBoxButton.
Retrieves the background color of the control.
Retrieves the long press gesture detector of the control.
Retrieves the pan gesture detector of the control.
Retrieves the pinch gesture detector of the control.
const std::string& Dali::Toolkit::Control::GetStyleName | ( | ) | const |
Retrieves the name of the style to be applied to the control (if any).
Retrieves the tap gesture detector of the control.
Visual::ResourceStatus Dali::Toolkit::Control::GetVisualResourceStatus | ( | const Dali::Property::Index | index | ) |
Get the loading state of the visual resource.
[in] | index | The Property index of the visual |
Quries whether the control has key input focus.
bool Dali::Toolkit::Control::IsResourceReady | ( | ) | const |
Query if all resources required by a control are loaded and ready.
Most resources are only loaded when the control is placed on stage.
This signal is emitted when key event is received.
A callback of the following type may be connected:
bool YourCallbackName(Control control, const KeyEvent& event);
The return value of True, indicates that the event should be consumed. Otherwise the signal will be emitted on the next parent of the actor.
This signal is emitted when the control gets Key Input Focus.
A callback of the following type may be connected:
bool YourCallbackName( Control control );
The return value of True, indicates that the event should be consumed. Otherwise the signal will be emitted on the next parent of the actor.
This signal is emitted when the control loses Key Input Focus.
This could be due to it being gained by another Control or Actor or just cleared from this control as no longer required.
A callback of the following type may be connected:
bool YourCallbackName( Control control );
The return value of True, indicates that the event should be consumed. Otherwise the signal will be emitted on the next parent of the actor.
static Control Dali::Toolkit::Control::New | ( | ) | [static] |
Creates a new instance of a Control.
Reimplemented from Dali::Actor.
Reimplemented in Dali::Toolkit::ScrollView, Dali::Toolkit::TextField, Dali::Toolkit::TextEditor, Dali::Toolkit::TextLabel, Dali::Toolkit::FlexContainer, Dali::Toolkit::VideoView, Dali::Toolkit::Slider, Dali::Toolkit::ProgressBar, Dali::Toolkit::PushButton, Dali::Toolkit::ImageView, Dali::Toolkit::RadioButton, Dali::Toolkit::CheckBoxButton, and Dali::Toolkit::Model3dView.
Assignment operator.
Changes this handle to point to another real object.
[in] | handle | Object to assign this to |
This signal is emitted after all resources required by a control are loaded and ready.
Most resources are only loaded when the control is placed on stage.
If resources are shared between ImageViews, they are cached. In this case, the ResourceReady signal may be sent before there is an object to connect to. To protect against this, IsResourceReady() can be checked first.
auto newControl = Control::New(); newControl.SetResource( resourceUrl ); if ( newControl.IsResourceReady() ) { // do something } else { newControl.ResourceReadySignal.Connect( .... ) }
A callback of the following type may be connected:
void YourCallbackName( Control control );
void Dali::Toolkit::Control::SetBackgroundColor | ( | const Vector4 & | color | ) |
Sets the background color of the control.
[in] | color | The required background color of the control |
void Dali::Toolkit::Control::SetBackgroundImage | ( | Image | image | ) |
Sets an image as the background of the control.
[in] | image | The image to set as the background |
void Dali::Toolkit::Control::SetStyleName | ( | const std::string & | styleName | ) |
Sets the name of the style to be applied to the control.
[in] | styleName | A string matching a style described in a stylesheet |
void Dali::Toolkit::Control::VerifyCustomActorPointer | ( | Dali::Internal::CustomActor * | internal | ) |
Template to allow deriving controls to verify whether the Internal::CustomActor* is actually an implementation of their class.
I | The implementation class |
[in] | internal | Pointer to the Internal::CustomActor |