[ACR-564] deprecate unused API
[platform/core/csapi/tizenfx.git] / src / ElmSharp / ElmSharp / Window.cs
1 /*
2  * Copyright (c) 2018 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 System;
18 using System.Collections.Generic;
19 using System.ComponentModel;
20
21 namespace ElmSharp
22 {
23     /// <summary>
24     /// Enumeration for the display rotation of window.
25     /// </summary>
26     /// <since_tizen> preview </since_tizen>
27     [Obsolete("This has been deprecated in API12")]
28     [Flags]
29     public enum DisplayRotation
30     {
31         /// <summary>
32         /// Rotation value of the window is 0 degree.
33         /// </summary>
34         Degree_0 = 1,
35
36         /// <summary>
37         /// Rotation value of the window is 90 degrees.
38         /// </summary>
39         Degree_90 = 2,
40
41         /// <summary>
42         /// Rotation value of the window is 180 degrees.
43         /// </summary>
44         Degree_180 = 4,
45
46         /// <summary>
47         /// Rotation value of the window is 270 degrees.
48         /// </summary>
49         Degree_270 = 8
50     };
51
52     /// <summary>
53     /// Enumeration for the indicator opacity.
54     /// </summary>
55     /// <since_tizen> preview </since_tizen>
56     [Obsolete("This has been deprecated in API12")]
57     public enum StatusBarMode
58     {
59         /// <summary>
60         /// Opacifies the status bar.
61         /// </summary>
62         Opaque = 1,
63
64         /// <summary>
65         /// Be translucent the status bar.
66         /// </summary>
67         /// <remarks>
68         /// Not supported.
69         /// </remarks>
70         Translucent = 2,
71
72         /// <summary>
73         /// Transparentizes the status bar.
74         /// </summary>
75         Transparent = 3,
76     }
77
78     /// <summary>
79     /// Enumeration for the keygrab modes of the window.
80     /// </summary>
81     /// <since_tizen> preview </since_tizen>
82     [Obsolete("This has been deprecated in API12")]
83     [EditorBrowsable(EditorBrowsableState.Never)]
84     public enum KeyGrabMode
85     {
86         /// <summary>
87         /// Unknown keygrab mode.
88         /// </summary>
89         Shared = 256,
90
91         /// <summary>
92         /// Getting the grabbed-key together with the other client windows.
93         /// </summary>
94         Topmost = 512,
95
96         /// <summary>
97         /// Getting the grabbed-key only when the window is top of the stack.
98         /// </summary>
99         Exclusive = 1024,
100
101         /// <summary>
102         /// Getting the grabbed-key exclusively regardless of the window's position.
103         /// </summary>
104         OverrideExclusive = 2048,
105     }
106
107     /// <summary>
108     /// Enumeration for the indicator mode.
109     /// </summary>
110     /// <since_tizen> preview </since_tizen>
111     [Obsolete("This has been deprecated in API12")]
112     public enum IndicatorMode
113     {
114         /// <summary>
115         /// Unknown indicator state.
116         /// </summary>
117         Unknown = 0,
118
119         /// <summary>
120         /// Hides the indicator.
121         /// </summary>
122         Hide,
123
124         /// <summary>
125         /// Shows the indicator.
126         /// </summary>
127         Show,
128     };
129
130     /// <summary>
131     /// Enumeration for the keyboard mode.
132     /// </summary>
133     /// <since_tizen> preview </since_tizen>
134     [Obsolete("This has been deprecated in API12")]
135     public enum KeyboardMode
136     {
137         /// <summary>
138         /// Unknown keyboard state.
139         /// </summary>
140         Unknown,
141
142         /// <summary>
143         /// Request to deactivate the keyboard.
144         /// </summary>
145         Off,
146
147         /// <summary>
148         /// Enable keyboard with default layout.
149         /// </summary>
150         On,
151
152         /// <summary>
153         /// Alpha (a-z) keyboard layout.
154         /// </summary>
155         Alpha,
156
157         /// <summary>
158         /// Numeric keyboard layout.
159         /// </summary>
160         Numeric,
161
162         /// <summary>
163         /// Pin keyboard layout.
164         /// </summary>
165         Pin,
166
167         /// <summary>
168         /// Phone keyboard layout.
169         /// </summary>
170         PhoneNumber,
171
172         /// <summary>
173         /// Hexadecimal numeric keyboard layout.
174         /// </summary>
175         Hex,
176
177         /// <summary>
178         /// Full (QWERTY) keyboard layout.
179         /// </summary>
180         QWERTY,
181
182         /// <summary>
183         /// Password keyboard layout.
184         /// </summary>
185         Password,
186
187         /// <summary>
188         /// IP keyboard layout.
189         /// </summary>
190         IP,
191
192         /// <summary>
193         /// Host keyboard layout.
194         /// </summary>
195         Host,
196
197         /// <summary>
198         /// File keyboard layout.
199         /// </summary>
200         File,
201
202         /// <summary>
203         /// URL keyboard layout.
204         /// </summary>
205         URL,
206
207         /// <summary>
208         /// Keypad layout.
209         /// </summary>
210         Keypad,
211
212         /// <summary>
213         /// J2ME keyboard layout.
214         /// </summary>
215         J2ME,
216     };
217
218     /// <summary>
219     /// Enumeration for the window type.
220     /// </summary>
221     /// <since_tizen> preview </since_tizen>
222     [Obsolete("This has been deprecated in API12")]
223     public enum WindowType
224     {
225         /// <summary>
226         /// Unknown.
227         /// </summary>
228         Unknown,
229
230         /// <summary>
231         /// A normal window. Indicates a normal, top-level window. Almost every window will be created with this type.
232         /// </summary>
233         Basic,
234
235         /// <summary>
236         /// Used for simple dialog windows.
237         /// </summary>
238         Dialog,
239
240         /// <summary>
241         /// For special desktop windows, like a background window holding desktop icons.
242         /// </summary>
243         Desktop,
244
245         /// <summary>
246         /// The window is used as a dock or panel. Usually would be kept on top of any other window by the Window Manager.
247         /// </summary>
248         Dock,
249
250         /// <summary>
251         /// The window is used to hold a floating toolbar, or similar.
252         /// </summary>
253         Toolbar,
254
255         /// <summary>
256         /// Similar to Toolbar.
257         /// </summary>
258         Menu,
259
260         /// <summary>
261         /// A persistent utility window, like a toolbox or palette.
262         /// </summary>
263         Utility,
264
265         /// <summary>
266         /// Splash window for a starting up application.
267         /// </summary>
268         Splash,
269
270         /// <summary>
271         /// The window is a dropdown menu, as when an entry in a menubar is clicked.
272         /// </summary>
273         DropdownMenu,
274
275         /// <summary>
276         /// Like DropdownMenu, but for the menu triggered by right-clicking an object.
277         /// </summary>
278         PopupMenu,
279
280         /// <summary>
281         /// The window is a tooltip. A short piece of explanatory text that typically appears after the mouse cursor hovers over an object for a while.
282         /// </summary>
283         Tooltip,
284
285         /// <summary>
286         /// A notification window, like a warning about battery life or a new e-mail received.
287         /// </summary>
288         Notification,
289
290         /// <summary>
291         /// A window holding the contents of a combo box.
292         /// </summary>
293         Combo,
294
295         /// <summary>
296         /// Used to indicate the window as a representation of an object being dragged across different windows, or even applications.
297         /// </summary>
298         DragAndDrop,
299
300         /// <summary>
301         /// The window is rendered onto an image buffer. No actual window is created for this type, instead the window and all of its contents will be rendered to an image buffer.
302         /// This allows to have children windows inside a parent one just like any other object would be, and do other things like applying Evas_Map effects to it.
303         /// </summary>
304         InlinedImage,
305
306         /// <summary>
307         /// The window is rendered onto an image buffer and can be shown other process's plug image object.
308         /// No actual window is created for this type, instead the window and all of its contents will be rendered to an image buffer and can be shown other process's plug image object.
309         /// </summary>
310         SocketImage,
311
312         /// <summary>
313         /// This window was created using a pre-existing canvas. The window widget can be deleted, but the canvas must be managed externally.
314         /// </summary>
315         Fake,
316     };
317
318     /// <summary>
319     /// Enumeration of notification window's priority level.
320     /// </summary>
321     /// <since_tizen> preview </since_tizen>
322     [Obsolete("This has been deprecated in API12")]
323     public enum NotificationLevel
324     {
325         /// <summary>
326         /// No (reset) notification level. This value makes the window place in normal layer.
327         /// </summary>
328         None = -1,
329
330         /// <summary>
331         /// Default notification level.
332         /// </summary>
333         Default = 10,
334
335         /// <summary>
336         /// Higher notification level than default.
337         /// </summary>
338         Medium = 20,
339
340         /// <summary>
341         /// Higher notification level than medium.
342         /// </summary>
343         High = 30,
344
345         /// <summary>
346         /// The highest notification level.
347         /// </summary>
348         Top = 40,
349     };
350
351     /// <summary>
352     /// Enumeration of screen mode.
353     /// </summary>
354     /// <since_tizen> preview </since_tizen>
355     [Obsolete("This has been deprecated in API12")]
356     public enum ScreenMode
357     {
358         /// <summary>
359         /// The mode which turns the screen off after a timeout.
360         /// </summary>
361         Default,
362
363         /// <summary>
364         /// The mode which keeps the screen turned on.
365         /// </summary>
366         AlwaysOn,
367     }
368
369     /// <summary>
370     /// The Window is a container that contains the graphical user interface of a program.
371     /// </summary>
372     /// <since_tizen> preview </since_tizen>
373     [Obsolete("This has been deprecated in API12")]
374     public class Window : Widget
375     {
376         SmartEvent _deleteRequest;
377         SmartEvent _rotationChanged;
378         HashSet<EvasObject> _referenceHolder = new HashSet<EvasObject>();
379
380         /// <summary>
381         /// Creates and initializes a new instance of the Window class.
382         /// </summary>
383         /// <param name="name">Window name.</param>
384         /// <since_tizen> preview </since_tizen>
385         [Obsolete("This has been deprecated in API12")]
386         public Window(string name) : this(null, name)
387         {
388         }
389
390         /// <summary>
391         /// Creates and initializes a new instance of the Window class.
392         /// </summary>
393         /// <param name="parent">
394         /// Parent widget which this window is created on.
395         /// </param>
396         /// <param name="name">
397         /// Window name.
398         /// </param>
399         /// <remarks>
400         /// Window constructor.show window indicator, set callback
401         /// when closing the window in any way outside the program control,
402         /// and set callback when window rotation is changed.
403         /// </remarks>
404         /// <since_tizen> preview </since_tizen>
405         [Obsolete("This has been deprecated in API12")]
406         public Window(Window parent, string name) : this(parent, name, WindowType.Basic)
407         {
408         }
409
410         /// <summary>
411         /// Creates and initializes a new instance of the Window class.
412         /// </summary>
413         /// <param name="parent">
414         /// Parent widget which this window is created on.
415         /// </param>
416         /// <param name="name">
417         /// Window name.
418         /// </param>
419         /// <param name="type">
420         /// Window type.
421         /// </param>
422         /// <remarks>
423         /// Window constructor.show window indicator, set callback
424         /// when closing the window in any way outside the program control,
425         /// and set callback when window rotation is changed.
426         /// </remarks>
427         /// <since_tizen> preview </since_tizen>
428         [Obsolete("This has been deprecated in API12")]
429         public Window(Window parent, string name, WindowType type)
430         {
431             Name = name;
432             Type = type;
433             Realize(parent);
434             IndicatorMode = IndicatorMode.Show;
435
436             _deleteRequest = new SmartEvent(this, "delete,request");
437             _rotationChanged = new SmartEvent(this, "wm,rotation,changed");
438             _deleteRequest.On += (s, e) => CloseRequested?.Invoke(this, EventArgs.Empty);
439             _rotationChanged.On += (s, e) => RotationChanged?.Invoke(this, EventArgs.Empty);
440         }
441
442         /// <summary>
443         /// Creates and initializes a new instance of the Window class.
444         /// </summary>
445         /// <since_tizen> preview </since_tizen>
446         [Obsolete("This has been deprecated in API12")]
447         protected Window()
448         {
449         }
450
451         /// <summary>
452         /// CloseRequested will be triggered when window is closed.
453         /// </summary>
454         /// <since_tizen> preview </since_tizen>
455         [Obsolete("This has been deprecated in API12")]
456         public event EventHandler CloseRequested;
457
458         /// <summary>
459         /// RotationChanged will be triggered when window is rotated.
460         /// </summary>
461         /// <since_tizen> preview </since_tizen>
462         [Obsolete("This has been deprecated in API12")]
463         public event EventHandler RotationChanged;
464
465         /// <summary>
466         /// Sets or gets the window name.
467         /// </summary>
468         /// <since_tizen> preview </since_tizen>
469         [Obsolete("This has been deprecated in API12")]
470         public string Name { get; set; }
471
472         /// <summary>
473         /// Gets the window type.
474         /// </summary>
475         /// <since_tizen> preview </since_tizen>
476         [Obsolete("This has been deprecated in API12")]
477         public WindowType Type { get; } = WindowType.Basic;
478
479         /// <summary>
480         /// Gets the window size with Size value(w,h)
481         /// </summary>
482         /// <since_tizen> preview </since_tizen>
483         [Obsolete("This has been deprecated in API12")]
484         public Size ScreenSize
485         {
486             get
487             {
488                 int x, y, w, h;
489                 Interop.Elementary.elm_win_screen_size_get(Handle, out x, out y, out w, out h);
490                 return new Size(w, h);
491             }
492         }
493
494         /// <summary>
495         /// Gets the screen dpi for the screen that the window is on.
496         /// </summary>
497         /// <since_tizen> preview </since_tizen>
498         [Obsolete("This has been deprecated in API12")]
499         public Point ScreenDpi
500         {
501             get
502             {
503                 Point point = default(Point);
504                 Interop.Elementary.elm_win_screen_dpi_get(Handle, out point.X, out point.Y);
505                 return point;
506             }
507         }
508
509         /// <summary>
510         /// Gets the rotation of the window. The rotation of the window in degrees (0-360).
511         /// </summary>
512         /// <since_tizen> preview </since_tizen>
513         [Obsolete("This has been deprecated in API12")]
514         public int Rotation
515         {
516             get
517             {
518                 return Interop.Elementary.elm_win_rotation_get(Handle);
519             }
520         }
521
522         /// <summary>
523         /// Gets whether the window manager supports window rotation or not.
524         /// </summary>
525         /// <since_tizen> preview </since_tizen>
526         [Obsolete("This has been deprecated in API12")]
527         public bool IsRotationSupported
528         {
529             get
530             {
531                 return Interop.Elementary.elm_win_wm_rotation_supported_get(Handle);
532             }
533         }
534
535         /// <summary>
536         /// Sets or gets the available rotation degree.
537         /// </summary>
538         /// <since_tizen> preview </since_tizen>
539         [Obsolete("Sorry, it's error typo of AvailableRotations, please use AvailableRotations")]
540         public DisplayRotation AavailableRotations { get; set; }
541
542         /// <summary>
543         /// Sets or gets the available rotation degree.
544         /// </summary>
545         /// <since_tizen> preview </since_tizen>
546         [Obsolete("This has been deprecated in API12")]
547         public DisplayRotation AvailableRotations
548         {
549             get
550             {
551                 int[] rotations;
552                 Interop.Elementary.elm_win_wm_rotation_available_rotations_get(Handle, out rotations);
553                 if (rotations == null)
554                 {
555                     return 0;
556                 }
557                 return ConvertToDisplayRotation(rotations);
558             }
559             set
560             {
561                 Interop.Elementary.elm_win_wm_rotation_available_rotations_set(Handle, ConvertDegreeArray(value));
562             }
563         }
564
565         /// <summary>
566         /// Sets or gets whether the auto deletion function is enabled.
567         /// </summary>
568         /// <remarks>
569         /// If you enable auto deletion, the window is automatically destroyed after the signal is emitted.
570         /// If auto deletion is disabled, the window is not destroyed and the program has to handle it.
571         /// </remarks>
572         /// <since_tizen> preview </since_tizen>
573         [Obsolete("This has been deprecated in API12")]
574         public bool AutoDeletion
575         {
576             get
577             {
578                 return Interop.Elementary.elm_win_autodel_get(Handle);
579             }
580             set
581             {
582                 Interop.Elementary.elm_win_autodel_set(Handle, value);
583             }
584         }
585
586         /// <summary>
587         /// Sets or gets the alpha channel state of the window.
588         /// </summary>
589         /// <remarks>
590         /// true if the window alpha channel is enabled, false otherwise.
591         /// If alpha is true, the alpha channel of the canvas will be enabled possibly making parts of the window completely or partially transparent.
592         /// </remarks>
593         /// <since_tizen> preview </since_tizen>
594         [Obsolete("This has been deprecated in API12")]
595         public bool Alpha
596         {
597             get
598             {
599                 return Interop.Elementary.elm_win_alpha_get(Handle);
600             }
601             set
602             {
603                 Interop.Elementary.elm_win_alpha_set(Handle, value);
604             }
605         }
606
607         /// <summary>
608         /// Sets or gets the role of the window.
609         /// </summary>
610         /// <remarks>
611         /// The Role will be invalid if a new role is set or if the window is destroyed.
612         /// </remarks>
613         /// <since_tizen> preview </since_tizen>
614         [Obsolete("This has been deprecated in API12")]
615         public string Role
616         {
617             get
618             {
619                 return Interop.Elementary.elm_win_role_get(Handle);
620             }
621             set
622             {
623                 Interop.Elementary.elm_win_role_set(Handle, value);
624             }
625         }
626
627         /// <summary>
628         /// Sets or gets the mode of the status bar.
629         /// </summary>
630         /// <since_tizen> preview </since_tizen>
631         [Obsolete("This has been deprecated in API12")]
632         public StatusBarMode StatusBarMode
633         {
634             get
635             {
636                 return (StatusBarMode)Interop.Elementary.elm_win_indicator_opacity_get(Handle);
637             }
638             set
639             {
640                 Interop.Elementary.elm_win_indicator_opacity_set(Handle, (int)value);
641             }
642         }
643
644         /// <summary>
645         /// Sets or gets the iconified state of the window.
646         /// </summary>
647         /// <since_tizen> preview </since_tizen>
648         [Obsolete("This has been deprecated in API12")]
649         [EditorBrowsable(EditorBrowsableState.Never)]
650         public bool Iconified
651         {
652             get
653             {
654                 return Interop.Elementary.elm_win_iconified_get(RealHandle);
655             }
656             set
657             {
658                 Interop.Elementary.elm_win_iconified_set(RealHandle, value);
659             }
660         }
661
662         /// <summary>
663         /// Gets or sets the window's indicator mode.
664         /// </summary>
665         /// <value>The indicator mode.</value>
666         /// <since_tizen> preview </since_tizen>
667         [Obsolete("This has been deprecated in API12")]
668         public IndicatorMode IndicatorMode
669         {
670             get
671             {
672                 return Interop.Elementary.elm_win_indicator_mode_get(RealHandle);
673             }
674             set
675             {
676                 Interop.Elementary.elm_win_indicator_mode_set(RealHandle, value);
677             }
678         }
679
680         /// <summary>
681         /// Gets or sets the aspect ratio of the window.
682         /// </summary>
683         /// <since_tizen> preview </since_tizen>
684         [Obsolete("This has been deprecated in API12")]
685         public double Aspect
686         {
687             get
688             {
689                 return Interop.Elementary.elm_win_aspect_get(RealHandle);
690             }
691             set
692             {
693                 Interop.Elementary.elm_win_aspect_set(RealHandle, value);
694             }
695         }
696
697         /// <summary>
698         /// Window's autohide state.
699         /// </summary>
700         /// <since_tizen> preview </since_tizen>
701         [Obsolete("This has been deprecated in API12")]
702         public bool AutoHide
703         {
704             get
705             {
706                 return Interop.Elementary.elm_win_autohide_get(RealHandle);
707             }
708             set
709             {
710                 Interop.Elementary.elm_win_autohide_set(RealHandle, value);
711             }
712         }
713
714         /// <summary>
715         /// Gets the borderless state of the window.
716         /// This function requests the Window Manager to not draw any decoration around the window.
717         /// </summary>
718         /// <since_tizen> preview </since_tizen>
719         [Obsolete("This has been deprecated in API12")]
720         public bool Borderless
721         {
722             get
723             {
724                 return Interop.Elementary.elm_win_borderless_get(RealHandle);
725             }
726             set
727             {
728                 Interop.Elementary.elm_win_borderless_set(RealHandle, value);
729             }
730         }
731
732         /// <summary>
733         /// Gets or sets the demand attention state of the window.
734         /// </summary>
735         /// <since_tizen> preview </since_tizen>
736         [Obsolete("This has been deprecated in API12")]
737         public bool DemandAttention
738         {
739             get
740             {
741                 return Interop.Elementary.elm_win_demand_attention_get(RealHandle);
742             }
743             set
744             {
745                 Interop.Elementary.elm_win_demand_attention_set(RealHandle, value);
746             }
747         }
748
749         /// <summary>
750         /// Gets or sets the floating mode of the window.
751         /// </summary>
752         /// <since_tizen> preview </since_tizen>
753         [Obsolete("This has been deprecated in API12")]
754         public bool FloatingMode
755         {
756             get
757             {
758                 return Interop.Elementary.elm_win_floating_mode_get(RealHandle);
759             }
760             set
761             {
762                 Interop.Elementary.elm_win_floating_mode_set(RealHandle, value);
763             }
764         }
765
766         /// <summary>
767         /// Gets or sets the animate status for the focus highlight for this window.
768         /// This function will enable or disable the animation of focus highlight only for the given window, regardless of the global setting for it.
769         /// </summary>
770         /// <since_tizen> preview </since_tizen>
771         [Obsolete("This has been deprecated in API12")]
772         public bool FocusHighlightAnimation
773         {
774             get
775             {
776                 return Interop.Elementary.elm_win_focus_highlight_animate_get(RealHandle);
777             }
778             set
779             {
780                 Interop.Elementary.elm_win_focus_highlight_animate_set(RealHandle, value);
781             }
782         }
783
784         /// <summary>
785         /// Gets or sets the enabled status for the focus highlight in the window.
786         /// This function will enable or disable the focus highlight only for the given window, regardless of the global setting for it.
787         /// </summary>
788         /// <since_tizen> preview </since_tizen>
789         [Obsolete("This has been deprecated in API12")]
790         public bool FocusHighlightEnabled
791         {
792             get
793             {
794                 return Interop.Elementary.elm_win_focus_highlight_enabled_get(RealHandle);
795             }
796             set
797             {
798                 Interop.Elementary.elm_win_focus_highlight_enabled_set(RealHandle, value);
799             }
800         }
801
802         /// <summary>
803         /// Gets or sets the style for the focus highlight on this window.
804         /// Sets the style to use for theming the highlight of focused objects on the given window. If style is NULL, the default will be used.
805         /// </summary>
806         /// <since_tizen> preview </since_tizen>
807         [Obsolete("This has been deprecated in API12")]
808         public string FocusHighlightStyle
809         {
810             get
811             {
812                 return Interop.Elementary.elm_win_focus_highlight_style_get(RealHandle);
813             }
814             set
815             {
816                 Interop.Elementary.elm_win_focus_highlight_style_set(RealHandle, value);
817             }
818         }
819
820         /// <summary>
821         /// Gets the keyboard mode of the window.
822         /// </summary>
823         /// <since_tizen> preview </since_tizen>
824         [Obsolete("This has been deprecated in API12")]
825         public KeyboardMode KeyboardMode
826         {
827             get
828             {
829                 return (KeyboardMode)Interop.Elementary.elm_win_keyboard_mode_get(RealHandle);
830             }
831             set
832             {
833                 Interop.Elementary.elm_win_keyboard_mode_set(RealHandle, (int)value);
834             }
835         }
836
837         /// <summary>
838         /// Gets or sets the layer of the window.
839         /// What this means exactly will depend on the underlying engine used.
840         /// In the case of X11 backed engines, the value in layer has the following meanings:
841         /// less than 3 means that the window will be placed below all others,
842         /// more than 5 means that the window will be placed above all others,
843         /// and anything else means that the window will be placed in the default layer.
844         /// </summary>
845         /// <since_tizen> preview </since_tizen>
846         [Obsolete("This has been deprecated in API12")]
847         public override int Layer
848         {
849             get
850             {
851                 return Interop.Elementary.elm_win_layer_get(RealHandle);
852             }
853             set
854             {
855                 Interop.Elementary.elm_win_layer_set(RealHandle, value);
856             }
857         }
858
859         /// <summary>
860         /// Gets or sets the modal state of the window.
861         /// </summary>
862         /// <since_tizen> preview </since_tizen>
863         [Obsolete("This has been deprecated in API12")]
864         public bool Modal
865         {
866             get
867             {
868                 return Interop.Elementary.elm_win_modal_get(RealHandle);
869             }
870             set
871             {
872                 Interop.Elementary.elm_win_modal_set(RealHandle, value);
873             }
874         }
875
876         /// <summary>
877         /// Gets or sets the noblank property of the window.
878         /// This is a way to request the display on which the window is shown is not blank, screensave, or otherwise hidden or obscure. It is intended for use such as media playback on a television where a user may not want to be interrupted by an idle screen.
879         /// The noblank property may have no effect if the window is iconified/minimized or hidden.
880         /// </summary>
881         /// <since_tizen> preview </since_tizen>
882         [Obsolete("This has been deprecated in API12")]
883         public bool NoBlank
884         {
885             get
886             {
887                 return Interop.Elementary.elm_win_noblank_get(RealHandle);
888             }
889             set
890             {
891                 Interop.Elementary.elm_win_noblank_set(RealHandle, value);
892             }
893         }
894
895         /// <summary>
896         /// Gets the profile of the window.
897         /// </summary>
898         /// <since_tizen> preview </since_tizen>
899         [Obsolete("This has been deprecated in API12")]
900         public string Profile
901         {
902             get
903             {
904                 return Interop.Elementary.elm_win_profile_get(RealHandle);
905             }
906             set
907             {
908                 Interop.Elementary.elm_win_profile_set(RealHandle, value);
909             }
910         }
911
912         /// <summary>
913         /// Gets the constraints on the maximum width and height of the window relative to the width and height of its screen.
914         /// When this function returns true, object will never resize larger than the screen.
915         /// </summary>
916         /// <since_tizen> preview </since_tizen>
917         [Obsolete("This has been deprecated in API12")]
918         public bool ScreenConstrain
919         {
920             get
921             {
922                 return Interop.Elementary.elm_win_screen_constrain_get(RealHandle);
923             }
924             set
925             {
926                 Interop.Elementary.elm_win_screen_constrain_set(RealHandle, value);
927             }
928         }
929
930         /// <summary>
931         /// Gets or sets the base size of the window.
932         /// </summary>
933         /// <since_tizen> preview </since_tizen>
934         [Obsolete("This has been deprecated in API12")]
935         public Size BaseSize
936         {
937             get
938             {
939                 int w, h;
940                 Interop.Elementary.elm_win_size_base_get(RealHandle, out w, out h);
941                 return new Size(w, h);
942             }
943             set
944             {
945                 Interop.Elementary.elm_win_size_base_set(RealHandle, value.Width, value.Height);
946             }
947         }
948
949         /// <summary>
950         /// Gets or sets the step size of the window.
951         /// </summary>
952         /// <since_tizen> preview </since_tizen>
953         [Obsolete("This has been deprecated in API12")]
954         public Size StepSize
955         {
956             get
957             {
958                 int w, h;
959                 Interop.Elementary.elm_win_size_step_get(RealHandle, out w, out h);
960                 return new Size(w, h);
961             }
962             set
963             {
964                 Interop.Elementary.elm_win_size_step_set(RealHandle, value.Width, value.Height);
965             }
966         }
967
968         /// <summary>
969         /// Gets the screen position X of a window.
970         /// </summary>
971         /// <since_tizen> preview </since_tizen>
972         [Obsolete("This has been deprecated in API12")]
973         public int ScreenPositionX
974         {
975             get
976             {
977                 int x, y;
978                 Interop.Elementary.elm_win_screen_position_get(Handle, out x, out y);
979                 return x;
980             }
981         }
982
983         /// <summary>
984         /// Gets the screen position Y of a window.
985         /// </summary>
986         /// <since_tizen> preview </since_tizen>
987         [Obsolete("This has been deprecated in API12")]
988         public int ScreenPositionY
989         {
990             get
991             {
992                 int x, y;
993                 Interop.Elementary.elm_win_screen_position_get(Handle, out x, out y);
994                 return y;
995             }
996         }
997
998         /// <summary>
999         /// Gets or sets the title of the window.
1000         /// </summary>
1001         /// <since_tizen> preview </since_tizen>
1002         [Obsolete("This has been deprecated in API12")]
1003         public string Title
1004         {
1005             get
1006             {
1007                 return Interop.Elementary.elm_win_title_get(Handle);
1008             }
1009             set
1010             {
1011                 Interop.Elementary.elm_win_title_set(Handle, value);
1012             }
1013         }
1014
1015         /// <summary>
1016         /// Gets or sets the urgent state of the window.
1017         /// </summary>
1018         /// <since_tizen> preview </since_tizen>
1019         [Obsolete("This has been deprecated in API12")]
1020         public bool Urgent
1021         {
1022             get
1023             {
1024                 return Interop.Elementary.elm_win_urgent_get(Handle);
1025             }
1026             set
1027             {
1028                 Interop.Elementary.elm_win_urgent_set(Handle, value);
1029             }
1030         }
1031
1032         /// <summary>
1033         /// Gets or sets the withdrawn state of the window.
1034         /// </summary>
1035         /// <since_tizen> preview </since_tizen>
1036         [Obsolete("This has been deprecated in API12")]
1037         public bool Withdrawn
1038         {
1039             get
1040             {
1041                 return Interop.Elementary.elm_win_withdrawn_get(Handle);
1042             }
1043             set
1044             {
1045                 Interop.Elementary.elm_win_withdrawn_set(Handle, value);
1046             }
1047         }
1048
1049         /// <summary>
1050         /// Gets or sets the priority level for the specified notification window.
1051         /// </summary>
1052         /// <privilege>
1053         /// http://tizen.org/privilege/window.priority.set
1054         /// </privilege>
1055         /// /// <remarks>
1056         /// This can be used for a notification type window only.
1057         /// </remarks>
1058         /// <since_tizen> preview </since_tizen>
1059         [Obsolete("This has been deprecated in API12")]
1060         public NotificationLevel NotificationLevel
1061         {
1062             get
1063             {
1064                 int level;
1065                 Interop.Eutil.efl_util_get_notification_window_level(Handle, out level);
1066                 return (NotificationLevel)level;
1067             }
1068             set
1069             {
1070                 Interop.Eutil.efl_util_set_notification_window_level(Handle, (int)value);
1071             }
1072         }
1073
1074         /// <summary>
1075         /// Gets or sets the window's screen mode.
1076         /// This API is useful when the application need to keep the display turned on.
1077         /// If the application set the mode to ScreenMode.AlwaysOn to its window and the window is shown wholly or partially,
1078         /// the window manager requests the display system to keep the display on as long as the window is shown.
1079         /// If the window is no longer shown, then the window manger request the display system to go back to normal operation.
1080         /// Default screen mode of window is ScreenMode.Default.
1081         /// </summary>
1082         /// <privilege>
1083         /// http://tizen.org/privilege/display
1084         /// </privilege>
1085         /// <remarks>
1086         /// This needs the privilege. If the application which is not get the privilege use this API, the window manager generates the permission deny error.
1087         /// </remarks>
1088         /// <since_tizen> preview </since_tizen>
1089         [Obsolete("This has been deprecated in API12")]
1090         public ScreenMode ScreenMode
1091         {
1092             get
1093             {
1094                 int mode;
1095                 Interop.Eutil.efl_util_get_window_screen_mode(Handle, out mode);
1096                 return (ScreenMode)mode;
1097             }
1098             set
1099             {
1100                 Interop.Eutil.efl_util_set_window_screen_mode(Handle, (int)value);
1101             }
1102         }
1103
1104         /// <summary>
1105         /// Gets or sets the user's preferred brightness of the specified window.
1106         /// This is useful when the application need to change the brightness of the screen when it is appeared on the screen.
1107         /// If the application sets the brightness 0 to 100 to its window and the application window is shown wholly or partially,
1108         /// the window manager requests the display system to change the brightness of the screen using user's preferred brightness.
1109         /// If the window is no longer shown, then the window manger request the display system to go back to default brightness.
1110         /// If the brightness is less than 0, this means to use the default screen brightness.
1111         /// </summary>
1112         /// <privilege>
1113         /// http://tizen.org/privilege/display
1114         /// </privilege>
1115         /// <remarks>
1116         /// This needs the privilege. If the application which is not get the privilege use this API, the window manager generates the permission deny error.
1117         /// </remarks>
1118         /// <since_tizen> preview </since_tizen>
1119         [Obsolete("This has been deprecated in API12")]
1120         public int Brightness
1121         {
1122             get
1123             {
1124                 int brightness;
1125                 Interop.Eutil.efl_util_get_window_brightness(Handle, out brightness);
1126                 return brightness;
1127             }
1128             set
1129             {
1130                 Interop.Eutil.efl_util_set_window_brightness(Handle, value);
1131             }
1132         }
1133
1134         internal static bool IsPreloaded { get; private set; }
1135
1136         /// <summary>
1137         /// Creates a socket to provide the service for the Plug widget.
1138         /// </summary>
1139         /// <param name="name">A service name.</param>
1140         /// <param name="number">A number (any value, 0 being the common default) to differentiate multiple instances of services with the same name.</param>
1141         /// <param name="systemWide">A boolean that if true, specifies to create a system-wide service all users can connect to, otherwise the service is private to the user ID that created the service.</param>
1142         /// <returns>If true creates successful, otherwise false.</returns>
1143         /// <since_tizen> preview </since_tizen>
1144         [Obsolete("This has been deprecated in API12")]
1145         public bool CreateServiceSocket(string name, int number, bool systemWide)
1146         {
1147             return Interop.Elementary.elm_win_socket_listen(RealHandle, name, number, systemWide);
1148         }
1149
1150         /// <summary>
1151         /// Sets the rotation of the window.
1152         /// </summary>
1153         /// <param name="degree">The rotation of the window, in degrees (0-360), counter-clockwise.</param>
1154         /// <param name="resize">Resizes the window's contents so that they fit inside the current window geometry.</param>
1155         /// <since_tizen> preview </since_tizen>
1156         [Obsolete("This has been deprecated in API12")]
1157         public void SetRotation(int degree, bool resize)
1158         {
1159             if (resize)
1160                 Interop.Elementary.elm_win_rotation_with_resize_set(RealHandle, degree);
1161             else
1162                 Interop.Elementary.elm_win_rotation_set(RealHandle, degree);
1163         }
1164
1165         /// <summary>
1166         /// Sets the alpha window's visual state to opaque state.
1167         /// This sets the alpha window's visual state to opaque state.
1168         /// If the alpha window sets the visual state to the opaque,
1169         /// then the window manager could handle it as the opaque window while calculating visibility.
1170         /// This will have no effect when used by a non-alpha window.
1171         /// </summary>
1172         /// <since_tizen> preview </since_tizen>
1173         [Obsolete("This has been deprecated in API12")]
1174         public void SetOpaqueState()
1175         {
1176             Interop.Eutil.efl_util_set_window_opaque_state(RealHandle, 1);
1177         }
1178
1179         /// <summary>
1180         /// Unsets the alpha window's visual state to opaque state.
1181         /// </summary>
1182         /// <since_tizen> preview </since_tizen>
1183         [Obsolete("This has been deprecated in API12")]
1184         public void UnsetOpaqueState()
1185         {
1186             Interop.Eutil.efl_util_set_window_opaque_state(RealHandle, 0);
1187         }
1188
1189         /// <summary>
1190         /// Sets the window to be skipped by focus.
1191         /// This sets the window to be skipped by normal input.
1192         /// This means the Windows Manager will be asked to not focus this window as well as omit it from things like the taskbar, pager etc.
1193         /// Call this and enable it on the window BEFORE you show it for the first time, otherwise it may have no effect.
1194         /// Use this for windows that have only output information or might only be interacted with by the mouse or fingers, and never for typing input.
1195         /// Be careful that this may have side-effects like making the window non-accessible in some cases unless the window is specially handled. Use this with care.
1196         /// </summary>
1197         /// <since_tizen> preview </since_tizen>
1198         [Obsolete("This has been deprecated in API12")]
1199         public void FocusSkip(bool skip)
1200         {
1201             Interop.Elementary.elm_win_prop_focus_skip_set(Handle, skip);
1202         }
1203
1204         /// <summary>
1205         /// Pulls up the window object.
1206         /// Places the window pointed by object at the top of the stack, so that it's not covered by any other window.
1207         /// </summary>
1208         /// <since_tizen> preview </since_tizen>
1209         [Obsolete("This has been deprecated in API12")]
1210         public void PullUp()
1211         {
1212             Interop.Elementary.elm_win_raise(Handle);
1213         }
1214
1215         /// <summary>
1216         /// Brings down the window object.
1217         /// Places the window pointed by object at the bottom of the stack, so that no other window is covered by it.
1218         /// </summary>
1219         /// <since_tizen> preview </since_tizen>
1220         [Obsolete("This has been deprecated in API12")]
1221         public void BringDown()
1222         {
1223             Interop.Elementary.elm_win_lower(Handle);
1224         }
1225
1226         /// <summary>
1227         /// This function sends a request to the Windows Manager to activate the window.
1228         /// If honored by the Windows Manager, the window receives the keyboard focus.
1229         /// </summary>
1230         /// <remarks>
1231         /// This is just a request that the Windows Manager may ignore, so calling this function does not ensure
1232         /// in any way that the window is going to be the active one after it.
1233         /// </remarks>
1234         /// <since_tizen> preview </since_tizen>
1235         [Obsolete("This has been deprecated in API12")]
1236         public void Active()
1237         {
1238             Interop.Elementary.elm_win_activate(Handle);
1239         }
1240
1241         /// <summary>
1242         /// Deletes the subobj as a resize object of the window object.
1243         /// This function removes the object subobj from the resize objects of the window object.
1244         /// It will not delete the object itself, which will be left unmanaged and should be deleted by the developer, manually handled, or set as child of some other container.
1245         /// </summary>
1246         /// <param name="obj">Resize object.</param>
1247         /// <since_tizen> preview </since_tizen>
1248         [Obsolete("This has been deprecated in API12")]
1249         public void DeleteResizeObject(EvasObject obj)
1250         {
1251             Interop.Elementary.elm_win_resize_object_del(Handle, obj);
1252         }
1253
1254         /// <summary>
1255         /// Adds an object as a resize object of the window.
1256         /// </summary>
1257         /// <remarks>
1258         /// Setting an object as a resize object of the window means that the object child's size and
1259         /// position is controlled by the window directly. That is, the object is resized to match the window size
1260         /// and should never be moved or resized manually by the developer. In addition,
1261         /// resize objects of the window control the minimum size of it as well as whether it can or cannot be resized by the user.
1262         /// </remarks>
1263         /// <param name="obj">
1264         /// Resize object.
1265         /// </param>
1266         /// <since_tizen> preview </since_tizen>
1267         [Obsolete("This has been deprecated in API12")]
1268         public void AddResizeObject(EvasObject obj)
1269         {
1270             Interop.Elementary.elm_win_resize_object_add(Handle, obj);
1271         }
1272
1273         /// <summary>
1274         /// Sets the keygrab value of the window.
1275         /// This function grabs the key of the window using grab_mode.
1276         /// </summary>
1277         /// <param name="keyname">The keyname to grab.</param>
1278         /// <param name="mode">According to the grabmode, it can grab key differently.</param>
1279         /// <since_tizen> preview </since_tizen>
1280         [Obsolete("This has been deprecated in API12")]
1281         [EditorBrowsable(EditorBrowsableState.Never)]
1282         public void WinKeyGrab(string keyname, KeyGrabMode mode)
1283         {
1284             Interop.Elementary.elm_win_keygrab_set(RealHandle, keyname, 0, 0, 0, mode);
1285         }
1286
1287         /// <summary>
1288         /// Unsets the keygrab value of the window.
1289         /// This function unsets keygrab value. Ungrab key of the window.
1290         /// </summary>
1291         /// <param name="keyname">The keyname to grab.</param>
1292         /// <since_tizen> preview </since_tizen>
1293         [Obsolete("This has been deprecated in API12")]
1294         [EditorBrowsable(EditorBrowsableState.Never)]
1295         public void WinKeyUngrab(string keyname)
1296         {
1297             Interop.Elementary.elm_win_keygrab_unset(RealHandle, keyname, 0, 0);
1298         }
1299
1300         /// <summary>
1301         /// Sets the keygrab of the window.
1302         /// </summary>
1303         /// <param name="keyname">The keyname string to set keygrab.</param>
1304         /// <since_tizen> preview </since_tizen>
1305         [Obsolete("This has been deprecated in API12")]
1306         public void KeyGrabEx(string keyname)
1307         {
1308             Interop.Elementary.eext_win_keygrab_set(RealHandle, keyname);
1309         }
1310
1311         /// <summary>
1312         /// Unsets the keygrab of the window.
1313         /// </summary>
1314         /// <param name="keyname">The keyname string to unset keygrab.</param>
1315         /// <since_tizen> preview </since_tizen>
1316         [Obsolete("This has been deprecated in API12")]
1317         public void KeyUngrabEx(string keyname)
1318         {
1319             Interop.Elementary.eext_win_keygrab_unset(RealHandle, keyname);
1320         }
1321
1322         /// <summary>
1323         /// Creates an auxiliary hint of the window.
1324         /// </summary>
1325         /// <remarks>
1326         /// Support for this depends on the underlying windowing system. 
1327         /// </remarks>
1328         /// <param name="hint">The auxiliary hint string</param>
1329         /// <param name="value">The value string</param>
1330         /// <returns>The ID of the created auxiliary hint, otherwise -1 on failure</returns>
1331         /// <since_tizen> preview </since_tizen>
1332         [Obsolete("This has been deprecated in API12")]
1333         [EditorBrowsable(EditorBrowsableState.Never)]
1334         public int AddAuxiliaryHint(string hint, string value)
1335         {
1336             return Interop.Elementary.elm_win_aux_hint_add(RealHandle, hint, value);
1337         }
1338
1339         /// <summary>
1340         /// Deletes an auxiliary hint of the window.
1341         /// </summary>
1342         /// <remarks>
1343         /// Support for this depends on the underlying windowing system. 
1344         /// </remarks>
1345         /// <param name="id">The ID of the auxiliary hint</param>
1346         /// <returns>If true deletes successful, otherwise false.</returns>
1347         /// <since_tizen> preview </since_tizen>
1348         [Obsolete("This has been deprecated in API12")]
1349         [EditorBrowsable(EditorBrowsableState.Never)]
1350         public bool DeleteAuxiliaryHint(int id)
1351         {
1352             return Interop.Elementary.elm_win_aux_hint_del(RealHandle, id);
1353         }
1354
1355         /// <summary>
1356         /// Changes a value of the auxiliary hint.
1357         /// </summary>
1358         /// <remarks>
1359         /// Support for this depends on the underlying windowing system. 
1360         /// </remarks>
1361         /// <param name="id">The auxiliary hint ID</param>
1362         /// <param name="value">The value string to be set</param>
1363         /// <returns>If true changes successful, otherwise false.</returns>
1364         /// <since_tizen> preview </since_tizen>
1365         [Obsolete("This has been deprecated in API12")]
1366         [EditorBrowsable(EditorBrowsableState.Never)]
1367         public bool SetAuxiliaryHintValue(int id, string value)
1368         {
1369             return Interop.Elementary.elm_win_aux_hint_val_set(RealHandle, id, value);
1370         }
1371
1372         /// <summary>
1373         /// Gets a value of the auxiliary hint.
1374         /// </summary>
1375         /// <remarks>
1376         /// Support for this depends on the underlying windowing system. 
1377         /// </remarks>
1378         /// <param name="id">The auxiliary hint ID</param>
1379         /// <returns>The string value of the auxiliary hint ID</returns>
1380         /// <since_tizen> preview </since_tizen>
1381         [Obsolete("This has been deprecated in API12")]
1382         [EditorBrowsable(EditorBrowsableState.Never)]
1383         public string GetAuxiliaryHintValue(int id)
1384         {
1385             return Interop.Elementary.elm_win_aux_hint_val_get(RealHandle, id);
1386         }
1387
1388         /// <summary>
1389         /// Gets an ID of the auxiliary hint string.
1390         /// </summary>
1391         /// <remarks>
1392         /// Support for this depends on the underlying windowing system. 
1393         /// </remarks>
1394         /// <param name="hint">The auxiliary hint string</param>
1395         /// <returns>The ID of the auxiliary hint, otherwise -1 on failure</returns>
1396         /// <since_tizen> preview </since_tizen>
1397         [Obsolete("This has been deprecated in API12")]
1398         [EditorBrowsable(EditorBrowsableState.Never)]
1399         public int GetAuxiliaryHintId(string hint)
1400         {
1401             return Interop.Elementary.elm_win_aux_hint_id_get(RealHandle, hint);
1402         }
1403
1404         /// <summary>
1405         /// Creates a widget handle.
1406         /// </summary>
1407         /// <param name="parent">Parent EvasObject.</param>
1408         /// <returns>Handle IntPtr.</returns>
1409         /// <since_tizen> preview </since_tizen>
1410         [Obsolete("This has been deprecated in API12")]
1411         protected override IntPtr CreateHandle(EvasObject parent)
1412         {
1413             Interop.Elementary.elm_config_accel_preference_set("3d");
1414             return Interop.Elementary.elm_win_add(parent != null ? parent.Handle : IntPtr.Zero, Name, (int)Type);
1415         }
1416
1417         internal void AddChild(EvasObject obj)
1418         {
1419             _referenceHolder.Add(obj);
1420         }
1421
1422         internal void RemoveChild(EvasObject obj)
1423         {
1424             _referenceHolder.Remove(obj);
1425         }
1426
1427         static int[] ConvertDegreeArray(DisplayRotation value)
1428         {
1429             List<int> rotations = new List<int>();
1430             if (value.HasFlag(DisplayRotation.Degree_0))
1431                 rotations.Add(0);
1432             if (value.HasFlag(DisplayRotation.Degree_90))
1433                 rotations.Add(90);
1434             if (value.HasFlag(DisplayRotation.Degree_180))
1435                 rotations.Add(180);
1436             if (value.HasFlag(DisplayRotation.Degree_270))
1437                 rotations.Add(270);
1438             return rotations.ToArray();
1439         }
1440
1441         static DisplayRotation ConvertToDisplayRotation(int[] values)
1442         {
1443             int orientation = 0;
1444             foreach (int v in values)
1445             {
1446                 orientation |= (1 << (v / 90));
1447             }
1448             return (DisplayRotation)orientation;
1449         }
1450
1451         static void Preload()
1452         {
1453             Elementary.Initialize();
1454             Elementary.ThemeOverlay();
1455             _ = new PreloadedWindow();
1456             IsPreloaded = true;
1457         }
1458
1459         /// <summary>
1460         /// For internal use only
1461         /// </summary>
1462         internal static Window CreateWindow(string name) => PreloadedWindow.GetInstance() ?? new Window(name);
1463     }
1464 }