Tizen Native API
5.0
|
This is the internal base class for all controls. More...
Public Member Functions | |
void | SetStyleName (const std::string &styleName) |
const std::string & | GetStyleName () const |
void | SetBackgroundColor (const Vector4 &color) |
Vector4 | GetBackgroundColor () const |
void | SetBackgroundImage (Image image) |
void | SetBackground (const Property::Map &map) |
Sets the background with a property map. | |
void | ClearBackground () |
void | EnableGestureDetection (Gesture::Type type) |
Allows deriving classes to enable any of the gesture detectors that are available. | |
void | DisableGestureDetection (Gesture::Type type) |
Allows deriving classes to disable any of the gesture detectors. | |
PinchGestureDetector | GetPinchGestureDetector () const |
If deriving classes wish to fine tune pinch gesture detection, then they can access the gesture detector through this API and modify the detection. | |
PanGestureDetector | GetPanGestureDetector () const |
If deriving classes wish to fine tune pan gesture detection, then they can access the gesture detector through this API and modify the detection. | |
TapGestureDetector | GetTapGestureDetector () const |
If deriving classes wish to fine tune tap gesture detection, then they can access the gesture detector through this API and modify the detection. | |
LongPressGestureDetector | GetLongPressGestureDetector () const |
If deriving classes wish to fine tune long press gesture detection, then they can access the gesture detector through this API and modify the detection. | |
void | SetKeyboardNavigationSupport (bool isSupported) |
Sets whether this control supports two dimensional keyboard navigation (i.e. whether it knows how to handle the keyboard focus movement between its child actors). | |
bool | IsKeyboardNavigationSupported () |
Gets whether this control supports two dimensional keyboard navigation. | |
void | SetKeyInputFocus () |
bool | HasKeyInputFocus () |
void | ClearKeyInputFocus () |
void | SetAsKeyboardFocusGroup (bool isFocusGroup) |
Sets whether this control is a focus group for keyboard navigation. | |
bool | IsKeyboardFocusGroup () |
Gets whether this control is a focus group for keyboard navigation. | |
Toolkit::Control::KeyEventSignalType & | KeyEventSignal () |
Toolkit::Control::KeyInputFocusSignalType & | KeyInputFocusGainedSignal () |
Toolkit::Control::KeyInputFocusSignalType & | KeyInputFocusLostSignal () |
virtual void | OnInitialize () |
This method is called after the Control has been initialized. | |
virtual void | OnControlChildAdd (Actor &child) DALI_DEPRECATED_API |
Called whenever an Actor is added to the control. | |
virtual void | OnControlChildRemove (Actor &child) DALI_DEPRECATED_API |
Called whenever an Actor is removed from the control. | |
virtual void | OnStyleChange (Toolkit::StyleManager styleManager, StyleChange::Type change) |
This method should be overridden by deriving classes requiring notifications when the style changes. | |
virtual bool | OnAccessibilityActivated () |
This method is called when the control is accessibility activated. | |
virtual bool | OnAccessibilityPan (PanGesture gesture) |
This method should be overridden by deriving classes when they wish to respond the accessibility pan gesture. | |
virtual bool | OnAccessibilityTouch (const TouchEvent &touchEvent) |
This method should be overridden by deriving classes when they wish to respond the accessibility touch event. | |
virtual bool | OnAccessibilityValueChange (bool isIncrease) |
This method should be overridden by deriving classes when they wish to respond the accessibility up and down action (i.e. value change of slider control). | |
virtual bool | OnAccessibilityZoom () |
This method should be overridden by deriving classes when they wish to respond the accessibility zoom action. | |
virtual void | OnKeyInputFocusGained () |
Called when the control gains key input focus. | |
virtual void | OnKeyInputFocusLost () |
Called when the control loses key input focus. | |
virtual Actor | GetNextKeyboardFocusableActor (Actor currentFocusedActor, Toolkit::Control::KeyboardFocus::Direction direction, bool loopEnabled) |
Gets the next keyboard focusable actor in this control towards the given direction. | |
virtual void | OnKeyboardFocusChangeCommitted (Actor commitedFocusableActor) |
Informs this control that its chosen focusable actor will be focused. | |
virtual bool | OnKeyboardEnter () |
This method is called when the control has enter pressed on it. | |
virtual void | OnPinch (const PinchGesture &pinch) |
Called whenever a pinch gesture is detected on this control. | |
virtual void | OnPan (const PanGesture &pan) |
Called whenever a pan gesture is detected on this control. | |
virtual void | OnTap (const TapGesture &tap) |
Called whenever a tap gesture is detected on this control. | |
virtual void | OnLongPress (const LongPressGesture &longPress) |
Called whenever a long press gesture is detected on this control. | |
virtual void | SignalConnected (SlotObserver *slotObserver, CallbackBase *callback) |
virtual void | SignalDisconnected (SlotObserver *slotObserver, CallbackBase *callback) |
virtual Extension * | GetControlExtension () |
Retrieves the extension for this control. | |
Static Public Member Functions | |
static Toolkit::Control | New () |
Forward declare future extension interface. | |
Protected Types | |
enum | ControlBehaviour |
Flags for the constructor. More... | |
Protected Member Functions | |
virtual | ~Control () |
Virtual destructor. | |
void | EmitKeyInputFocusSignal (bool focusGained) |
Emits KeyInputFocusGained signal if true else emits KeyInputFocusLost signal. | |
virtual void | OnStageConnection (int depth) |
virtual void | OnStageDisconnection () |
virtual void | OnChildAdd (Actor &child) |
virtual void | OnChildRemove (Actor &child) |
virtual void | OnPropertySet (Property::Index index, Property::Value propertyValue) |
virtual void | OnSizeSet (const Vector3 &targetSize) |
virtual void | OnSizeAnimation (Animation &animation, const Vector3 &targetSize) |
virtual bool | OnTouchEvent (const TouchEvent &event) |
virtual bool | OnHoverEvent (const HoverEvent &event) |
virtual bool | OnKeyEvent (const KeyEvent &event) |
virtual bool | OnWheelEvent (const WheelEvent &event) |
virtual void | OnRelayout (const Vector2 &size, RelayoutContainer &container) |
virtual void | OnSetResizePolicy (ResizePolicy::Type policy, Dimension::Type dimension) |
virtual Vector3 | GetNaturalSize () |
virtual float | CalculateChildSize (const Dali::Actor &child, Dimension::Type dimension) |
virtual float | GetHeightForWidth (float width) |
virtual float | GetWidthForHeight (float height) |
virtual bool | RelayoutDependentOnChildren (Dimension::Type dimension=Dimension::ALL_DIMENSIONS) |
virtual void | OnCalculateRelayoutSize (Dimension::Type dimension) |
virtual void | OnLayoutNegotiated (float size, Dimension::Type dimension) |
Control (ControlBehaviour behaviourFlags) | |
Control constructor. | |
void | Initialize () |
Second phase initialization. | |
Static Protected Attributes | |
static const int | CONTROL_BEHAVIOUR_FLAG_COUNT = Log< LAST_CONTROL_BEHAVIOUR_FLAG - 1 >::value + 1 |
Total count of flags. |
This is the internal base class for all controls.
It will provide some common functionality required by all controls. Implements ConnectionTrackerInterface so that signals (typically connected to member functions) will be disconnected automatically when the control is destroyed.
enum Dali::Toolkit::Internal::Control::ControlBehaviour [protected] |
Flags for the constructor.
CONTROL_BEHAVIOUR_DEFAULT |
Default behaviour: Size negotiation is enabled & listens to Style Change signal, but doesn't receive event callbacks.
|
REQUIRES_STYLE_CHANGE_SIGNALS |
True if needs to monitor style change signals such as theme/font change.
|
REQUIRES_KEYBOARD_NAVIGATION_SUPPORT |
True if needs to support keyboard navigation.
|
DISABLE_STYLE_CHANGE_SIGNALS |
True if control should not monitor style change signals.
|
virtual Dali::Toolkit::Internal::Control::~Control | ( | ) | [protected, virtual] |
Virtual destructor.
Dali::Toolkit::Internal::Control::Control | ( | ControlBehaviour | behaviourFlags | ) | [protected] |
Control constructor.
[in] | behaviourFlags | Behavioural flags from ControlBehaviour enum |
virtual float Dali::Toolkit::Internal::Control::CalculateChildSize | ( | const Dali::Actor & | child, |
Dimension::Type | dimension | ||
) | [protected, virtual] |
Calculates the size for a child.
[in] | child | The child actor to calculate the size for |
[in] | dimension | The dimension to calculate the size for. E.g. width or height |
Implements Dali::CustomActorImpl.
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.
Allows deriving classes to disable any of the gesture detectors.
Like EnableGestureDetection, this can also be called using bitwise or.
[in] | type | The gesture type(s) to disable |
void Dali::Toolkit::Internal::Control::EmitKeyInputFocusSignal | ( | bool | focusGained | ) | [protected] |
Emits KeyInputFocusGained signal if true else emits KeyInputFocusLost signal.
Should be called last by the control after it acts on the Input Focus change.
[in] | focusGained | True if gained, False if lost |
Allows deriving classes to enable any of the gesture detectors that are available.
Gesture detection can be enabled one at a time or in bitwise format as shown:
[in] | type | The gesture type(s) to enable |
Retrieves the background color of the control.
virtual Extension* Dali::Toolkit::Internal::Control::GetControlExtension | ( | ) | [virtual] |
Retrieves the extension for this control.
virtual float Dali::Toolkit::Internal::Control::GetHeightForWidth | ( | float | width | ) | [protected, virtual] |
This method is called during size negotiation when a height is required for a given width.
Derived classes should override this if they wish to customize the height returned.
[in] | width | Width to use |
Implements Dali::CustomActorImpl.
If deriving classes wish to fine tune long press gesture detection, then they can access the gesture detector through this API and modify the detection.
virtual Vector3 Dali::Toolkit::Internal::Control::GetNaturalSize | ( | ) | [protected, virtual] |
Returns the natural size of the actor.
Implements Dali::CustomActorImpl.
virtual Actor Dali::Toolkit::Internal::Control::GetNextKeyboardFocusableActor | ( | Actor | currentFocusedActor, |
Toolkit::Control::KeyboardFocus::Direction | direction, | ||
bool | loopEnabled | ||
) | [virtual] |
Gets the next keyboard focusable actor in this control towards the given direction.
A control needs to override this function in order to support two dimensional keyboard navigation.
[in] | currentFocusedActor | The current focused actor |
[in] | direction | The direction to move the focus towards |
[in] | loopEnabled | Whether the focus movement should be looped within the control |
If deriving classes wish to fine tune pan gesture detection, then they can access the gesture detector through this API and modify the detection.
If deriving classes wish to fine tune pinch gesture detection, then they can access the gesture detector through this API and modify the detection.
const std::string& Dali::Toolkit::Internal::Control::GetStyleName | ( | ) | const |
Retrieves the name of the style to be applied to the control (if any).
If deriving classes wish to fine tune tap gesture detection, then they can access the gesture detector through this API and modify the detection.
virtual float Dali::Toolkit::Internal::Control::GetWidthForHeight | ( | float | height | ) | [protected, virtual] |
This method is called during size negotiation when a width is required for a given height.
Derived classes should override this if they wish to customize the width returned.
[in] | height | Height to use |
Implements Dali::CustomActorImpl.
Quries whether the control has key input focus.
void Dali::Toolkit::Internal::Control::Initialize | ( | ) | [protected] |
Second phase initialization.
Gets whether this control is a focus group for keyboard navigation.
Gets whether this control supports two dimensional keyboard navigation.
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.
Toolkit::Control::KeyInputFocusSignalType& Dali::Toolkit::Internal::Control::KeyInputFocusGainedSignal | ( | ) |
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.
Toolkit::Control::KeyInputFocusSignalType& Dali::Toolkit::Internal::Control::KeyInputFocusLostSignal | ( | ) |
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 Toolkit::Control Dali::Toolkit::Internal::Control::New | ( | ) | [static] |
Forward declare future extension interface.
Creates a new ControlImpl instance that does not require touch by default.
If touch is required, then the user can connect to this class' touch signal.
virtual bool Dali::Toolkit::Internal::Control::OnAccessibilityActivated | ( | ) | [virtual] |
This method is called when the control is accessibility activated.
Derived classes should override this to perform custom accessibility activation.
virtual bool Dali::Toolkit::Internal::Control::OnAccessibilityPan | ( | PanGesture | gesture | ) | [virtual] |
This method should be overridden by deriving classes when they wish to respond the accessibility pan gesture.
[in] | gesture | The pan gesture |
virtual bool Dali::Toolkit::Internal::Control::OnAccessibilityTouch | ( | const TouchEvent & | touchEvent | ) | [virtual] |
This method should be overridden by deriving classes when they wish to respond the accessibility touch event.
[in] | touchEvent | The touch event |
virtual bool Dali::Toolkit::Internal::Control::OnAccessibilityValueChange | ( | bool | isIncrease | ) | [virtual] |
This method should be overridden by deriving classes when they wish to respond the accessibility up and down action (i.e. value change of slider control).
[in] | isIncrease | Whether the value should be increased or decreased |
virtual bool Dali::Toolkit::Internal::Control::OnAccessibilityZoom | ( | ) | [virtual] |
This method should be overridden by deriving classes when they wish to respond the accessibility zoom action.
virtual void Dali::Toolkit::Internal::Control::OnCalculateRelayoutSize | ( | Dimension::Type | dimension | ) | [protected, virtual] |
Virtual method to notify deriving classes that relayout dependencies have been met and the size for this object is about to be calculated for the given dimension.
[in] | dimension | The dimension that is about to be calculated |
Implements Dali::CustomActorImpl.
virtual void Dali::Toolkit::Internal::Control::OnChildAdd | ( | Actor & | child | ) | [protected, virtual] |
Called after a child has been added to the owning actor.
[in] | child | The child which has been added |
Implements Dali::CustomActorImpl.
virtual void Dali::Toolkit::Internal::Control::OnChildRemove | ( | Actor & | child | ) | [protected, virtual] |
Called after the owning actor has attempted to remove a child (regardless of whether it succeeded or not).
[in] | child | The child being removed |
Implements Dali::CustomActorImpl.
virtual void Dali::Toolkit::Internal::Control::OnControlChildAdd | ( | Actor & | child | ) | [virtual] |
Called whenever an Actor is added to the control.
Could be overridden by derived classes.
[in] | child | The added actor |
virtual void Dali::Toolkit::Internal::Control::OnControlChildRemove | ( | Actor & | child | ) | [virtual] |
Called whenever an Actor is removed from the control.
Could be overridden by derived classes.
[in] | child | The removed actor |
virtual bool Dali::Toolkit::Internal::Control::OnHoverEvent | ( | const HoverEvent & | event | ) | [protected, virtual] |
Called after a hover-event is received by the owning actor.
[in] | event | The hover event |
Implements Dali::CustomActorImpl.
virtual void Dali::Toolkit::Internal::Control::OnInitialize | ( | ) | [virtual] |
This method is called after the Control has been initialized.
Derived classes should do any second phase initialization by overriding this method.
virtual bool Dali::Toolkit::Internal::Control::OnKeyboardEnter | ( | ) | [virtual] |
This method is called when the control has enter pressed on it.
Derived classes should override this to perform custom actions.
virtual void Dali::Toolkit::Internal::Control::OnKeyboardFocusChangeCommitted | ( | Actor | commitedFocusableActor | ) | [virtual] |
Informs this control that its chosen focusable actor will be focused.
This allows the application to perform any actions if wishes before the focus is actually moved to the chosen actor.
[in] | commitedFocusableActor | The commited focusable actor |
virtual bool Dali::Toolkit::Internal::Control::OnKeyEvent | ( | const KeyEvent & | event | ) | [protected, virtual] |
Called after a key-event is received by the actor that has had its focus set.
[in] | event | The Key Event |
Implements Dali::CustomActorImpl.
virtual void Dali::Toolkit::Internal::Control::OnKeyInputFocusGained | ( | ) | [virtual] |
Called when the control gains key input focus.
Should be overridden by derived classes if they need to customize what happens when focus is gained.
virtual void Dali::Toolkit::Internal::Control::OnKeyInputFocusLost | ( | ) | [virtual] |
Called when the control loses key input focus.
Should be overridden by derived classes if they need to customize what happens when focus is lost.
virtual void Dali::Toolkit::Internal::Control::OnLayoutNegotiated | ( | float | size, |
Dimension::Type | dimension | ||
) | [protected, virtual] |
Virtual method to notify deriving classes that the size for a dimension has just been negotiated.
[in] | size | The new size for the given dimension |
[in] | dimension | The dimension that was just negotiated |
Implements Dali::CustomActorImpl.
virtual void Dali::Toolkit::Internal::Control::OnLongPress | ( | const LongPressGesture & | longPress | ) | [virtual] |
Called whenever a long press gesture is detected on this control.
This should be overridden by deriving classes when long press detection is enabled.
[in] | longPress | The long press gesture |
virtual void Dali::Toolkit::Internal::Control::OnPan | ( | const PanGesture & | pan | ) | [virtual] |
Called whenever a pan gesture is detected on this control.
This should be overridden by deriving classes when pan detection is enabled.
[in] | pan | The pan gesture |
virtual void Dali::Toolkit::Internal::Control::OnPinch | ( | const PinchGesture & | pinch | ) | [virtual] |
Called whenever a pinch gesture is detected on this control.
This can be overridden by deriving classes when pinch detection is enabled. The default behaviour is to scale the control by the pinch scale.
[in] | pinch | The pinch gesture |
virtual void Dali::Toolkit::Internal::Control::OnPropertySet | ( | Property::Index | index, |
Property::Value | propertyValue | ||
) | [protected, virtual] |
Called when the owning actor property is set.
[in] | index | The Property index that was set |
[in] | propertyValue | The value to set |
Reimplemented from Dali::CustomActorImpl.
virtual void Dali::Toolkit::Internal::Control::OnRelayout | ( | const Vector2 & | size, |
RelayoutContainer & | container | ||
) | [protected, virtual] |
Called after the size negotiation has been finished for this control.
The control is expected to assign this given size to itself/its children.
Should be overridden by derived classes if they need to layout actors differently after certain operations like add or remove actors, resize or after changing specific properties.
[in] | size | The allocated size |
[in,out] | container | The control should add actors to this container that it is not able to allocate a size for |
Implements Dali::CustomActorImpl.
virtual void Dali::Toolkit::Internal::Control::OnSetResizePolicy | ( | ResizePolicy::Type | policy, |
Dimension::Type | dimension | ||
) | [protected, virtual] |
Notification for deriving classes.
[in] | policy | The policy being set |
[in] | dimension | The dimension the policy is being set for |
Implements Dali::CustomActorImpl.
virtual void Dali::Toolkit::Internal::Control::OnSizeAnimation | ( | Animation & | animation, |
const Vector3 & | targetSize | ||
) | [protected, virtual] |
Called when the owning actor's size is animated e.g. using Animation::AnimateTo( Property( actor, Actor::Property::SIZE ), ... ).
[in] | animation | The object which is animating the owning actor |
[in] | targetSize | The target size. Note that this target size may not match the size returned via Actor::GetTargetSize |
Implements Dali::CustomActorImpl.
virtual void Dali::Toolkit::Internal::Control::OnSizeSet | ( | const Vector3 & | targetSize | ) | [protected, virtual] |
Called when the owning actor's size is set e.g. using Actor::SetSize().
[in] | targetSize | The target size. Note that this target size may not match the size returned via Actor::GetTargetSize |
Implements Dali::CustomActorImpl.
virtual void Dali::Toolkit::Internal::Control::OnStageConnection | ( | int | depth | ) | [protected, virtual] |
Called after the actor has been connected to the stage.
When an actor is connected, it will be directly or indirectly parented to the root Actor.
[in] | depth | The depth in the hierarchy for the actor |
A (parent) / \ B C / \ \ D E F
[in] | depth | The depth in the hierarchy for the actor |
virtual void Dali::Toolkit::Internal::Control::OnStageDisconnection | ( | ) | [protected, virtual] |
Called after the actor has been disconnected from Stage.
If an actor is disconnected, it either has no parent or is parented to a disconnected actor.
A (parent) / \ B C / \ \ D E F
Implements Dali::CustomActorImpl.
virtual void Dali::Toolkit::Internal::Control::OnStyleChange | ( | Toolkit::StyleManager | styleManager, |
StyleChange::Type | change | ||
) | [virtual] |
This method should be overridden by deriving classes requiring notifications when the style changes.
[in] | styleManager | The StyleManager object |
[in] | change | Information denoting what has changed |
virtual void Dali::Toolkit::Internal::Control::OnTap | ( | const TapGesture & | tap | ) | [virtual] |
Called whenever a tap gesture is detected on this control.
This should be overridden by deriving classes when tap detection is enabled.
[in] | tap | The tap gesture |
virtual bool Dali::Toolkit::Internal::Control::OnTouchEvent | ( | const TouchEvent & | event | ) | [protected, virtual] |
Called after a touch-event is received by the owning actor.
[in] | event | The touch event |
Implements Dali::CustomActorImpl.
virtual bool Dali::Toolkit::Internal::Control::OnWheelEvent | ( | const WheelEvent & | event | ) | [protected, virtual] |
Called after a wheel-event is received by the owning actor.
[in] | event | The wheel event |
Implements Dali::CustomActorImpl.
virtual bool Dali::Toolkit::Internal::Control::RelayoutDependentOnChildren | ( | Dimension::Type | dimension = Dimension::ALL_DIMENSIONS | ) | [protected, virtual] |
Determines if this actor is dependent on its children for relayout.
[in] | dimension | The dimension(s) to check for |
Implements Dali::CustomActorImpl.
void Dali::Toolkit::Internal::Control::SetAsKeyboardFocusGroup | ( | bool | isFocusGroup | ) |
Sets whether this control is a focus group for keyboard navigation.
(i.e. the scope of keyboard focus movement can be limited to its child actors). The control is not a focus group by default.
[in] | isFocusGroup | Whether this control is set as a focus group for keyboard navigation |
void Dali::Toolkit::Internal::Control::SetBackground | ( | const Property::Map & | map | ) |
Sets the background with a property map.
[in] | map | The background property map |
void Dali::Toolkit::Internal::Control::SetBackgroundColor | ( | const Vector4 & | color | ) |
Sets the background color of the control.
[in] | color | The required background color of the control |
void Dali::Toolkit::Internal::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::Internal::Control::SetKeyboardNavigationSupport | ( | bool | isSupported | ) |
Sets whether this control supports two dimensional keyboard navigation (i.e. whether it knows how to handle the keyboard focus movement between its child actors).
The control doesn't support it by default.
[in] | isSupported | Whether this control supports two dimensional keyboard navigation |
void Dali::Toolkit::Internal::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 |
virtual void Dali::Toolkit::Internal::Control::SignalConnected | ( | SlotObserver * | slotObserver, |
CallbackBase * | callback | ||
) | [virtual] |
Called when a signal is connected.
[in] | slotObserver | The slot observer i.e. a signal. Ownership is not passed |
[in] | callback | The call back. Ownership is not passed |
Implements Dali::ConnectionTrackerInterface.
virtual void Dali::Toolkit::Internal::Control::SignalDisconnected | ( | SlotObserver * | slotObserver, |
CallbackBase * | callback | ||
) | [virtual] |
This method is called when the signal is disconnecting.
[in] | slotObserver | The signal that has disconnected |
[in] | callback | The callback attached to the signal disconnected |
Implements Dali::SignalObserver.