[NUI] Add SetUnderline, GetUnderline to Text Components
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / BaseComponents / CameraView.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 using System;
18 using System.ComponentModel;
19 using System.Runtime.InteropServices;
20
21 namespace Tizen.NUI.BaseComponents
22 {
23     /// <summary>
24     /// CameraView is a view for camera preview.
25     /// </summary>
26     [EditorBrowsable(EditorBrowsableState.Never)]
27     public class CameraView : View
28     {
29         [EditorBrowsable(EditorBrowsableState.Never)]
30         public enum DisplayType
31         {
32             Window = 0,   //  HW overlay
33             Image     //  texture stream
34         };
35
36         /// <summary>
37         /// Creates an initialized CameraView.
38         /// </summary>
39         /// <param name="handle">Multimedia Camera handle</param>
40         /// <param name="type">DisplayType</param>
41         [EditorBrowsable(EditorBrowsableState.Never)]
42         public CameraView(global::System.IntPtr handle, DisplayType type = DisplayType.Window) : this(Interop.CameraView.New(handle, (int)type), true)
43         {
44             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
45         }
46
47         internal CameraView(CameraView cameraView) : this(Interop.CameraView.NewCameraView(CameraView.getCPtr(cameraView)), true)
48         {
49             if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
50         }
51
52         internal CameraView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
53         {
54         }
55
56         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(CameraView obj)
57         {
58             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
59         }
60
61         /// <summary>
62         /// Called when the camera view needs to be updated if the camera setting is changed..
63         /// </summary>
64         [EditorBrowsable(EditorBrowsableState.Never)]
65         public void Update()
66         {
67             Interop.CameraView.Update(SwigCPtr);
68         }
69
70         /// <summary>
71         /// Dispose.
72         /// </summary>
73         /// <param name="type">DisposeTypes</param>
74         [EditorBrowsable(EditorBrowsableState.Never)]
75         protected override void Dispose(DisposeTypes type)
76         {
77             if (disposed)
78             {
79                 return;
80             }
81
82             base.Dispose(type);
83         }
84
85         /// This will not be public opened.
86         [EditorBrowsable(EditorBrowsableState.Never)]
87         protected override void ReleaseSwigCPtr(System.Runtime.InteropServices.HandleRef swigCPtr)
88         {
89             Interop.CameraView.DeleteCameraView(swigCPtr);
90         }
91     }
92
93 }