37d85c9c36e3f8ab189012c153670f4f4ede13f2
[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         internal WebBackForwardListItem(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
30         {
31         }
32
33         /// <summary>
34         /// Get uri.
35         /// </summary>
36         [EditorBrowsable(EditorBrowsableState.Never)]
37         public Uri Url
38         {
39             get
40             {
41                 return new Uri(Interop.WebBackForwardListItem.GetUrl(SwigCPtr));
42             }
43         }
44
45         /// <summary>
46         /// Get title.
47         /// </summary>
48         [EditorBrowsable(EditorBrowsableState.Never)]
49         public string Title
50         {
51             get
52             {
53                 return Interop.WebBackForwardListItem.GetTitle(SwigCPtr);
54             }
55         }
56
57         /// <summary>
58         /// Get original url.
59         /// </summary>
60         [EditorBrowsable(EditorBrowsableState.Never)]
61         public Uri OriginalUrl
62         {
63             get
64             {
65                 return new Uri(Interop.WebBackForwardListItem.GetOriginalUrl(SwigCPtr));
66             }
67         }
68     }
69
70     /// <summary>
71     /// WebBackForwardList is a class for back-forward list of web view.
72     /// </summary>
73     [EditorBrowsable(EditorBrowsableState.Never)]
74     public class WebBackForwardList : Disposable
75     {
76         internal WebBackForwardList(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn)
77         {
78         }
79
80         /// <summary>
81         /// Get item count.
82         /// </summary>
83         [EditorBrowsable(EditorBrowsableState.Never)]
84         public int ItemCount
85         {
86             get
87             {
88                 return Interop.WebBackForwardList.GetItemCount(SwigCPtr);
89             }
90         }
91
92         /// <summary>
93         /// Get current item.
94         /// </summary>
95         [EditorBrowsable(EditorBrowsableState.Never)]
96         public WebBackForwardListItem GetCurrentItem()
97         {
98             System.IntPtr itemPtr = Interop.WebBackForwardList.GetCurrentItem(SwigCPtr);
99             return new WebBackForwardListItem(itemPtr, false);
100         }
101
102         /// <summary>
103         /// Get current item.
104         /// </summary>
105         [EditorBrowsable(EditorBrowsableState.Never)]
106         public WebBackForwardListItem GetItemAtIndex(int index)
107         {
108             System.IntPtr itemPtr = Interop.WebBackForwardList.GetItemAtIndex(SwigCPtr, index);
109             return new WebBackForwardListItem(itemPtr, false);
110         }
111     }
112 }
113