2 * Copyright(c) 2019 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.ComponentModel;
19 using Tizen.NUI.Binding;
21 namespace Tizen.NUI.BaseComponents
24 /// The base class for Children attributes in Components.
26 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
27 [EditorBrowsable(EditorBrowsableState.Never)]
28 public class ImageViewStyle : ViewStyle
30 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
31 [EditorBrowsable(EditorBrowsableState.Never)]
32 public static readonly BindableProperty ResourceUrlSelectorProperty = BindableProperty.Create("ResourceUrlSelector", typeof(Selector<string>), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
34 var imageViewStyle = (ImageViewStyle)bindable;
35 if (null == imageViewStyle.resourceUrlSelector) imageViewStyle.resourceUrlSelector = new Selector<string>();
36 imageViewStyle.resourceUrlSelector.Clone(null == newValue ? new Selector<string>() : (Selector<string>)newValue);
38 defaultValueCreator: (bindable) =>
40 var imageViewStyle = (ImageViewStyle)bindable;
41 return imageViewStyle.resourceUrlSelector;
43 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
44 [EditorBrowsable(EditorBrowsableState.Never)]
45 public static readonly BindableProperty PreMultipliedAlphaProperty = BindableProperty.Create(nameof(PreMultipliedAlpha), typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
47 var imageViewStyle = (ImageViewStyle)bindable;
48 imageViewStyle.preMultipliedAlpha = (bool?)newValue;
50 defaultValueCreator: (bindable) =>
52 var imageViewStyle = (ImageViewStyle)bindable;
53 return imageViewStyle.preMultipliedAlpha;
55 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
56 [EditorBrowsable(EditorBrowsableState.Never)]
57 public static readonly BindableProperty PixelAreaProperty = BindableProperty.Create(nameof(PixelArea), typeof(RelativeVector4), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
59 var imageViewStyle = (ImageViewStyle)bindable;
60 imageViewStyle.pixelArea = (RelativeVector4)newValue;
62 defaultValueCreator: (bindable) =>
64 var imageViewStyle = (ImageViewStyle)bindable;
65 return imageViewStyle.pixelArea;
67 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
68 [EditorBrowsable(EditorBrowsableState.Never)]
69 public static readonly BindableProperty BorderSelectorProperty = BindableProperty.Create("BorderSelector", typeof(Selector<Rectangle>), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
71 var imageViewStyle = (ImageViewStyle)bindable;
72 if (null == imageViewStyle.borderSelector) imageViewStyle.borderSelector = new Selector<Rectangle>();
73 imageViewStyle.borderSelector.Clone(null == newValue ? new Selector<Rectangle>() : (Selector<Rectangle>)newValue);
75 defaultValueCreator: (bindable) =>
77 var imageViewStyle = (ImageViewStyle)bindable;
78 return imageViewStyle.borderSelector;
80 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
81 [EditorBrowsable(EditorBrowsableState.Never)]
82 public static readonly BindableProperty BorderOnlyProperty = BindableProperty.Create(nameof(BorderOnly), typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
84 var imageViewStyle = (ImageViewStyle)bindable;
85 imageViewStyle.borderOnly = (bool?)newValue;
87 defaultValueCreator: (bindable) =>
89 var imageViewStyle = (ImageViewStyle)bindable;
90 return imageViewStyle.borderOnly;
92 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
93 [EditorBrowsable(EditorBrowsableState.Never)]
94 public static readonly BindableProperty SynchronosLoadingProperty = BindableProperty.Create(nameof(SynchronosLoading), typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
96 var imageViewStyle = (ImageViewStyle)bindable;
97 imageViewStyle.synchronosLoading = (bool?)newValue;
99 defaultValueCreator: (bindable) =>
101 var imageViewStyle = (ImageViewStyle)bindable;
102 return imageViewStyle.synchronosLoading;
104 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
105 [EditorBrowsable(EditorBrowsableState.Never)]
106 public static readonly BindableProperty OrientationCorrectionProperty = BindableProperty.Create(nameof(OrientationCorrection), typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
108 var imageViewStyle = (ImageViewStyle)bindable;
109 imageViewStyle.orientationCorrection = (bool?)newValue;
111 defaultValueCreator: (bindable) =>
113 var imageViewStyle = (ImageViewStyle)bindable;
114 return imageViewStyle.orientationCorrection;
117 private bool? preMultipliedAlpha;
118 private RelativeVector4 pixelArea;
119 private bool? borderOnly;
120 private bool? synchronosLoading;
121 private bool? orientationCorrection;
122 private Selector<string> resourceUrlSelector;
123 private Selector<Rectangle> borderSelector;
125 static ImageViewStyle() { }
127 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
128 [EditorBrowsable(EditorBrowsableState.Never)]
129 public bool? PreMultipliedAlpha
131 get => (bool?)GetValue(PreMultipliedAlphaProperty);
132 set => SetValue(PreMultipliedAlphaProperty, value);
135 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
136 [EditorBrowsable(EditorBrowsableState.Never)]
137 public RelativeVector4 PixelArea
139 get => (RelativeVector4)GetValue(PixelAreaProperty);
140 set => SetValue(PixelAreaProperty, value);
143 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
144 [EditorBrowsable(EditorBrowsableState.Never)]
145 public bool? BorderOnly
147 get => (bool?)GetValue(BorderOnlyProperty);
148 set => SetValue(BorderOnlyProperty, value);
151 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
152 [EditorBrowsable(EditorBrowsableState.Never)]
153 public bool? SynchronosLoading
155 get => (bool?)GetValue(SynchronosLoadingProperty);
156 set => SetValue(SynchronosLoadingProperty, value);
159 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
160 [EditorBrowsable(EditorBrowsableState.Never)]
161 public bool? OrientationCorrection
163 get => (bool?)GetValue(OrientationCorrectionProperty);
164 set => SetValue(OrientationCorrectionProperty, value);
170 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
171 [EditorBrowsable(EditorBrowsableState.Never)]
172 public Selector<string> ResourceUrl
176 Selector<string> tmp = (Selector<string>)GetValue(ResourceUrlSelectorProperty);
177 return (null != tmp) ? tmp : resourceUrlSelector = new Selector<string>();
179 set => SetValue(ResourceUrlSelectorProperty, value);
185 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
186 [EditorBrowsable(EditorBrowsableState.Never)]
187 public Selector<Rectangle> Border
191 Selector<Rectangle> tmp = (Selector<Rectangle>)GetValue(BorderSelectorProperty);
192 return (null != tmp) ? tmp : borderSelector = new Selector<Rectangle>();
194 set => SetValue(BorderSelectorProperty, value);