[Inputmethod] Fix API description (#637)
[platform/core/csapi/tizenfx.git] / src / Tizen.Uix.InputMethod / Tizen.Uix.InputMethod / EditorWindow.cs
1 /*
2 * Copyright (c) 2016 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 Tizen;
18 using System;
19 using ElmSharp;
20 using static Interop.InputMethod;
21
22 namespace Tizen.Uix.InputMethod
23 {
24     /// <summary>
25     /// The editor window class.
26     /// </summary>
27     /// <since_tizen> 4 </since_tizen>
28     public class EditorWindow : Window
29     {
30         internal static IntPtr _handle = IntPtr.Zero;
31         private IntPtr _realHandle = IntPtr.Zero;
32
33         internal EditorWindow():base("Edit")
34         {
35             _realHandle = _handle;
36         }
37
38         /// <summary>
39         /// This API creates a handle for the editor window.
40         /// </summary>
41         /// <param name="parent">Parent EvasObject.</param>
42         /// <returns>Handle IntPtr.</returns>
43         /// <since_tizen> 4 </since_tizen>
44         protected override IntPtr CreateHandle(EvasObject parent)
45         {
46             return _handle;
47         }
48
49         /// <summary>
50         /// This API gets a handle for the editor window.
51         /// </summary>
52         /// <returns>Handle IntPtr.</returns>
53         /// <since_tizen> 4 </since_tizen>
54         public IntPtr GetHandle()
55         {
56             return _handle;
57         }
58
59         /// <summary>
60         /// This API updates the input panel window's size information.
61         /// </summary>
62         /// <privilege>
63         /// http://tizen.org/privilege/ime
64         /// </privilege>
65         /// <param name="portraitWidth">The width in the portrait mode.</param>
66         /// <param name="portraitHeight">The height in the portrait mode.</param>
67         /// <param name="landscapeWidth">The width in the landscape mode.</param>
68         /// <param name="landscapeHeight">The height in the landscape mode.</param>
69         /// <exception cref="InvalidOperationException">
70         /// This can occur due to the following reasons:
71         /// 1) The application does not have the privilege to call this function.
72         /// 2) The IME main loop has not started yet.
73         /// </exception>
74         /// <since_tizen> 4 </since_tizen>
75         public static void SetSize(int portraitWidth, int portraitHeight, int landscapeWidth, int landscapeHeight)
76         {
77             ErrorCode error = ImeSetSize(portraitWidth, portraitHeight, landscapeWidth, landscapeHeight);
78             if (error != ErrorCode.None)
79             {
80                 Log.Error(LogTag, "SetSize Failed with error " + error);
81                 throw InputMethodExceptionFactory.CreateException(error);
82             }
83         }
84     }
85 }