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 BorderSelectorProperty = BindableProperty.Create("BorderSelector", typeof(Selector<Rectangle>), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
45 var imageViewStyle = (ImageViewStyle)bindable;
46 imageViewStyle.borderSelector = ((Selector<Rectangle>)newValue)?.Clone();
48 defaultValueCreator: (bindable) =>
50 var imageViewStyle = (ImageViewStyle)bindable;
51 return imageViewStyle.borderSelector;
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 BorderOnlyProperty = BindableProperty.Create(nameof(BorderOnly), typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
57 var imageViewStyle = (ImageViewStyle)bindable;
58 imageViewStyle.borderOnly = (bool?)newValue;
60 defaultValueCreator: (bindable) =>
62 var imageViewStyle = (ImageViewStyle)bindable;
63 return imageViewStyle.borderOnly;
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 SynchronosLoadingProperty = BindableProperty.Create(nameof(SynchronosLoading), typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
69 var imageViewStyle = (ImageViewStyle)bindable;
70 imageViewStyle.synchronosLoading = (bool?)newValue;
72 defaultValueCreator: (bindable) =>
74 var imageViewStyle = (ImageViewStyle)bindable;
75 return imageViewStyle.synchronosLoading;
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 OrientationCorrectionProperty = BindableProperty.Create(nameof(OrientationCorrection), typeof(bool?), typeof(ImageViewStyle), null, propertyChanged: (bindable, oldValue, newValue) =>
81 var imageViewStyle = (ImageViewStyle)bindable;
82 imageViewStyle.orientationCorrection = (bool?)newValue;
84 defaultValueCreator: (bindable) =>
86 var imageViewStyle = (ImageViewStyle)bindable;
87 return imageViewStyle.orientationCorrection;
90 private bool? borderOnly;
91 private bool? synchronosLoading;
92 private bool? orientationCorrection;
93 private Selector<string> resourceUrlSelector;
94 private Selector<Rectangle> borderSelector;
96 static ImageViewStyle() { }
99 /// Create an empty instance.
101 [EditorBrowsable(EditorBrowsableState.Never)]
102 public ImageViewStyle() : base()
106 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
107 [EditorBrowsable(EditorBrowsableState.Never)]
108 public bool? BorderOnly
110 get => (bool?)GetValue(BorderOnlyProperty);
111 set => SetValue(BorderOnlyProperty, value);
114 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
115 [EditorBrowsable(EditorBrowsableState.Never)]
116 public bool? SynchronosLoading
118 get => (bool?)GetValue(SynchronosLoadingProperty);
119 set => SetValue(SynchronosLoadingProperty, value);
122 /// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
123 [EditorBrowsable(EditorBrowsableState.Never)]
124 public bool? OrientationCorrection
126 get => (bool?)GetValue(OrientationCorrectionProperty);
127 set => SetValue(OrientationCorrectionProperty, value);
133 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
134 [EditorBrowsable(EditorBrowsableState.Never)]
135 public Selector<string> ResourceUrl
139 Selector<string> tmp = (Selector<string>)GetValue(ResourceUrlSelectorProperty);
140 return (null != tmp) ? tmp : resourceUrlSelector = new Selector<string>();
142 set => SetValue(ResourceUrlSelectorProperty, value);
148 /// This will be public opened in tizen_5.5 after ACR done. Before ACR, need to be hidden as inhouse API.
149 [EditorBrowsable(EditorBrowsableState.Never)]
150 public Selector<Rectangle> Border
154 Selector<Rectangle> tmp = (Selector<Rectangle>)GetValue(BorderSelectorProperty);
155 return (null != tmp) ? tmp : borderSelector = new Selector<Rectangle>();
157 set => SetValue(BorderSelectorProperty, value);