[NUI] Fix to disable ThemeManager in tv profile
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / Application / NUIFrameComponent.cs
1 /*
2  * Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
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.ComponentModel;
18 using Tizen.Applications;
19 using Tizen.Applications.ComponentBased.Common;
20
21 namespace Tizen.NUI
22 {
23     /// <summary>
24     /// The class for showing UI module
25     /// </summary>
26     [EditorBrowsable(EditorBrowsableState.Never)]
27     public class NUIFrameComponent : FrameComponent
28     {
29         private bool defaultWindowSet = false;
30         internal NUIWindowInfo NUIWindowInfo
31         {
32             get;
33             set;
34         }
35
36         [EditorBrowsable(EditorBrowsableState.Never)]
37         public Window Window
38         {
39             get;
40             set;
41         }
42
43         /// <summary>
44         /// Overrides this method to create window. It will be called before OnCreate method.
45         /// </summary>
46         /// <returns>Window object to use</returns>
47         [EditorBrowsable(EditorBrowsableState.Never)]
48         public override IWindowInfo CreateWindowInfo()
49         {
50             ComponentApplication instance = ComponentApplication.Instance as ComponentApplication;
51             if (instance != null)
52             {
53                 if (!defaultWindowSet)
54                 {
55                     instance.GetWindow().WindowPositionSize = new Rectangle(0, 0, 1, 1);
56                     instance.GetWindow().BackgroundColor = new Color(0, 0, 0, 0);
57                     instance.GetWindow().Hide();
58                     defaultWindowSet = true;
59                 }
60
61                 Window = new Window();
62                 Window.Show();
63             }
64             NUIWindowInfo = new NUIWindowInfo(Window);
65             return NUIWindowInfo;
66         }
67
68         /// <summary>
69         /// Overrides this method to handle behavior when the component is launched.
70         /// </summary>
71         /// <returns>True if a service component is successfully created</returns>
72         [EditorBrowsable(EditorBrowsableState.Never)]
73         public override bool OnCreate()
74         {
75             return true;
76         }
77
78         /// <summary>
79         /// Overrides this method if want to handle behavior when the component receives the appcontrol message.
80         /// </summary>
81         /// <param name="appControl">appcontrol object</param>
82         /// <param name="restarted">True if it was restarted</param>
83         [EditorBrowsable(EditorBrowsableState.Never)]
84         public override void OnStart(AppControl appControl, bool restarted)
85         {
86             base.OnStart(appControl, restarted);
87         }
88
89         /// <summary>
90         /// Overrides this method if you want to handle the behavior when the component is resumed.
91         /// </summary>
92         [EditorBrowsable(EditorBrowsableState.Never)]
93         public override void OnResume()
94         {
95             base.OnResume();
96         }
97
98         /// <summary>
99         /// Overrides this method if you want to handle the behavior when the component is paused.
100         /// </summary>
101         [EditorBrowsable(EditorBrowsableState.Never)]
102         public override void OnPause()
103         {
104             base.OnPause();
105         }
106
107         /// <summary>
108         /// Overrides this method if you want to handle the behavior when the component is stopped.
109         /// </summary>
110         [EditorBrowsable(EditorBrowsableState.Never)]
111         public override void OnStop()
112         {
113             base.OnStop();
114         }
115
116         /// <summary>
117         /// Overrides this method if want to handle behavior when the component is destroyed.
118         /// </summary>
119         [EditorBrowsable(EditorBrowsableState.Never)]
120         public override void OnDestroy()
121         {
122             base.OnDestroy();
123         }
124     }
125 }
126