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 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
37 [EditorBrowsable(EditorBrowsableState.Never)]
38 public static readonly BindableProperty ResourceUrlSelectorProperty = BindableProperty.Create("ResourceUrlSelector", typeof(Selector<string>), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
40 var imageViewStyle = (ImageViewStyle)bindable;
41 imageViewStyle.resourceUrlSelector.Clone((Selector<string>)newValue);
43 defaultValueCreator: (bindable) =>
45 var imageViewStyle = (ImageViewStyle)bindable;
46 return imageViewStyle.resourceUrlSelector;
48 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
49 [EditorBrowsable(EditorBrowsableState.Never)]
50 public static readonly BindableProperty PreMultipliedAlphaProperty = BindableProperty.Create("PreMultipliedAlpha", typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
52 var imageViewStyle = (ImageViewStyle)bindable;
53 imageViewStyle.preMultipliedAlpha = (bool?)newValue;
55 defaultValueCreator: (bindable) =>
57 var imageViewStyle = (ImageViewStyle)bindable;
58 return imageViewStyle.preMultipliedAlpha;
60 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
61 [EditorBrowsable(EditorBrowsableState.Never)]
62 public static readonly BindableProperty PixelAreaProperty = BindableProperty.Create("PixelArea", typeof(RelativeVector4), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
64 var imageViewStyle = (ImageViewStyle)bindable;
65 imageViewStyle.pixelArea = (RelativeVector4)newValue;
67 defaultValueCreator: (bindable) =>
69 var imageViewStyle = (ImageViewStyle)bindable;
70 return imageViewStyle.pixelArea;
72 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
73 [EditorBrowsable(EditorBrowsableState.Never)]
74 public static readonly BindableProperty BorderSelectorProperty = BindableProperty.Create("BorderSelector", typeof(Selector<Rectangle>), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
76 var imageViewStyle = (ImageViewStyle)bindable;
77 imageViewStyle.borderSelector.Clone((Selector<Rectangle>)newValue);
79 defaultValueCreator: (bindable) =>
81 var imageViewStyle = (ImageViewStyle)bindable;
82 return imageViewStyle.borderSelector;
84 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
85 [EditorBrowsable(EditorBrowsableState.Never)]
86 public static readonly BindableProperty BorderOnlyProperty = BindableProperty.Create("BorderOnly", typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
88 var imageViewStyle = (ImageViewStyle)bindable;
89 imageViewStyle.borderOnly = (bool?)newValue;
91 defaultValueCreator: (bindable) =>
93 var imageViewStyle = (ImageViewStyle)bindable;
94 return imageViewStyle.borderOnly;
96 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
97 [EditorBrowsable(EditorBrowsableState.Never)]
98 public static readonly BindableProperty SynchronosLoadingProperty = BindableProperty.Create("SynchronosLoading", typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
100 var imageViewStyle = (ImageViewStyle)bindable;
101 imageViewStyle.synchronosLoading = (bool?)newValue;
103 defaultValueCreator: (bindable) =>
105 var imageViewStyle = (ImageViewStyle)bindable;
106 return imageViewStyle.synchronosLoading;
108 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
109 [EditorBrowsable(EditorBrowsableState.Never)]
110 public static readonly BindableProperty OrientationCorrectionProperty = BindableProperty.Create("OrientationCorrection", typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
112 var imageViewStyle = (ImageViewStyle)bindable;
113 imageViewStyle.orientationCorrection = (bool?)newValue;
115 defaultValueCreator: (bindable) =>
117 var imageViewStyle = (ImageViewStyle)bindable;
118 return imageViewStyle.orientationCorrection;
121 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
122 [EditorBrowsable(EditorBrowsableState.Never)]
123 public bool? PreMultipliedAlpha
127 bool? temp = (bool?)GetValue(PreMultipliedAlphaProperty);
132 SetValue(PreMultipliedAlphaProperty, value);
136 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
137 [EditorBrowsable(EditorBrowsableState.Never)]
138 public RelativeVector4 PixelArea
142 RelativeVector4 temp = (RelativeVector4)GetValue(PixelAreaProperty);
147 SetValue(PixelAreaProperty, 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? BorderOnly
157 bool? temp = (bool?)GetValue(BorderOnlyProperty);
162 SetValue(BorderOnlyProperty, value);
166 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
167 [EditorBrowsable(EditorBrowsableState.Never)]
168 public bool? SynchronosLoading
172 bool? temp = (bool?)GetValue(SynchronosLoadingProperty);
177 SetValue(SynchronosLoadingProperty, value);
181 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
182 [EditorBrowsable(EditorBrowsableState.Never)]
183 public bool? OrientationCorrection
187 bool? temp = (bool?)GetValue(OrientationCorrectionProperty);
192 SetValue(OrientationCorrectionProperty, value);
196 private Selector<string> resourceUrlSelector = new Selector<string>();
200 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
201 [EditorBrowsable(EditorBrowsableState.Never)]
202 public Selector<string> ResourceUrl
206 return (Selector<string>)GetValue(ResourceUrlSelectorProperty);
210 SetValue(ResourceUrlSelectorProperty, value);
214 private Selector<Rectangle> borderSelector = new Selector<Rectangle>();
218 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
219 [EditorBrowsable(EditorBrowsableState.Never)]
220 public Selector<Rectangle> Border
224 return (Selector<Rectangle>)GetValue(BorderSelectorProperty);
228 SetValue(BorderSelectorProperty, value);