[NUI] Fix text padding issue
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / VideoViewHandle.cs
1 /*
2  * Copyright(c) 2021 Samsung Electronics Co., Ltd.
3  *
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
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  *
16  */
17
18 using System.ComponentModel;
19 using System.Runtime.InteropServices;
20 using Tizen.NUI.BaseComponents;
21
22 namespace Tizen.NUI
23 {
24     /// <summary>
25     /// Contains and encapsulates Native Player handle.
26     /// </summary>
27     internal class SafeNativePlayerHandle : SafeHandle
28     {
29         /// <summary>
30         /// Initializes a new instance of SafeNativePlayerHandle referencing the given videoView.
31         /// </summary>
32         internal SafeNativePlayerHandle(VideoView videoView) : base(global::System.IntPtr.Zero, false)
33         {
34             if (videoView != null)
35             {
36                 SetHandle(videoView.GetNativePlayerHandle());
37             }
38         }
39
40         /// <summary>
41         /// Null check if the handle is valid or not.
42         /// </summary>
43         [EditorBrowsable(EditorBrowsableState.Never)]
44         public override bool IsInvalid
45         {
46             get
47             {
48                 return handle == global::System.IntPtr.Zero;
49             }
50         }
51         /// <summary>
52         /// Release handle itself.
53         /// </summary>
54         /// <returns>true when released successfully.</returns>
55         [EditorBrowsable(EditorBrowsableState.Never)]
56         protected override bool ReleaseHandle()
57         {
58             SetHandle(global::System.IntPtr.Zero);
59             return true;
60         }
61     }
62 }