/*
* Copyright(c) 2020 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System.ComponentModel;
using Tizen.NUI.BaseComponents;
using Tizen.NUI.Binding;
using Tizen.NUI.Components;
namespace Tizen.NUI.Wearable
{
///
/// CircularPaginationStyle used to config the circularPagination represent.
///
/// 8
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public class CircularPaginationStyle : ControlStyle
{
static CircularPaginationStyle() { }
///
/// Creates a new instance of a CircularPaginationStyle.
///
/// 8
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public CircularPaginationStyle() : base()
{
Initialize();
}
///
/// Creates a new instance of a CircularPaginationStyle using style.
///
/// 8
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public CircularPaginationStyle(CircularPaginationStyle style) : base(style)
{
if (null == style) return;
this.CopyFrom(style);
}
///
/// Gets or sets the size of the indicator.
///
/// 8
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public Size IndicatorSize { get; set; }
///
/// Gets or sets the resource of indicator.
///
/// 8
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public Selector IndicatorImageURL { get; set; } = new Selector();
///
/// Gets or sets the resource of the center indicator.
///
/// 8
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public Selector CenterIndicatorImageURL { get; set; } = new Selector();
///
/// Retrieves a copy of CircularPaginationStyle.
///
/// 8
/// This will be public opened in tizen_6.0 after ACR done. Before ACR, need to be hidden as inhouse API.
[EditorBrowsable(EditorBrowsableState.Never)]
public override void CopyFrom(BindableObject bindableObject)
{
base.CopyFrom(bindableObject);
CircularPaginationStyle circularPaginationStyle = bindableObject as CircularPaginationStyle;
if (null != circularPaginationStyle)
{
if (null != circularPaginationStyle.IndicatorSize)
{
IndicatorSize = new Size(circularPaginationStyle.IndicatorSize.Width, circularPaginationStyle.IndicatorSize.Height);
}
if (null != circularPaginationStyle.IndicatorImageURL)
{
IndicatorImageURL?.Clone(circularPaginationStyle.IndicatorImageURL);
}
if (null != circularPaginationStyle.CenterIndicatorImageURL)
{
CenterIndicatorImageURL?.Clone(circularPaginationStyle.CenterIndicatorImageURL);
}
}
}
private void Initialize()
{
IndicatorSize = new Size(10, 10);
IndicatorImageURL = new Selector()
{
Normal = "/usr/share/dotnet.tizen/framework/res/" + "nui_component_default_pagination_normal_dot.png",
Selected = "/usr/share/dotnet.tizen/framework/res/" + "nui_component_default_pagination_focus_dot.png",
};
CenterIndicatorImageURL = new Selector()
{
Normal = "/usr/share/dotnet.tizen/framework/res/" + "nui_wearable_circular_pagination_center_normal_dot.png",
Selected = "/usr/share/dotnet.tizen/framework/res/" + "nui_wearable_circular_pagination_center_focus_dot.png",
};
}
}
}