1 /** Copyright (c) 2017 Samsung Electronics Co., Ltd.
\r
3 * Licensed under the Apache License, Version 2.0 (the "License");
\r
4 * you may not use this file except in compliance with the License.
\r
5 * You may obtain a copy of the License at
\r
7 * http://www.apache.org/licenses/LICENSE-2.0
\r
9 * Unless required by applicable law or agreed to in writing, software
\r
10 * distributed under the License is distributed on an "AS IS" BASIS,
\r
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
12 * See the License for the specific language governing permissions and
\r
13 * limitations under the License.
\r
18 using Tizen.NUI.BaseComponents;
\r
24 /// Container is an abstract class to be inherited from by classes that desire to have Views
\r
29 public abstract class Container : Animatable
\r
32 internal Container(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
\r
34 // No un-managed data hence no need to store a native ptr
\r
37 protected override void Dispose(DisposeTypes type)
\r
49 /// Adds a child view to this Container.
\r
51 /// <pre>This Container(the parent) has been initialized. The child view has been initialized. The child view is not the same as the parent view.</pre>
\r
52 /// <post>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.</post>
\r
53 /// <remarks>If the child already has a parent, it will be removed from old parent and reparented to this view. This may change child's position, color, scale etc as it now inherits them from this view.</remarks>
\r
54 /// <param name="view">The child view to add</param>
\r
55 public abstract void Add( View view );
\r
58 /// Removes a child View from this View. If the view was not a child of this view, this is a no-op.
\r
60 /// <pre>This View(the parent) has been initialized. The child view is not the same as the parent view.</pre>
\r
61 /// <param name="child">The child</param>
\r
62 public abstract void Remove( View view );
\r
65 /// Retrieves child view by index.
\r
67 /// <pre>The View has been initialized.</pre>
\r
68 /// <param name="index">The index of the child to retrieve</param>
\r
69 /// <returns>The view for the given index or empty handle if children not initialized</returns>
\r
70 public abstract View GetChildAt( uint index );
\r
73 /// Get the parent of this container
\r
75 /// <pre>The child container has been initialized.</pre>
\r
76 /// <returns>The parent container</returns>
\r
77 protected abstract Container GetParent();
\r
80 /// Get the number of children for this container
\r
82 /// <pre>The container has been initialized.</pre>
\r
83 /// <returns>number of children</returns>
\r
84 protected abstract UInt32 GetChildCount();
\r
87 /// Get the parent Container
\r
90 /// <pre>The child container has been initialized.</pre>
\r
91 /// <returns>The parent container</returns>
\r
92 public Container Parent
\r
101 /// Get the number of children for this container
\r
104 /// <pre>The container has been initialized.</pre>
\r
105 /// <returns>number of children</returns>
\r
106 public uint ChildCount
\r
110 return GetChildCount();
\r
114 } // namespace Tizen.NUI