2 * Copyright(c) 2021 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.
17 using System.ComponentModel;
18 using Tizen.NUI.Binding;
20 namespace Tizen.NUI.BaseComponents
23 /// The base class for Children attributes in Components.
25 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
26 [EditorBrowsable(EditorBrowsableState.Never)]
27 public class ImageViewStyle : ViewStyle
29 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
30 [EditorBrowsable(EditorBrowsableState.Never)]
31 public static readonly BindableProperty ResourceUrlSelectorProperty = BindableProperty.Create("ResourceUrlSelector", typeof(Selector<string>), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
33 var imageViewStyle = (ImageViewStyle)bindable;
34 imageViewStyle.resourceUrlSelector = ((Selector<string>)newValue)?.Clone();
36 defaultValueCreator: (bindable) =>
38 var imageViewStyle = (ImageViewStyle)bindable;
39 return imageViewStyle.resourceUrlSelector;
41 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
42 [EditorBrowsable(EditorBrowsableState.Never)]
43 public static readonly BindableProperty PreMultipliedAlphaProperty = BindableProperty.Create(nameof(PreMultipliedAlpha), typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
45 var imageViewStyle = (ImageViewStyle)bindable;
46 imageViewStyle.preMultipliedAlpha = (bool?)newValue;
48 defaultValueCreator: (bindable) =>
50 var imageViewStyle = (ImageViewStyle)bindable;
51 return imageViewStyle.preMultipliedAlpha;
53 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
54 [EditorBrowsable(EditorBrowsableState.Never)]
55 public static readonly BindableProperty PixelAreaProperty = BindableProperty.Create(nameof(PixelArea), typeof(RelativeVector4), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
57 var imageViewStyle = (ImageViewStyle)bindable;
58 imageViewStyle.pixelArea = (RelativeVector4)newValue;
60 defaultValueCreator: (bindable) =>
62 var imageViewStyle = (ImageViewStyle)bindable;
63 return imageViewStyle.pixelArea;
65 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
66 [EditorBrowsable(EditorBrowsableState.Never)]
67 public static readonly BindableProperty BorderSelectorProperty = BindableProperty.Create("BorderSelector", typeof(Selector<Rectangle>), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
69 var imageViewStyle = (ImageViewStyle)bindable;
70 imageViewStyle.borderSelector = ((Selector<Rectangle>)newValue)?.Clone();
72 defaultValueCreator: (bindable) =>
74 var imageViewStyle = (ImageViewStyle)bindable;
75 return imageViewStyle.borderSelector;
77 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
78 [EditorBrowsable(EditorBrowsableState.Never)]
79 public static readonly BindableProperty BorderOnlyProperty = BindableProperty.Create(nameof(BorderOnly), typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
81 var imageViewStyle = (ImageViewStyle)bindable;
82 imageViewStyle.borderOnly = (bool?)newValue;
84 defaultValueCreator: (bindable) =>
86 var imageViewStyle = (ImageViewStyle)bindable;
87 return imageViewStyle.borderOnly;
89 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
90 [EditorBrowsable(EditorBrowsableState.Never)]
91 public static readonly BindableProperty SynchronosLoadingProperty = BindableProperty.Create(nameof(SynchronosLoading), typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
93 var imageViewStyle = (ImageViewStyle)bindable;
94 imageViewStyle.synchronosLoading = (bool?)newValue;
96 defaultValueCreator: (bindable) =>
98 var imageViewStyle = (ImageViewStyle)bindable;
99 return imageViewStyle.synchronosLoading;
101 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
102 [EditorBrowsable(EditorBrowsableState.Never)]
103 public static readonly BindableProperty OrientationCorrectionProperty = BindableProperty.Create(nameof(OrientationCorrection), typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
105 var imageViewStyle = (ImageViewStyle)bindable;
106 imageViewStyle.orientationCorrection = (bool?)newValue;
108 defaultValueCreator: (bindable) =>
110 var imageViewStyle = (ImageViewStyle)bindable;
111 return imageViewStyle.orientationCorrection;
114 private bool? preMultipliedAlpha;
115 private RelativeVector4 pixelArea;
116 private bool? borderOnly;
117 private bool? synchronosLoading;
118 private bool? orientationCorrection;
119 private Selector<string> resourceUrlSelector;
120 private Selector<Rectangle> borderSelector;
122 static ImageViewStyle() { }
125 /// Create an empty instance.
127 [EditorBrowsable(EditorBrowsableState.Never)]
128 public ImageViewStyle() : base()
132 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
133 [EditorBrowsable(EditorBrowsableState.Never)]
134 public bool? PreMultipliedAlpha
136 get => (bool?)GetValue(PreMultipliedAlphaProperty);
137 set => SetValue(PreMultipliedAlphaProperty, value);
140 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
141 [EditorBrowsable(EditorBrowsableState.Never)]
142 public RelativeVector4 PixelArea
144 get => (RelativeVector4)GetValue(PixelAreaProperty);
145 set => SetValue(PixelAreaProperty, value);
148 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
149 [EditorBrowsable(EditorBrowsableState.Never)]
150 public bool? BorderOnly
152 get => (bool?)GetValue(BorderOnlyProperty);
153 set => SetValue(BorderOnlyProperty, value);
156 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
157 [EditorBrowsable(EditorBrowsableState.Never)]
158 public bool? SynchronosLoading
160 get => (bool?)GetValue(SynchronosLoadingProperty);
161 set => SetValue(SynchronosLoadingProperty, value);
164 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
165 [EditorBrowsable(EditorBrowsableState.Never)]
166 public bool? OrientationCorrection
168 get => (bool?)GetValue(OrientationCorrectionProperty);
169 set => SetValue(OrientationCorrectionProperty, value);
175 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
176 [EditorBrowsable(EditorBrowsableState.Never)]
177 public Selector<string> ResourceUrl
181 Selector<string> tmp = (Selector<string>)GetValue(ResourceUrlSelectorProperty);
182 return (null != tmp) ? tmp : resourceUrlSelector = new Selector<string>();
184 set => SetValue(ResourceUrlSelectorProperty, value);
190 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
191 [EditorBrowsable(EditorBrowsableState.Never)]
192 public Selector<Rectangle> Border
196 Selector<Rectangle> tmp = (Selector<Rectangle>)GetValue(BorderSelectorProperty);
197 return (null != tmp) ? tmp : borderSelector = new Selector<Rectangle>();
199 set => SetValue(BorderSelectorProperty, value);