[NUI] Re-structuring NUI by classifying modules
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / internal / WebView / WebBackForwardList.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;
19 using System.ComponentModel;
20
21 namespace Tizen.NUI
22 {
23     /// <summary>
24     /// WebBackForwardListItem is a class for back-forward list item of web view.
25     /// </summary>
26     [EditorBrowsable(EditorBrowsableState.Never)]
27     public class WebBackForwardListItem : Disposable
28     {
29         /// <summary>
30         /// Get uri.
31         /// </summary>
32         [EditorBrowsable(EditorBrowsableState.Never)]
33         public Uri Url
34         {
35             get
36             {
37                 return new Uri(Interop.WebBackForwardListItem.GetUrl(SwigCPtr));
38             }
39         }
40
41         /// <summary>
42         /// Get title.
43         /// </summary>
44         [EditorBrowsable(EditorBrowsableState.Never)]
45         public string Title
46         {
47             get
48             {
49                 return Interop.WebBackForwardListItem.GetTitle(SwigCPtr);
50             }
51         }
52
53         /// <summary>
54         /// Get original url.
55         /// </summary>
56         [EditorBrowsable(EditorBrowsableState.Never)]
57         public Uri OriginalUrl
58         {
59             get
60             {
61                 return new Uri(Interop.WebBackForwardListItem.GetOriginalUrl(SwigCPtr));
62             }
63         }
64
65         internal WebBackForwardListItem(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
66         {
67         }
68
69         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WebBackForwardListItem obj)
70         {
71             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
72         }
73
74         /// <summary>
75         /// Dispose for IDisposable pattern
76         /// </summary>
77         [EditorBrowsable(EditorBrowsableState.Never)]
78         protected override void Dispose(DisposeTypes type)
79         {
80             if (disposed)
81             {
82                 return;
83             }
84
85             if (type == DisposeTypes.Explicit)
86             {
87                 //Called by User
88                 //Release your own managed resources here.
89                 //You should release all of your own disposable objects here.
90             }
91
92             base.Dispose(type);
93         }
94     }
95
96     /// <summary>
97     /// WebBackForwardList is a class for back-forward list of web view.
98     /// </summary>
99     [EditorBrowsable(EditorBrowsableState.Never)]
100     public class WebBackForwardList : Disposable
101     {
102         /// <summary>
103         /// Get item count.
104         /// </summary>
105         [EditorBrowsable(EditorBrowsableState.Never)]
106         public int ItemCount
107         {
108             get
109             {
110                 return Interop.WebBackForwardList.GetItemCount(SwigCPtr);
111             }
112         }
113
114         /// <summary>
115         /// Get current item.
116         /// </summary>
117         [EditorBrowsable(EditorBrowsableState.Never)]
118         public WebBackForwardListItem GetCurrentItem()
119         {
120             System.IntPtr itemPtr = Interop.WebBackForwardList.GetCurrentItem(SwigCPtr);
121             return new WebBackForwardListItem(itemPtr, false);
122         }
123
124         /// <summary>
125         /// Get current item.
126         /// </summary>
127         [EditorBrowsable(EditorBrowsableState.Never)]
128         public WebBackForwardListItem GetItemAtIndex(int index)
129         {
130             System.IntPtr itemPtr = Interop.WebBackForwardList.GetItemAtIndex(SwigCPtr, index);
131             return new WebBackForwardListItem(itemPtr, false);
132         }
133
134         internal WebBackForwardList(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
135         {
136         }
137
138         internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WebBackForwardList obj)
139         {
140             return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.SwigCPtr;
141         }
142
143         /// <summary>
144         /// Dispose for IDisposable pattern
145         /// </summary>
146         [EditorBrowsable(EditorBrowsableState.Never)]
147         protected override void Dispose(DisposeTypes type)
148         {
149             if (disposed)
150             {
151                 return;
152             }
153
154             if (type == DisposeTypes.Explicit)
155             {
156                 //Called by User
157                 //Release your own managed resources here.
158                 //You should release all of your own disposable objects here.
159             }
160
161             base.Dispose(type);
162         }
163     }
164 }
165