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 private bool? preMultipliedAlpha;
31 private RelativeVector4 pixelArea;
32 private bool? borderOnly;
33 private bool? synchronosLoading;
34 private bool? orientationCorrection;
36 static ImageViewStyle() { }
38 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
39 [EditorBrowsable(EditorBrowsableState.Never)]
40 public static readonly BindableProperty ResourceUrlSelectorProperty = BindableProperty.Create("ResourceUrlSelector", typeof(Selector<string>), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
42 var imageViewStyle = (ImageViewStyle)bindable;
43 imageViewStyle.resourceUrlSelector.Clone((Selector<string>)newValue);
45 defaultValueCreator: (bindable) =>
47 var imageViewStyle = (ImageViewStyle)bindable;
48 return imageViewStyle.resourceUrlSelector;
50 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
51 [EditorBrowsable(EditorBrowsableState.Never)]
52 public static readonly BindableProperty PreMultipliedAlphaProperty = BindableProperty.Create(nameof(PreMultipliedAlpha), typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
54 var imageViewStyle = (ImageViewStyle)bindable;
55 imageViewStyle.preMultipliedAlpha = (bool?)newValue;
57 defaultValueCreator: (bindable) =>
59 var imageViewStyle = (ImageViewStyle)bindable;
60 return imageViewStyle.preMultipliedAlpha;
62 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
63 [EditorBrowsable(EditorBrowsableState.Never)]
64 public static readonly BindableProperty PixelAreaProperty = BindableProperty.Create(nameof(PixelArea), typeof(RelativeVector4), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
66 var imageViewStyle = (ImageViewStyle)bindable;
67 imageViewStyle.pixelArea = (RelativeVector4)newValue;
69 defaultValueCreator: (bindable) =>
71 var imageViewStyle = (ImageViewStyle)bindable;
72 return imageViewStyle.pixelArea;
74 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
75 [EditorBrowsable(EditorBrowsableState.Never)]
76 public static readonly BindableProperty BorderSelectorProperty = BindableProperty.Create("BorderSelector", typeof(Selector<Rectangle>), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
78 var imageViewStyle = (ImageViewStyle)bindable;
79 imageViewStyle.borderSelector.Clone((Selector<Rectangle>)newValue);
81 defaultValueCreator: (bindable) =>
83 var imageViewStyle = (ImageViewStyle)bindable;
84 return imageViewStyle.borderSelector;
86 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
87 [EditorBrowsable(EditorBrowsableState.Never)]
88 public static readonly BindableProperty BorderOnlyProperty = BindableProperty.Create(nameof(BorderOnly), typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
90 var imageViewStyle = (ImageViewStyle)bindable;
91 imageViewStyle.borderOnly = (bool?)newValue;
93 defaultValueCreator: (bindable) =>
95 var imageViewStyle = (ImageViewStyle)bindable;
96 return imageViewStyle.borderOnly;
98 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
99 [EditorBrowsable(EditorBrowsableState.Never)]
100 public static readonly BindableProperty SynchronosLoadingProperty = BindableProperty.Create(nameof(SynchronosLoading), typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
102 var imageViewStyle = (ImageViewStyle)bindable;
103 imageViewStyle.synchronosLoading = (bool?)newValue;
105 defaultValueCreator: (bindable) =>
107 var imageViewStyle = (ImageViewStyle)bindable;
108 return imageViewStyle.synchronosLoading;
110 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
111 [EditorBrowsable(EditorBrowsableState.Never)]
112 public static readonly BindableProperty OrientationCorrectionProperty = BindableProperty.Create(nameof(OrientationCorrection), typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
114 var imageViewStyle = (ImageViewStyle)bindable;
115 imageViewStyle.orientationCorrection = (bool?)newValue;
117 defaultValueCreator: (bindable) =>
119 var imageViewStyle = (ImageViewStyle)bindable;
120 return imageViewStyle.orientationCorrection;
123 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
124 [EditorBrowsable(EditorBrowsableState.Never)]
125 public bool? PreMultipliedAlpha
129 bool? temp = (bool?)GetValue(PreMultipliedAlphaProperty);
134 SetValue(PreMultipliedAlphaProperty, value);
138 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
139 [EditorBrowsable(EditorBrowsableState.Never)]
140 public RelativeVector4 PixelArea
144 RelativeVector4 temp = (RelativeVector4)GetValue(PixelAreaProperty);
149 SetValue(PixelAreaProperty, value);
153 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
154 [EditorBrowsable(EditorBrowsableState.Never)]
155 public bool? BorderOnly
159 bool? temp = (bool?)GetValue(BorderOnlyProperty);
164 SetValue(BorderOnlyProperty, value);
168 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
169 [EditorBrowsable(EditorBrowsableState.Never)]
170 public bool? SynchronosLoading
174 bool? temp = (bool?)GetValue(SynchronosLoadingProperty);
179 SetValue(SynchronosLoadingProperty, value);
183 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
184 [EditorBrowsable(EditorBrowsableState.Never)]
185 public bool? OrientationCorrection
189 bool? temp = (bool?)GetValue(OrientationCorrectionProperty);
194 SetValue(OrientationCorrectionProperty, value);
198 private Selector<string> resourceUrlSelector = new Selector<string>();
202 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
203 [EditorBrowsable(EditorBrowsableState.Never)]
204 public Selector<string> ResourceUrl
208 return (Selector<string>)GetValue(ResourceUrlSelectorProperty);
212 SetValue(ResourceUrlSelectorProperty, value);
216 private Selector<Rectangle> borderSelector = new Selector<Rectangle>();
220 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
221 [EditorBrowsable(EditorBrowsableState.Never)]
222 public Selector<Rectangle> Border
226 return (Selector<Rectangle>)GetValue(BorderSelectorProperty);
230 SetValue(BorderSelectorProperty, value);