Make Page Navigation APIs public
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI.Components / Controls / Navigation / Page.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
20 namespace Tizen.NUI.Components
21 {
22     /// <summary>
23     /// PageAppearingEventArgs is a class to record page appearing event arguments which will be sent to user.
24     /// </summary>
25     [EditorBrowsable(EditorBrowsableState.Never)]
26     public class PageAppearingEventArgs : EventArgs
27     {
28     }
29
30     /// <summary>
31     /// PageDisappearingEventArgs is a class to record page disappearing event arguments which will be sent to user.
32     /// </summary>
33     [EditorBrowsable(EditorBrowsableState.Never)]
34     public class PageDisappearingEventArgs : EventArgs
35     {
36     }
37
38     /// <summary>
39     /// The Page class is a class which is an element of navigation.
40     /// </summary>
41     /// <since_tizen> 9 </since_tizen>
42     public abstract class Page : Control
43     {
44         private Navigator navigator = null;
45
46         /// <summary>
47         /// Creates a new instance of a Page.
48         /// </summary>
49         /// <since_tizen> 9 </since_tizen>
50         public Page() : base()
51         {
52         }
53
54         /// <summary>
55         /// Navigator which has pushed the Page into its stack.
56         /// If this Page has not been pushed into any Navigator, then Navigator is null.
57         /// </summary>
58         /// <since_tizen> 9 </since_tizen>
59         public Navigator Navigator
60         {
61             get
62             {
63                 return navigator;
64             }
65             internal set
66             {
67                 if (navigator == value)
68                 {
69                     return;
70                 }
71
72                 navigator = value;
73             }
74         }
75
76         /// <summary>
77         /// An event for the page appearing signal which can be used to subscribe or unsubscribe the event handler provided by the user.
78         /// </summary>
79         [EditorBrowsable(EditorBrowsableState.Never)]
80         public event EventHandler<PageAppearingEventArgs> Appearing;
81
82         /// <summary>
83         /// An event for the page disappearing signal which can be used to subscribe or unsubscribe the event handler provided by the user.
84         /// </summary>
85         [EditorBrowsable(EditorBrowsableState.Never)]
86         public event EventHandler<PageDisappearingEventArgs> Disappearing;
87
88         internal void InvokeAppearing()
89         {
90             Appearing?.Invoke(this, new PageAppearingEventArgs());
91         }
92
93         internal void InvokeDisappearing()
94         {
95             Disappearing?.Invoke(this, new PageDisappearingEventArgs());
96         }
97     }
98 }