Update the refined dali c# application to support more argument options
[platform/core/uifw/dali-toolkit.git] / plugins / dali-swig / manual / csharp / Tizen.Applications / DaliApplication.cs
old mode 100755 (executable)
new mode 100644 (file)
index 06d7756..6791355
@@ -28,13 +28,61 @@ namespace Tizen.Applications
         /// This application is created before OnCreate() or created event. And the DaliApplication will be terminated when this application is closed.
         /// </remarks>
         protected Dali.Application application;
+
+        /// <summary>
+        /// The instance of the Dali Application extension.
+        /// </summary>
         protected Dali.ApplicationExtensions applicationExt;
 
         /// <summary>
+        /// Store the stylesheet value.
+        /// </summary>
+        protected string m_stylesheet;
+
+        /// <summary>
+        /// Store the window mode value.
+        /// </summary>
+        protected Dali.Application.WINDOW_MODE m_windowMode;
+
+        /// <summary>
+        /// Store the app mode value.
+        /// </summary>
+        protected APP_MODE appMode;
+
+        /// <summary>
         /// The instance of the Dali Stage.
         /// </summary>
         public Stage stage { get; private set; }
 
+        /// <summary>
+        /// The default constructor.
+        /// </summary>
+        public DaliApplication():base()
+        {
+            appMode = APP_MODE.DEFAULT;
+        }
+
+        /// <summary>
+        /// The constructor with stylesheet.
+        /// </summary>
+        public DaliApplication(string stylesheet):base()
+        {
+            //handle the stylesheet
+            appMode = APP_MODE.STYLESHEETONLY;
+            m_stylesheet = stylesheet;
+        }
+
+        /// <summary>
+        /// The constructor with stylesheet and window mode.
+        /// </summary>
+        public DaliApplication(string stylesheet, Dali.Application.WINDOW_MODE windowMode)
+            : base()
+        {
+            //handle the stylesheet and windowMode
+            appMode = APP_MODE.STYLESHEETWITHWINDOWMODE;
+            m_stylesheet = stylesheet;
+            m_windowMode = windowMode;
+        }
 
         /// <summary>
         /// Overrides this method if want to handle behavior before calling OnCreate().
@@ -42,8 +90,22 @@ namespace Tizen.Applications
         /// </summary>
         protected override void OnPreCreate()
         {
-            application = Dali.Application.NewApplication();
-            applicationExt = new Dali::ApplicationExtensions(application);
+            switch(appMode)
+            {
+                case APP_MODE.DEFAULT:
+                    application = Dali.Application.NewApplication();
+                    break;
+                case APP_MODE.STYLESHEETONLY:
+                    application = Dali.Application.NewApplication(m_stylesheet);
+                    break;
+                case APP_MODE.STYLESHEETWITHWINDOWMODE:
+                    application = Dali.Application.NewApplication(m_stylesheet, m_windowMode);
+                    break;
+                default:
+                    break;
+            }
+
+            applicationExt = new Dali.ApplicationExtensions(application);
             applicationExt.Init();
 
             stage = Stage.GetCurrent();
@@ -85,5 +147,15 @@ namespace Tizen.Applications
             base.OnLocaleChanged(e);
             applicationExt.LanguageChange();
         }
+
+        /// <summary>
+        /// The mode of creating Dali application.
+        /// </summary>
+        protected enum APP_MODE
+        {
+            DEFAULT = 0,
+            STYLESHEETONLY = 1,
+            STYLESHEETWITHWINDOWMODE = 2
+        }
     }
 }