Add comments for WindowPort.cs
authorGeunsun, Lee <gs86.lee@samsung.com>
Tue, 28 Mar 2017 11:23:30 +0000 (20:23 +0900)
committerChulSeung Kim <charles0.kim@samsung.com>
Thu, 8 Jun 2017 09:34:51 +0000 (18:34 +0900)
Change-Id: I07b283126128398e87c3a7fb3c266deeb02a6681

LibTVRefCommonTizen/Ports/WindowPort.cs

index 32c7636..3829121 100644 (file)
@@ -21,22 +21,27 @@ using Xamarin.Forms.Platform.Tizen.Native;
 
 namespace LibTVRefCommonTizen.Ports
 {
+    /// <summary>
+    /// Handles Window APIs
+    /// </summary>
     public class WindowPort : IWindowAPIs
     {
         internal class ElmWindow
         {
             [DllImport("libelementary.so.1", EntryPoint = "elm_win_keygrab_set", CallingConvention = CallingConvention.Cdecl)]
-            internal static extern IntPtr elm_win_keygrab_set(IntPtr obj, string key, ulong modifiers, ulong  not_modifiers, int proirity, int grab_mode);
+            internal static extern IntPtr ElmWinKeygrabSet(IntPtr obj, string key, ulong modifiers, ulong not_modifiers, int proirity, int grab_mode);
 
             [DllImport("libelementary.so.1", EntryPoint = "elm_win_iconified_set", CallingConvention = CallingConvention.Cdecl)]
-            internal static extern void elm_win_iconified_set(IntPtr obj, bool iconified);
+            internal static extern void ElmWinIconfiedSet(IntPtr obj, bool iconified);
 
             [DllImport("libelementary.so.1", EntryPoint = "elm_win_iconified_get", CallingConvention = CallingConvention.Cdecl)]
-            internal static extern bool elm_win_iconified_get(IntPtr obj);
+            internal static extern bool ElmWinIconifiedGet(IntPtr obj);
         }
 
+        /// <summary>
+        /// The main window of the App
+        /// </summary>
         static private Window mainWindow;
-
         public Window MainWindow
         {
             set
@@ -45,30 +50,57 @@ namespace LibTVRefCommonTizen.Ports
             }
         }
 
+        /// <summary>
+        /// Sets the keygrab of the Elm_Win object
+        /// </summary>
+        /// <param name="key">
+        /// keyname string to set keygrab
+        /// </param>
         public void SetKeyGrabExclusively(string key)
         {
             if (mainWindow != null)
-                ElmWindow.elm_win_keygrab_set((IntPtr)mainWindow, key, 0, 0, 0, 1024);
+            {
+                ElmWindow.ElmWinKeygrabSet((IntPtr)mainWindow, key, 0, 0, 0, 1024);
+            }
         }
 
+        /// <summary>
+        /// Sets the iconified state of a window
+        /// </summary>
+        /// <param name="iconified">
+        /// If true the window is iconified, otherwise false
+        /// </param>
         public void SetIconified(bool iconified)
         {
             if (mainWindow != null)
-                ElmWindow.elm_win_iconified_set((IntPtr)mainWindow, iconified);
+            {
+                ElmWindow.ElmWinIconfiedSet((IntPtr)mainWindow, iconified);
+            }
         }
 
+        /// <summary>
+        /// Gets the iconified state of a window
+        /// </summary>
+        /// <returns>
+        /// true if the window is iconified, otherwise false
+        /// </returns>
         public bool GetIconified()
         {
-            if (mainWindow != null)
-                return ElmWindow.elm_win_iconified_get((IntPtr)mainWindow);
-            else
-                return false;
+            return (mainWindow != null) ? ElmWindow.ElmWinIconifiedGet((IntPtr)mainWindow) : false;
         }
 
+        /// <summary>
+        /// Activates the window object
+        /// </summary>
+        /// <remarks>
+        /// This is just a request that a Window Manager may ignore, so calling this function does not ensure in any way that the window is going to be the active one after it
+        /// </remarks>
         public void Active()
         {
             if (mainWindow != null)
+            {
                 mainWindow.Active();
+            }
         }
     }
 }