/** Copyright (c) 2017 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;
using Tizen.NUI.BaseComponents;
namespace Tizen.NUI
{
///
///
/// The Container is an abstract class to be inherited from by classes that desire to have views
/// added to them.
///
///
public abstract class Container : Animatable
{
internal Container(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
{
// No un-managed data hence no need to store a native ptr
}
protected override void Dispose(DisposeTypes type)
{
if (disposed)
{
return;
}
base.Dispose(type);
}
///
/// Adds a child view to this Container.
///
///
This Container (the parent) has been initialized. The child view has been initialized. The child view is not the same as the parent view.
/// The child will be referenced by its parent. This means that the child will be kept alive, even if the handle passed into this method is reset or destroyed.
/// If the child already has a parent, it will be removed from the old parent and reparented to this view. This may change child's position, color, scale, etc. as it now inherits them from this view.
/// The child view to add.
public abstract void Add( View view );
///
/// Removes a child view from this view. If the view was not a child of this view, this is a no-op.
///
/// This view (the parent) has been initialized. The child view is not the same as the parent view.
/// The child.
public abstract void Remove( View view );
///
/// Retrieves the child view by the index.
///
/// The view has been initialized.
/// The index of the child to retrieve.
/// The view for the given index or empty handle if children are not initialized.
public abstract View GetChildAt( uint index );
///
/// Gets the parent of this container.
///
/// The child container has been initialized.
/// The parent container.
protected abstract Container GetParent();
///
/// Gets the number of children for this container.
///
/// The container has been initialized.
/// The number of children.
protected abstract UInt32 GetChildCount();
///
/// Gets the parent container.
/// Read only
///
/// The child container has been initialized.
/// The parent container.
public Container Parent
{
get
{
return GetParent();
}
}
///
/// Gets the number of children for this container.
/// Read only
///
/// The container has been initialized.
/// The number of children.
public uint ChildCount
{
get
{
return GetChildCount();
}
}
}
} // namespace Tizen.NUI