/*
* Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
*
* 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;
namespace ElmSharp
{
///
/// The FloatingButton is a widget to add the floating area for buttons.
///
/// preview
public class FloatingButton : Layout
{
///
/// Creates and initializes a new instance of the FloatingButton class.
///
/// Created on this parent container.
/// preview
public FloatingButton(EvasObject parent) : base(parent)
{
}
///
/// Sets or gets the floatingbutton mode.
///
/// preview
public FloatingButtonMode Mode
{
get
{
return (FloatingButtonMode)Interop.Eext.eext_floatingbutton_mode_get(Handle);
}
set
{
Interop.Eext.eext_floatingbutton_mode_set(Handle, (int)value);
}
}
///
/// Gets the floatingbutton position.
///
/// preview
public FloatingButtonPosition Position
{
get
{
return (FloatingButtonPosition)Interop.Eext.eext_floatingbutton_pos_get(Handle);
}
}
///
/// Sets or gets the movability for a given FloatingButton widget.
///
/// preview
public bool MovementBlock
{
get
{
return Interop.Eext.eext_floatingbutton_movement_block_get(Handle);
}
set
{
Interop.Eext.eext_floatingbutton_movement_block_set(Handle, value);
}
}
///
/// Gets the opacity's value of the given FloatingButton.
///
/// preview
public override int Opacity
{
get
{
return Color.Default.A;
}
set
{
Console.WriteLine("FloatingButton instance doesn't support to set Opacity.");
}
}
///
/// Set the floatingbutton position with or without animation.
///
/// Button position.
/// Animation flag.
/// preview
public void SetPosition(FloatingButtonPosition position, bool animated)
{
if (animated)
{
Interop.Eext.eext_floatingbutton_pos_bring_in(Handle, (int)position);
}
else
{
Interop.Eext.eext_floatingbutton_pos_set(Handle, (int)position);
}
}
///
/// Creates a widget handle.
///
/// Parent EvasObject.
/// Handle IntPtr.
/// preview
protected override IntPtr CreateHandle(EvasObject parent)
{
return Interop.Eext.eext_floatingbutton_add(parent.Handle);
}
}
///
/// Enumeration for the FloatingButtonMode.
///
/// preview
public enum FloatingButtonMode
{
///
/// Allows all positions.
///
All,
///
/// Allows left and right positions only.
///
LeftRightOnly,
}
///
/// Enumeration for the FloatingButtonPosition.
///
/// preview
public enum FloatingButtonPosition
{
///
/// Hides in the left, but only the small handler will show.
///
LeftOut,
///
/// Shows all of the buttons, but lies on the left.
///
Left,
///
/// Shows all of the buttons, but lies on the center.
///
Center,
///
/// Shows all of the buttons, but lies on the right.
///
Right,
///
/// Hides in the right, but only the small handler will show.
///
RightOut,
}
}