Move Event Handlers to View class
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / manual / csharp / Tizen.Applications / DaliApplication.cs
1 // Copyright 2016 by Samsung Electronics, Inc.,
2 //
3 // This software is the confidential and proprietary information
4 // of Samsung Electronics, Inc. ("Confidential Information"). You
5 // shall not disclose such Confidential Information and shall use
6 // it only in accordance with the terms of the license agreement
7 // you entered into with Samsung.
8 using System;
9 using Dali;
10
11 //------------------------------------------------------------------------------
12 // <manual-generated />
13 //
14 // This file can only run on Tizen target. You should compile it with hello-test.cs, and
15 // add tizen c# application related library as reference.
16 //------------------------------------------------------------------------------
17 namespace Tizen.Applications
18 {
19     /// <summary>
20     /// Represents an application that have UI screen. The DaliApplication class has a default stage.
21     /// </summary>
22     public class DaliApplication : CoreUIApplication
23     {
24         /// <summary>
25         /// The instance of the Dali Application.
26         /// </summary>
27         /// <remarks>
28         /// This application is created before OnCreate() or created event. And the DaliApplication will be terminated when this application is closed.
29         /// </remarks>
30         protected Dali.Application application;
31         protected Dali.ApplicationExtensions applicationExt;
32
33         /// <summary>
34         /// The instance of the Dali Stage.
35         /// </summary>
36         public Stage stage { get; private set; }
37
38
39         /// <summary>
40         /// Overrides this method if want to handle behavior before calling OnCreate().
41         /// stage property is initialized in this overrided method.
42         /// </summary>
43         protected override void OnPreCreate()
44         {
45             application = Dali.Application.NewApplication();
46             applicationExt = new Dali::ApplicationExtensions(application);
47             applicationExt.Init();
48
49             stage = Stage.GetCurrent();
50             stage.SetBackgroundColor( NDalic.WHITE );
51         }
52
53         /// <summary>
54         /// Overrides this method if want to handle behavior.
55         /// </summary>
56         protected override void OnTerminate()
57         {
58             base.OnTerminate();
59             applicationExt.Terminate();
60         }
61
62         /// <summary>
63         /// Overrides this method if want to handle behavior.
64         /// </summary>
65         protected override void OnPause()
66         {
67             base.OnPause();
68             applicationExt.Pause();
69         }
70
71         /// <summary>
72         /// Overrides this method if want to handle behavior.
73         /// </summary>
74         protected override void OnResume()
75         {
76             base.OnResume();
77             applicationExt.Resume();
78         }
79
80         /// <summary>
81         /// Overrides this method if want to handle behavior.
82         /// </summary>
83         protected override void OnLocaleChanged(LocaleChangedEventArgs e)
84         {
85             base.OnLocaleChanged(e);
86             applicationExt.LanguageChange();
87         }
88     }
89 }