private Size2D internalSize2D = null;
private int layoutCount = 0;
private ControlState propagatableControlStates = ControlState.All;
+
+ // List of dispatch Event
+ private PanGestureDetector panGestureDetector = null;
+ private LongPressGestureDetector longGestureDetector = null;
+ private PinchGestureDetector pinchGestureDetector = null;
+ private TapGestureDetector tapGestureDetector = null;
+ private RotationGestureDetector rotationGestureDetector = null;
+ private int configGestureCount = 0;
private bool dispatchTouchEvents = true;
+ private bool dispatchGestureEvents = true;
+ private bool dispatchParentGestureEvents = true;
+
+#if NUI_PROPERTY_CHANGE_1
+ private string internalName = string.Empty;
+#endif
+#if NUI_PROPERTY_CHANGE_3
+ private Position internalCurrentParentOrigin = null;
+ private Position internalCurrentAnchorPoint = null;
+ private Vector3 internalTargetSize = null;
+ private Size2D internalCurrentSize = null;
+ private Vector3 internalNaturalSize = null;
+ private Position internalCurrentPosition = null;
+ private Vector3 internalCurrentWorldPosition = null;
+ private Vector3 internalCurrentScale = null;
+ private Vector3 internalCurrentWorldScale = null;
+ private Vector4 internalCurrentColor = null;
+ private Vector4 internalCurrentWorldColor = null;
+#endif
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+ private Vector2 internalCurrentScreenPosition = null;
+#endif
static View()
{
}
/// <summary>
+ /// The color selector for the borderline of the View.
+ /// Like BackgroundColor, color selector typed BorderlineColor should be used in ViewStyle only.
+ /// So this API is internally used only.
+ /// </summary>
+ internal Selector<Color> BorderlineColorSelector
+ {
+ get
+ {
+ return (Selector<Color>)GetValue(BorderlineColorSelectorProperty);
+ }
+ set
+ {
+ SetValue(BorderlineColorSelectorProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
/// The Relative offset for the borderline of the View.
/// Recommended range : [-1.0f to 1.0f].
/// If -1.0f, draw borderline inside of the View.
/// <remarks>
/// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
/// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
- /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
+ /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
/// and users can get the current actual values through them.
/// </remarks>
/// <since_tizen> 3 </since_tizen>
/// <remarks>
/// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
/// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
- /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
+ /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
/// and users can get the current actual values through them.
/// </remarks>
/// <since_tizen> 3 </since_tizen>
{
get
{
- Vector2 temp = new Vector2(0.0f, 0.0f);
- var pValue = GetProperty(View.Property.ScreenPosition);
- pValue.Get(temp);
- pValue.Dispose();
- return temp;
+ return GetCurrentScreenPosition();
+ }
+ }
+
+ /// <summary>
+ /// Retrieves the screen position and size of the view.<br />
+ /// </summary>
+ /// <remarks>
+ /// The float type Rectangle class is not ready yet.
+ /// Therefore, it transmits data in Vector4 class.
+ /// This type should later be changed to the appropriate data type.
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public Vector4 ScreenPositionSize
+ {
+ get
+ {
+ return GetCurrentScreenPositionSize();
}
}
{
get
{
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+ return Object.InternalGetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint);
+#else
bool temp = false;
var pValue = GetProperty(View.Property.PositionUsesAnchorPoint);
pValue.Get(out temp);
pValue.Dispose();
return temp;
+#endif
}
set
{
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+ Object.InternalSetPropertyBool(SwigCPtr, View.Property.PositionUsesAnchorPoint, value);
+#else
var temp = new Tizen.NUI.PropertyValue(value);
SetProperty(View.Property.PositionUsesAnchorPoint, temp);
temp.Dispose();
+#endif
NotifyPropertyChanged();
}
}
{
get
{
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+ return GetCurrentWorldPosition();
+#else
Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
var pValue = GetProperty(View.Property.WorldPosition);
pValue.Get(temp);
pValue.Dispose();
return temp;
+#endif
}
}
{
get
{
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+ return GetCurrentWorldScale();
+#else
Vector3 temp = new Vector3(0.0f, 0.0f, 0.0f);
var pValue = GetProperty(View.Property.WorldScale);
pValue.Get(temp);
pValue.Dispose();
return temp;
+#endif
}
}
{
get
{
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+ return Object.InternalGetPropertyBool(SwigCPtr, View.Property.VISIBLE);
+#else
bool temp = false;
var pValue = GetProperty(View.Property.VISIBLE);
pValue.Get(out temp);
pValue.Dispose();
return temp;
+#endif
}
}
{
get
{
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+ return GetCurrentWorldColor();
+#else
Vector4 temp = new Vector4(0.0f, 0.0f, 0.0f, 0.0f);
var pValue = GetProperty(View.Property.WorldColor);
pValue.Get(temp);
pValue.Dispose();
return temp;
+#endif
}
}
{
get
{
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+ return GetCurrentAnchorPoint();
+#else
Position temp = new Position(0.0f, 0.0f, 0.0f);
var pValue = GetProperty(View.Property.AnchorPoint);
pValue.Get(temp);
Position ret = new Position(OnAnchorPointChanged, temp.X, temp.Y, temp.Z);
temp.Dispose();
return ret;
+#endif
}
set
{
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+ SetAnchorPoint(value);
+#else
var temp = new Tizen.NUI.PropertyValue(value);
SetProperty(View.Property.AnchorPoint, temp);
temp.Dispose();
+#endif
NotifyPropertyChanged();
}
}
/// <summary>
/// The Color of View. This is an RGBA value.
+ /// Each RGBA components match as <see cref="ColorRed"/>, <see cref="ColorGreen"/>, <see cref="ColorBlue"/>, and <see cref="Opacity"/>.
+ /// This property will multiply the final color of this view. (BackgroundColor, BorderlineColor, BackgroundImage, etc).
+ /// For example, if view.BackgroundColor = Color.Yellow and view.Color = Color.Purple, this view will shown as Red.
+ /// Inherient of color value depend on <see cref="ColorMode"/>.
/// </summary>
/// <remarks>
/// <para>
}
/// <summary>
+ /// The Red component of View.Color.
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// Animatable - This property can be animated using <c>Animation</c> class.
+ /// </para>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float ColorRed
+ {
+ get
+ {
+ return (float)GetValue(ColorRedProperty);
+ }
+ set
+ {
+ SetValue(ColorRedProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// The Green component of View.Color.
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// Animatable - This property can be animated using <c>Animation</c> class.
+ /// </para>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float ColorGreen
+ {
+ get
+ {
+ return (float)GetValue(ColorGreenProperty);
+ }
+ set
+ {
+ SetValue(ColorGreenProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
+ /// The Blue component of View.Color.
+ /// </summary>
+ /// <remarks>
+ /// <para>
+ /// Animatable - This property can be animated using <c>Animation</c> class.
+ /// </para>
+ /// </remarks>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public float ColorBlue
+ {
+ get
+ {
+ return (float)GetValue(ColorBlueProperty);
+ }
+ set
+ {
+ SetValue(ColorBlueProperty, value);
+ NotifyPropertyChanged();
+ }
+ }
+
+ /// <summary>
/// Set the layout on this View. Replaces any existing Layout.
/// </summary>
/// <remarks>
{
backgroundImageSynchronousLoading = value;
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+ if (!string.IsNullOrEmpty(BackgroundImage))
+#else
string bgUrl = null;
var pValue = Background.Find(ImageVisualProperty.URL);
pValue?.Get(out bgUrl);
pValue?.Dispose();
if (!string.IsNullOrEmpty(bgUrl))
+#endif
{
PropertyMap bgMap = this.Background;
var temp = new PropertyValue(backgroundImageSynchronousLoading);
{
get
{
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+ return Object.InternalGetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart);
+#else
bool temp = false;
var pValue = GetProperty(View.Property.CaptureAllTouchAfterStart);
pValue.Get(out temp);
pValue.Dispose();
return temp;
+#endif
}
set
{
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+ Object.InternalSetPropertyBool(SwigCPtr, View.Property.CaptureAllTouchAfterStart, value);
+#else
var temp = new Tizen.NUI.PropertyValue(value);
SetProperty(View.Property.CaptureAllTouchAfterStart, temp);
temp.Dispose();
+#endif
NotifyPropertyChanged();
}
}
{
get
{
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+ return Object.InternalGetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch);
+#else
bool temp = false;
var pValue = GetProperty(View.Property.AllowOnlyOwnTouch);
pValue.Get(out temp);
pValue.Dispose();
return temp;
+#endif
}
set
{
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+ Object.InternalSetPropertyBool(SwigCPtr, View.Property.AllowOnlyOwnTouch, value);
+#else
var temp = new Tizen.NUI.PropertyValue(value);
SetProperty(View.Property.AllowOnlyOwnTouch, temp);
temp.Dispose();
+#endif
NotifyPropertyChanged();
}
}
{
get
{
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+ return (BlendEquationType)Object.InternalGetPropertyInt(SwigCPtr, View.Property.BlendEquation);
+#else
int temp = 0;
var pValue = GetProperty(View.Property.BlendEquation);
pValue.Get(out temp);
pValue.Dispose();
return (BlendEquationType)temp;
+#endif
}
set
{
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+ Object.InternalSetPropertyInt(SwigCPtr, View.Property.BlendEquation, (int)value);
+#else
var temp = new Tizen.NUI.PropertyValue((int)value);
SetProperty(View.Property.BlendEquation, temp);
temp.Dispose();
+#endif
NotifyPropertyChanged();
}
}
{
get
{
+#if NUI_VISUAL_PROPERTY_CHANGE_1
+ return Object.InternalGetPropertyBool(SwigCPtr, View.Property.Culled);
+#else
bool temp = false;
var pValue = GetProperty(View.Property.Culled);
pValue.Get(out temp);
pValue.Dispose();
return temp;
+#endif
}
}
/// <summary>
/// Gets or sets the status of whether the view should emit key event signals.
- /// If a View's DispatchKeyEvents is set to false, then it's children will not emit a key event signal either.
+ /// If a View's DispatchKeyEvents is set to false, then itself and parents will not receive key event signals.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public bool DispatchKeyEvents
}
/// <summary>
+ /// Gets or sets the status of whether the view should emit Gesture event signals.
+ /// If a View's DispatchGestureEvents is set to false, then itself and parents will not receive all gesture event signals.
+ /// The itself and parents does not receive tap, pinch, pan, rotation, or longpress gestures.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool DispatchGestureEvents
+ {
+ get
+ {
+ return dispatchGestureEvents;
+ }
+ set
+ {
+ if (dispatchGestureEvents != value)
+ {
+ dispatchGestureEvents = value;
+ ConfigGestureDetector(dispatchGestureEvents);
+ }
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets the status of whether the view should emit Gesture event signals.
+ /// If a View's DispatchParentGestureEvents is set to false, then parents will not receive all gesture event signals.
+ /// The parents does not receive tap, pinch, pan, rotation, or longpress gestures.
+ /// </summary>
+ [EditorBrowsable(EditorBrowsableState.Never)]
+ public bool DispatchParentGestureEvents
+ {
+ get
+ {
+ return dispatchParentGestureEvents;
+ }
+ set
+ {
+ if (dispatchParentGestureEvents != value)
+ {
+ dispatchParentGestureEvents = value;
+ ConfigGestureDetector(dispatchParentGestureEvents);
+ }
+ }
+ }
+
+ private void ConfigGestureDetector(bool dispatch)
+ {
+ if (panGestureDetector == null) panGestureDetector = new PanGestureDetector();
+ if (longGestureDetector == null) longGestureDetector = new LongPressGestureDetector();
+ if (pinchGestureDetector == null) pinchGestureDetector = new PinchGestureDetector();
+ if (tapGestureDetector == null) tapGestureDetector = new TapGestureDetector();
+ if (rotationGestureDetector == null) rotationGestureDetector = new RotationGestureDetector();
+
+ if (dispatch == true)
+ {
+ configGestureCount = configGestureCount > 0 ? configGestureCount-- : 0;
+ if (configGestureCount == 0)
+ {
+ panGestureDetector.Detach(this);
+ longGestureDetector.Detach(this);
+ pinchGestureDetector.Detach(this);
+ tapGestureDetector.Detach(this);
+ rotationGestureDetector.Detach(this);
+
+ panGestureDetector.Detected -= OnGestureDetected;
+ longGestureDetector.Detected -= OnGestureDetected;
+ pinchGestureDetector.Detected -= OnGestureDetected;
+ tapGestureDetector.Detected -= OnGestureDetected;
+ rotationGestureDetector.Detected -= OnGestureDetected;
+
+ panGestureDetector = null;
+ longGestureDetector = null;
+ pinchGestureDetector = null;
+ tapGestureDetector = null;
+ rotationGestureDetector = null;
+ }
+ }
+ else
+ {
+ if (configGestureCount == 0)
+ {
+ panGestureDetector.Attach(this);
+ longGestureDetector.Attach(this);
+ pinchGestureDetector.Attach(this);
+ tapGestureDetector.Attach(this);
+ rotationGestureDetector.Attach(this);
+
+ panGestureDetector.Detected += OnGestureDetected;
+ longGestureDetector.Detected += OnGestureDetected;
+ pinchGestureDetector.Detected += OnGestureDetected;
+ tapGestureDetector.Detected += OnGestureDetected;
+ rotationGestureDetector.Detected += OnGestureDetected;
+ }
+ configGestureCount++;
+ }
+ }
+
+ private void OnGestureDetected(object source, EventArgs e)
+ {
+ // Does notting. This is to consume the gesture.
+ }
+
+ /// <summary>
/// Called when the view is hit through TouchEvent or GestureEvent.
/// If it returns true, it means that it was hit, and the touch/gesture event is called from the view.
/// If it returns false, it means that it will not be hit, and the hit-test continues to the next view.
/// <remarks>
/// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
/// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
- /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
+ /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
/// and users can get the current actual values through them.
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
/// <remarks>
/// The <see cref="Size"/>, <see cref="Position"/>, <see cref="Color"/>, and <see cref="Scale"/> properties are set in the main thread.
/// Therefore, it is not updated in real time when the value is changed in the render thread (for example, the value is changed during animation).
- /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
+ /// However, <see cref="CurrentSize"/>, <see cref="CurrentPosition"/>, <see cref="CurrentColor"/>, and <see cref="CurrentScale"/> properties are updated in real time,
/// and users can get the current actual values through them.
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never)]