X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2FTizen.NUI%2Fsrc%2Fpublic%2FBaseComponents%2FImageView.cs;h=3641ddbb9b6408000b9898eca90307bdf7a3890d;hb=9c0172f6cdc17d7558749ae086bb9263472f1f51;hp=9b036234a7c47718105e7c69ba63a91eebb1ee14;hpb=83d239b7caddfc9f2b31940408bb311b7f3695af;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git
diff --git a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs
index 9b03623..3641ddb 100755
--- a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs
+++ b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs
@@ -25,6 +25,7 @@ namespace Tizen.NUI.BaseComponents
/// ImageView is a class for displaying an image resource.
/// An instance of ImageView can be created using a URL or an image instance.
///
+ /// 3
public class ImageView : View
{
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
@@ -43,6 +44,7 @@ namespace Tizen.NUI.BaseComponents
///
/// Event arguments of resource ready.
///
+ /// 3
public class ResourceReadyEventArgs : EventArgs
{
private View _view;
@@ -195,7 +197,11 @@ namespace Tizen.NUI.BaseComponents
///
/// Please do not use! this will be deprecated!
/// Instead please use as keyword.
- [Obsolete("Please DO NOT use! This will be deprecated, instead please USE as keyword.")]
+ /// 3
+ [Obsolete("Please do not use! This will be deprecated! Please use as keyword instead! " +
+ "Like: " +
+ "BaseHandle handle = new ImageView(imagePath); " +
+ "ImageView image = handle as ImageView")]
[EditorBrowsable(EditorBrowsableState.Never)]
public new static ImageView DownCast(BaseHandle handle)
{
@@ -203,6 +209,7 @@ namespace Tizen.NUI.BaseComponents
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
+
///
/// Sets this ImageView from the given URL.
/// If the URL is empty, ImageView will not display anything.
@@ -256,7 +263,7 @@ namespace Tizen.NUI.BaseComponents
}
set
{
- _url = value;
+ _url = (value == null? "" : value);
UpdateImage();
}
}
@@ -266,6 +273,7 @@ namespace Tizen.NUI.BaseComponents
/// ImageView ImageMap, type PropertyMap: string if it is a URL, map otherwise.
///
/// 3
+ [Obsolete("Please do not use! This will be deprecated! Please use Image property instead!")]
[EditorBrowsable(EditorBrowsableState.Never)]
public PropertyMap ImageMap
{
@@ -286,6 +294,7 @@ namespace Tizen.NUI.BaseComponents
{
if (_border == null)
{
+ if (_url != null) { value.Add("url", new PropertyValue(_url)); }
SetProperty(ImageView.Property.IMAGE, new Tizen.NUI.PropertyValue(value));
}
}
@@ -314,6 +323,7 @@ namespace Tizen.NUI.BaseComponents
{
if (_border == null)
{
+ if(_url != null) { value.Add("url", new PropertyValue(_url)); }
SetProperty(ImageView.Property.IMAGE, new Tizen.NUI.PropertyValue(value));
}
}
@@ -414,6 +424,60 @@ namespace Tizen.NUI.BaseComponents
}
}
+ ///
+ /// Gets or sets whether to correct orientation of image automatically.
+ ///
+ /// 5
+ public bool OrientationCorrection
+ {
+ get
+ {
+ return _orientationCorrection ?? false;
+ }
+ set
+ {
+ _orientationCorrection = value;
+ UpdateImage();
+ }
+ }
+
+
+ ///
+ /// Get the loading state of the visual resource.
+ ///
+ /// 5
+ public ImageView.LoadingStatusType LoadingStatus
+ {
+ get
+ {
+ return (ImageView.LoadingStatusType)NDalicManualPINVOKE.View_GetVisualResourceStatus(swigCPtr, (int)Property.IMAGE);
+ }
+ }
+
+ ///
+ /// Enumeration for LoadingStatus of image.
+ ///
+ /// 5
+ public enum LoadingStatusType
+ {
+ ///
+ /// Loading preparing status.
+ ///
+ /// 5
+ Preparing,
+ ///
+ /// Loading ready status.
+ ///
+ /// 5
+ Ready,
+ ///
+ /// Loading failed status.
+ ///
+ /// 5
+ Failed
+ }
+
+
private void UpdateImage()
{
if (_url != null)
@@ -425,15 +489,17 @@ namespace Tizen.NUI.BaseComponents
_nPatchMap.Add(NpatchImageVisualProperty.URL, new PropertyValue(_url));
_nPatchMap.Add(NpatchImageVisualProperty.Border, new PropertyValue(_border));
if (_borderOnly != null) { _nPatchMap.Add(NpatchImageVisualProperty.BorderOnly, new PropertyValue((bool)_borderOnly)); }
- if (_synchronousLoading != null) _nPatchMap.Add(NpatchImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading));
+ if (_synchronousLoading != null) { _nPatchMap.Add(NpatchImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading)); }
+ if (_orientationCorrection != null) { _nPatchMap.Add(ImageVisualProperty.OrientationCorrection, new PropertyValue((bool)_orientationCorrection)); }
SetProperty(ImageView.Property.IMAGE, new PropertyValue(_nPatchMap));
}
- else if (_synchronousLoading != null)
+ else if (_synchronousLoading != null || _orientationCorrection != null)
{ // for normal image, with synchronous loading property
PropertyMap imageMap = new PropertyMap();
imageMap.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image));
imageMap.Add(ImageVisualProperty.URL, new PropertyValue(_url));
- imageMap.Add(ImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading));
+ if (_synchronousLoading != null) { imageMap.Add(ImageVisualProperty.SynchronousLoading, new PropertyValue((bool)_synchronousLoading)); }
+ if (_orientationCorrection != null) { imageMap.Add(ImageVisualProperty.OrientationCorrection, new PropertyValue((bool)_orientationCorrection)); }
SetProperty(ImageView.Property.IMAGE, new PropertyValue(imageMap));
}
else
@@ -448,7 +514,7 @@ namespace Tizen.NUI.BaseComponents
private bool? _synchronousLoading = null;
private bool? _borderOnly = null;
private string _url = null;
-
+ private bool? _orientationCorrection = null;
}
-}
\ No newline at end of file
+}