Merge "Add C# binding for VideoView.Underlay property."
[platform/core/csapi/tizenfx.git] / src / Tizen.NUI / src / public / InputMethod.cs
1 // Copyright (c) 2017 Samsung Electronics Co., Ltd.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 //
15
16 namespace Tizen.NUI
17 {
18
19     /// <summary>
20     /// A class encapsulating the input method map.
21     /// </summary>
22     public class InputMethod
23     {
24         private PanelLayoutType? _panelLayout = null;
25         private ActionButtonTitleType? _actionButton = null;
26         private AutoCapitalType? _autoCapital = null;
27         private int? _variation = null;
28
29         /// <summary>
30         /// The default constructor.
31         /// </summary>
32         /// <since_tizen> 3 </since_tizen>
33         public InputMethod()
34         {
35         }
36
37         /// <summary>
38         /// Gets or sets the panel layout.
39         /// </summary>
40         /// <since_tizen> 3 </since_tizen>
41         public PanelLayoutType PanelLayout
42         {
43             get
44             {
45                 return _panelLayout ?? PanelLayoutType.Normal;
46             }
47             set
48             {
49                 _panelLayout = value;
50             }
51         }
52
53         /// <summary>
54         /// Gets or sets the action button.
55         /// </summary>
56         /// <since_tizen> 3 </since_tizen>
57         public ActionButtonTitleType ActionButton
58         {
59             get
60             {
61                 return _actionButton ?? ActionButtonTitleType.Default;
62             }
63             set
64             {
65                 _actionButton = value;
66             }
67         }
68
69         /// <summary>
70         /// Gets or sets the auto capital.
71         /// </summary>
72         /// <since_tizen> 3 </since_tizen>
73         public AutoCapitalType AutoCapital
74         {
75             get
76             {
77                 return _autoCapital ?? AutoCapitalType.None;
78             }
79             set
80             {
81                 _autoCapital = value;
82             }
83         }
84
85         /// <summary>
86         /// Gets or sets the variation.
87         /// </summary>
88         /// <since_tizen> 3 </since_tizen>
89         public int Variation
90         {
91             get
92             {
93                 return _variation ?? 0;
94             }
95             set
96             {
97                 _variation = value;
98             }
99         }
100
101         /// <summary>
102         /// Gets or sets the variation for normal layout.
103         /// </summary>
104         /// <since_tizen> 3 </since_tizen>
105         public NormalLayoutType NormalVariation
106         {
107             get
108             {
109                 return (NormalLayoutType) (_variation ?? 0);
110             }
111             set
112             {
113                 _variation = (int)value;
114             }
115         }
116
117         /// <summary>
118         /// Gets or sets the variation for the number only layout.
119         /// </summary>
120         /// <since_tizen> 3 </since_tizen>
121         public NumberOnlyLayoutType NumberOnlyVariation
122         {
123             get
124             {
125                 return (NumberOnlyLayoutType) (_variation ?? 0);
126             }
127             set
128             {
129                 _variation = (int)value;
130             }
131         }
132
133         /// <summary>
134         /// Gets or sets the variation for the password layout.
135         /// </summary>
136         /// <since_tizen> 3 </since_tizen>
137         public PasswordLayoutType PasswordVariation
138         {
139             get
140             {
141                 return (PasswordLayoutType) (_variation ?? 0);
142             }
143             set
144             {
145                 _variation = (int)value;
146             }
147         }
148
149         private PropertyMap ComposingInputMethodMap()
150         {
151             PropertyMap _outputMap = new PropertyMap();
152             if (_panelLayout != null) { _outputMap.Add("PANEL_LAYOUT", new PropertyValue((int)_panelLayout)); }
153             if (_actionButton != null) { _outputMap.Add("ACTION_BUTTON", new PropertyValue((int)_actionButton)); }
154             if (_autoCapital != null) { _outputMap.Add("AUTO_CAPITALISE", new PropertyValue((int)_autoCapital)); }
155             if (_variation != null) { _outputMap.Add("VARIATION", new PropertyValue((int)_variation)); }
156             return _outputMap;
157         }
158
159         /// <summary>
160         /// Gets the input method map.
161         /// </summary>
162         /// <since_tizen> 3 </since_tizen>
163         public PropertyMap OutputMap
164         {
165             get
166             {
167                 return ComposingInputMethodMap();
168             }
169         }
170
171         /// <summary>
172         /// SetType that can be changed in the system input method.
173         /// </summary>
174         /// <since_tizen> 3 </since_tizen>
175         public enum CategoryType
176         {
177             /// <summary>
178             /// Set the keyboard layout.
179             /// </summary>
180             PanelLayout,
181             /// <summary>
182             /// Set the action button title.
183             /// </summary>
184             ActionButtonTitle,
185             /// <summary>
186             /// Set the auto capitalise of input.
187             /// </summary>
188             AutoCapitalise,
189             /// <summary>
190             /// Set the variation.
191             /// </summary>
192             Variation
193         }
194
195         /// <summary>
196         /// Autocapitalization Types.
197         /// </summary>
198         /// <since_tizen> 3 </since_tizen>
199         public enum AutoCapitalType
200         {
201             /// <summary>
202             /// No auto-capitalization when typing.
203             /// </summary>
204             None,
205             /// <summary>
206             /// Autocapitalize each word typed.
207             /// </summary>
208             Word,
209             /// <summary>
210             /// Autocapitalize the start of each sentence.
211             /// </summary>
212             Sentence,
213             /// <summary>
214             /// Autocapitalize all letters.
215             /// </summary>
216             Allcharacter
217         }
218
219         /// <summary>
220         /// Input panel (virtual keyboard) layout types..
221         /// </summary>
222         /// <since_tizen> 3 </since_tizen>
223         public enum PanelLayoutType
224         {
225             /// <summary>
226             /// Default layout.
227             /// </summary>
228             Normal,
229             /// <summary>
230             /// Number layout.
231             /// </summary>
232             Number,
233             /// <summary>
234             /// Email layout.
235             /// </summary>
236             Email,
237             /// <summary>
238             /// URL layout.
239             /// </summary>
240             URL,
241             /// <summary>
242             /// Phone number layout.
243             /// </summary>
244             PhoneNumber,
245             /// <summary>
246             /// IP layout.
247             /// </summary>
248             IP,
249             /// <summary>
250             /// Month layout.
251             /// </summary>
252             Month,
253             /// <summary>
254             /// Number layout.
255             /// </summary>
256             NumberOnly,
257             /// <summary>
258             /// Hexadecimal layout.
259             /// </summary>
260             HEX,
261             /// <summary>
262             /// Command-line terminal layout including Esc, Alt, Ctrl key, and so on (no auto-correct, no auto-capitalization).
263             /// </summary>
264             Terminal,
265             /// <summary>
266             /// Like normal, but no auto-correct, no auto-capitalization etc.
267             /// </summary>
268             Password,
269             /// <summary>
270             /// Date and time layout.
271             /// </summary>
272             Datetime,
273             /// <summary>
274             /// Emoticon layout.
275             /// </summary>
276             Emoticon
277         }
278
279         /// <summary>
280         /// Specifies what the Input Method "action" button functionality is set to.
281         /// </summary>
282         /// <since_tizen> 3 </since_tizen>
283         public enum ActionButtonTitleType
284         {
285             /// <summary>
286             /// Default action.
287             /// </summary>
288             Default,
289             /// <summary>
290             /// Done.
291             /// </summary>
292             Done,
293             /// <summary>
294             /// Go action.
295             /// </summary>
296             Go,
297             /// <summary>
298             /// Join action.
299             /// </summary>
300             Join,
301             /// <summary>
302             /// Login action.
303             /// </summary>
304             Login,
305             /// <summary>
306             /// Next action.
307             /// </summary>
308             Next,
309             /// <summary>
310             /// Previous action.
311             /// </summary>
312             Previous,
313             /// <summary>
314             /// Search action.
315             /// </summary>
316             Search,
317             /// <summary>
318             /// Send action.
319             /// </summary>
320             Send,
321             /// <summary>
322             /// Sign in action.
323             /// </summary>
324             SignIn,
325             /// <summary>
326             /// Unspecified action.
327             /// </summary>
328             Unspecified,
329             /// <summary>
330             /// Nothing to do.
331             /// </summary>
332             None
333         }
334
335         /// <summary>
336         /// Available variation for the normal layout.
337         /// </summary>
338         /// <since_tizen> 3 </since_tizen>
339         public enum NormalLayoutType
340         {
341             /// <summary>
342             /// The plain normal layout.
343             /// </summary>
344             Normal,
345             /// <summary>
346             /// Filename layout. sysbols such as '/' should be disabled.
347             /// </summary>
348             WithFilename,
349             /// <summary>
350             /// The name of a person.
351             /// </summary>
352             WithPersonName
353         }
354
355         /// <summary>
356         /// Available variation for the number only layout.
357         /// </summary>
358         /// <since_tizen> 3 </since_tizen>
359         public enum NumberOnlyLayoutType
360         {
361             /// <summary>
362             /// The plain normal number layout.
363             /// </summary>
364             Normal,
365             /// <summary>
366             /// The number layout to allow a positive or negative sign at the start.
367             /// </summary>
368             WithSigned,
369             /// <summary>
370             /// The number layout to allow decimal point to provide fractional value.
371             /// </summary>
372             WithDecimal,
373             /// <summary>
374             /// The number layout to allow decimal point and negative sign.
375             /// </summary>
376             WithSignedAndDecimal
377         }
378
379         /// <summary>
380         /// Available variation for the password layout.
381         /// </summary>
382         /// <since_tizen> 3 </since_tizen>
383         public enum PasswordLayoutType
384         {
385             /// <summary>
386             /// The normal password layout.
387             /// </summary>
388             Normal,
389             /// <summary>
390             /// The password layout to allow only number.
391             /// </summary>
392             WithNumberOnly
393         }
394
395     }
396 }