-
Notifications
You must be signed in to change notification settings - Fork 247
/
Window.cs
executable file
·1319 lines (1194 loc) · 51.5 KB
/
Window.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* Copyright(c) 2019 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
using System;
using System.ComponentModel;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using Tizen.NUI.BaseComponents;
namespace Tizen.NUI
{
/// <summary>
/// The window class is used internally for drawing.<br />
/// The window has an orientation and indicator properties.<br />
/// </summary>
/// <since_tizen> 3 </since_tizen>
public partial class Window : BaseHandle
{
private static readonly Window instance = Application.Instance?.GetWindow();
private global::System.Runtime.InteropServices.HandleRef swigCPtr;
private global::System.Runtime.InteropServices.HandleRef stageCPtr;
private Layer _rootLayer;
private string _windowTitle;
private List<Layer> _childLayers = new List<Layer>();
private LayoutController localController;
internal Window(global::System.IntPtr cPtr, bool cMemoryOwn) : base(Interop.Window.Window_SWIGUpcast(cPtr), cMemoryOwn)
{
swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr);
if (Interop.Stage.Stage_IsInstalled())
{
stageCPtr = new global::System.Runtime.InteropServices.HandleRef(this, Interop.Stage.Stage_GetCurrent());
localController = new LayoutController(this);
NUILog.Debug("layoutController id:" + localController.GetId() );
}
}
/// <summary>
/// Creates a new Window.<br />
/// This creates an extra window in addition to the default main window<br />
/// </summary>
/// <param name="windowPosition">The position and size of the Window.</param>
/// <param name="isTranslucent">Whether Window is translucent.</param>
/// <returns>A new Window.</returns>
/// <since_tizen> 6 </since_tizen>
public Window(Rectangle windowPosition = null , bool isTranslucent = false) : this(Interop.Window.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), "", isTranslucent), true)
{
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// Creates a new Window with a specific name.<br />
/// This creates an extra window in addition to the default main window<br />
/// </summary>
/// <param name="name">The name for extra window. </param>
/// <param name="windowPosition">The position and size of the Window.</param>
/// <param name="isTranslucent">Whether Window is translucent.</param>
/// <returns>A new Window.</returns>
/// <since_tizen> 6 </since_tizen>
public Window(string name, Rectangle windowPosition = null, bool isTranslucent = false) : this(Interop.Window.Window_New__SWIG_0(Rectangle.getCPtr(windowPosition), name, isTranslucent), true)
{
this._windowTitle = name;
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// Enumeration for orientation of the window is the way in which a rectangular page is oriented for normal viewing.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public enum WindowOrientation
{
/// <summary>
/// Portrait orientation. The height of the display area is greater than the width.
/// </summary>
/// <since_tizen> 3 </since_tizen>
Portrait = 0,
/// <summary>
/// Landscape orientation. A wide view area is needed.
/// </summary>
/// <since_tizen> 3 </since_tizen>
Landscape = 90,
/// <summary>
/// Portrait inverse orientation.
/// </summary>
/// <since_tizen> 3 </since_tizen>
PortraitInverse = 180,
/// <summary>
/// Landscape inverse orientation.
/// </summary>
/// <since_tizen> 3 </since_tizen>
LandscapeInverse = 270,
/// <summary>
/// No orientation. It is for the preferred orientation
/// Especially, NoOrientationPreference only has the effect for the preferred orientation.
/// It is used to unset the preferred orientation with SetPreferredOrientation.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
NoOrientationPreference = -1
}
/// <summary>
/// Enumeration for the key grab mode for platform-level APIs.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public enum KeyGrabMode
{
/// <summary>
/// Grabs a key only when on the top of the grabbing-window stack mode.
/// </summary>
Topmost = 0,
/// <summary>
/// Grabs a key together with the other client window(s) mode.
/// </summary>
Shared,
/// <summary>
/// Grabs a key exclusively regardless of the grabbing-window's position on the window stack with the possibility of overriding the grab by the other client window mode.
/// </summary>
OverrideExclusive,
/// <summary>
/// Grabs a key exclusively regardless of the grabbing-window's position on the window stack mode.
/// </summary>
Exclusive
};
/// <summary>
/// Enumeration for transition effect's state.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public enum EffectStates
{
/// <summary>
/// None state.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
None = 0,
/// <summary>
/// Transition effect is started.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
Start,
/// <summary>
/// Transition effect is ended.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
End,
}
/// <summary>
/// Enumeration for transition effect's type.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public enum EffectTypes
{
/// <summary>
/// None type.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
None = 0,
/// <summary>
/// Window show effect.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
Show,
/// <summary>
/// Window hide effect.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
Hide,
}
/// <summary>
/// Enumeration for opacity of the indicator.
/// </summary>
internal enum IndicatorBackgroundOpacity
{
Opaque = 100,
Translucent = 50,
Transparent = 0
}
/// <summary>
/// Enumeration for visible mode of the indicator.
/// </summary>
internal enum IndicatorVisibleMode
{
Invisible = 0,
Visible = 1,
Auto = 2
}
/// <summary>
/// The stage instance property (read-only).<br />
/// Gets the current window.<br />
/// </summary>
/// <since_tizen> 3 </since_tizen>
public static Window Instance
{
get
{
return instance;
}
}
/// <summary>
/// Get Resource ID of window
/// </summary>
internal int ResourceID
{
get
{
int ret = Interop.Window.GetResouceID(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
/// <summary>
/// Gets or sets a window type.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public WindowType Type
{
get
{
WindowType ret = (WindowType)Interop.Window.GetType(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
set
{
Interop.Window.SetType(swigCPtr, (int)value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
}
/// <summary>
/// Gets/Sets a window title.
/// </summary>
/// <since_tizen> 4 </since_tizen>
public string Title
{
get
{
return _windowTitle;
}
set
{
_windowTitle = value;
SetClass(_windowTitle, "");
}
}
/// <summary>
/// The rendering behavior of a Window.
/// </summary>
/// <since_tizen> 5 </since_tizen>
public RenderingBehaviorType RenderingBehavior
{
get
{
return GetRenderingBehavior();
}
set
{
SetRenderingBehavior(value);
}
}
/// <summary>
/// The window size property (read-only).
/// </summary>
/// <since_tizen> 3 </since_tizen>
public Size2D Size
{
get
{
Size2D ret = GetSize();
return ret;
}
}
/// <summary>
/// The background color property.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public Color BackgroundColor
{
set
{
SetBackgroundColor(value);
}
get
{
Color ret = GetBackgroundColor();
return ret;
}
}
/// <summary>
/// The DPI property (read-only).<br />
/// Retrieves the DPI of the display device to which the Window is connected.<br />
/// </summary>
/// <since_tizen> 3 </since_tizen>
public Vector2 Dpi
{
get
{
return GetDpi();
}
}
/// <summary>
/// The layer count property (read-only).<br />
/// Queries the number of on-Window layers.<br />
/// </summary>
/// <since_tizen> 3 </since_tizen>
public uint LayerCount
{
get
{
return GetLayerCount();
}
}
/// <summary>
/// Gets or sets a size of the window.
/// </summary>
/// <since_tizen> 4 </since_tizen>
public Size2D WindowSize
{
get
{
return GetWindowSize();
}
set
{
SetWindowSize(value);
}
}
/// <summary>
/// Gets or sets a position of the window.
/// </summary>
/// <since_tizen> 4 </since_tizen>
public Position2D WindowPosition
{
get
{
return GetPosition();
}
set
{
SetPosition(value);
}
}
/// <summary>
/// Sets position and size of the window. This API guarantees that
/// both moving and resizing of window will appear on the screen at once.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public Rectangle WindowPositionSize
{
get
{
Position2D position = GetPosition();
Size2D size = GetSize();
Rectangle ret = new Rectangle(position.X, position.Y, size.Width, size.Height);
return ret;
}
set
{
SetPositionSize(value);
}
}
internal static Vector4 DEFAULT_BACKGROUND_COLOR
{
get
{
global::System.IntPtr cPtr = Interop.Stage.Stage_DEFAULT_BACKGROUND_COLOR_get();
Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
internal static Vector4 DEBUG_BACKGROUND_COLOR
{
get
{
global::System.IntPtr cPtr = Interop.Stage.Stage_DEBUG_BACKGROUND_COLOR_get();
Vector4 ret = (cPtr == global::System.IntPtr.Zero) ? null : new Vector4(cPtr, false);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
}
internal List<Layer> LayersChildren
{
get
{
return _childLayers;
}
}
/// <summary>
/// Get the LayoutController for this Window.
/// </summary>
internal LayoutController LayoutController
{
get
{
return localController;
}
}
/// <summary>
/// Feed a key-event into the window.
/// </summary>
/// <param name="keyEvent">The key event to feed.</param>
/// <since_tizen> 4 </since_tizen>
[Obsolete("Please do not use! This will be deprecated! Please use FeedKey(Key keyEvent) instead!")]
public static void FeedKeyEvent(Key keyEvent)
{
Interop.Window.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// Sets whether the window accepts a focus or not.
/// </summary>
/// <param name="accept">If a focus is accepted or not. The default is true.</param>
/// <since_tizen> 3 </since_tizen>
public void SetAcceptFocus(bool accept)
{
Interop.Window.SetAcceptFocus(swigCPtr, accept);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// Returns whether the window accepts a focus or not.
/// </summary>
/// <returns>True if the window accepts a focus, false otherwise.</returns>
/// <since_tizen> 3 </since_tizen>
public bool IsFocusAcceptable()
{
bool ret = Interop.Window.IsFocusAcceptable(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Shows the window if it is hidden.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public void Show()
{
Interop.Window.Show(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// Hides the window if it is showing.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public void Hide()
{
Interop.Window.Hide(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// Retrieves whether the window is visible or not.
/// </summary>
/// <returns>True if the window is visible.</returns>
/// <since_tizen> 3 </since_tizen>
public bool IsVisible()
{
bool temp = Interop.Window.IsVisible(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return temp;
}
/// <summary>
/// Gets the count of supported auxiliary hints of the window.
/// </summary>
/// <returns>The number of supported auxiliary hints.</returns>
/// <since_tizen> 3 </since_tizen>
public uint GetSupportedAuxiliaryHintCount()
{
uint ret = Interop.Window.GetSupportedAuxiliaryHintCount(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Gets the supported auxiliary hint string of the window.
/// </summary>
/// <param name="index">The index of the supported auxiliary hint lists.</param>
/// <returns>The auxiliary hint string of the index.</returns>
/// <since_tizen> 3 </since_tizen>
public string GetSupportedAuxiliaryHint(uint index)
{
string ret = Interop.Window.GetSupportedAuxiliaryHint(swigCPtr, index);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Creates an auxiliary hint of the window.
/// </summary>
/// <param name="hint">The auxiliary hint string.</param>
/// <param name="value">The value string.</param>
/// <returns>The ID of created auxiliary hint, or 0 on failure.</returns>
/// <since_tizen> 3 </since_tizen>
public uint AddAuxiliaryHint(string hint, string value)
{
uint ret = Interop.Window.AddAuxiliaryHint(swigCPtr, hint, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Removes an auxiliary hint of the window.
/// </summary>
/// <param name="id">The ID of the auxiliary hint.</param>
/// <returns>True if no error occurred, false otherwise.</returns>
/// <since_tizen> 3 </since_tizen>
public bool RemoveAuxiliaryHint(uint id)
{
bool ret = Interop.Window.RemoveAuxiliaryHint(swigCPtr, id);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Changes a value of the auxiliary hint.
/// </summary>
/// <param name="id">The auxiliary hint ID.</param>
/// <param name="value">The value string to be set.</param>
/// <returns>True if no error occurred, false otherwise.</returns>
/// <since_tizen> 3 </since_tizen>
public bool SetAuxiliaryHintValue(uint id, string value)
{
bool ret = Interop.Window.SetAuxiliaryHintValue(swigCPtr, id, value);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Gets a value of the auxiliary hint.
/// </summary>
/// <param name="id">The auxiliary hint ID.</param>
/// <returns>The string value of the auxiliary hint ID, or an empty string if none exists.</returns>
/// <since_tizen> 3 </since_tizen>
public string GetAuxiliaryHintValue(uint id)
{
string ret = Interop.Window.GetAuxiliaryHintValue(swigCPtr, id);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Gets an ID of the auxiliary hint string.
/// </summary>
/// <param name="hint">The auxiliary hint string.</param>
/// <returns>The ID of auxiliary hint string, or 0 on failure.</returns>
/// <since_tizen> 3 </since_tizen>
public uint GetAuxiliaryHintId(string hint)
{
uint ret = Interop.Window.GetAuxiliaryHintId(swigCPtr, hint);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Sets a region to accept input events.
/// </summary>
/// <param name="inputRegion">The region to accept input events.</param>
/// <since_tizen> 3 </since_tizen>
public void SetInputRegion(Rectangle inputRegion)
{
Interop.Window.SetInputRegion(swigCPtr, Rectangle.getCPtr(inputRegion));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// Sets a priority level for the specified notification window.
/// </summary>
/// <param name="level">The notification window level.</param>
/// <returns>True if no error occurred, false otherwise.</returns>
/// <since_tizen> 3 </since_tizen>
public bool SetNotificationLevel(NotificationLevel level)
{
bool ret = Interop.Window.SetNotificationLevel(swigCPtr, (int)level);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Gets a priority level for the specified notification window.
/// </summary>
/// <returns>The notification window level.</returns>
/// <since_tizen> 3 </since_tizen>
public NotificationLevel GetNotificationLevel()
{
NotificationLevel ret = (NotificationLevel)Interop.Window.GetNotificationLevel(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Sets a transparent window's visual state to opaque. <br />
/// If a visual state of a transparent window is opaque, <br />
/// then the window manager could handle it as an opaque window when calculating visibility.
/// </summary>
/// <param name="opaque">Whether the window's visual state is opaque.</param>
/// <remarks>This will have no effect on an opaque window. <br />
/// It doesn't change transparent window to opaque window but lets the window manager know the visual state of the window.
/// </remarks>
/// <since_tizen> 3 </since_tizen>
public void SetOpaqueState(bool opaque)
{
Interop.Window.SetOpaqueState(swigCPtr, opaque);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// Returns whether a transparent window's visual state is opaque or not.
/// </summary>
/// <returns>True if the window's visual state is opaque, false otherwise.</returns>
/// <remarks> The return value has no meaning on an opaque window. </remarks>
/// <since_tizen> 3 </since_tizen>
public bool IsOpaqueState()
{
bool ret = Interop.Window.IsOpaqueState(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Sets a window's screen off mode.
/// </summary>
/// <param name="screenOffMode">The screen mode.</param>
/// <returns>True if no error occurred, false otherwise.</returns>
/// <since_tizen> 4 </since_tizen>
public bool SetScreenOffMode(ScreenOffMode screenOffMode)
{
bool ret = Interop.Window.SetScreenOffMode(swigCPtr, (int)screenOffMode);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Gets the screen mode of the window.
/// </summary>
/// <returns>The screen off mode.</returns>
/// <since_tizen> 4 </since_tizen>
public ScreenOffMode GetScreenOffMode()
{
ScreenOffMode ret = (ScreenOffMode)Interop.Window.GetScreenOffMode(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Sets preferred brightness of the window.
/// </summary>
/// <param name="brightness">The preferred brightness (0 to 100).</param>
/// <returns>True if no error occurred, false otherwise.</returns>
/// <since_tizen> 3 </since_tizen>
public bool SetBrightness(int brightness)
{
bool ret = Interop.Window.SetBrightness(swigCPtr, brightness);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Gets the preferred brightness of the window.
/// </summary>
/// <returns>The preferred brightness.</returns>
/// <since_tizen> 3 </since_tizen>
public int GetBrightness()
{
int ret = Interop.Window.GetBrightness(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Sets the window name and the class string.
/// </summary>
/// <param name="name">The name of the window.</param>
/// <param name="klass">The class of the window.</param>
/// <since_tizen> 4 </since_tizen>
public void SetClass(string name, string klass)
{
Interop.Window.Window_SetClass(swigCPtr, name, klass);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// Raises the window to the top of the window stack.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public void Raise()
{
Interop.Window.Window_Raise(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// Lowers the window to the bottom of the window stack.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public void Lower()
{
Interop.Window.Window_Lower(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// Activates the window to the top of the window stack even it is iconified.
/// </summary>
/// <since_tizen> 3 </since_tizen>
public void Activate()
{
Interop.Window.Window_Activate(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// Gets the default ( root ) layer.
/// </summary>
/// <returns>The root layer.</returns>
/// <since_tizen> 3 </since_tizen>
public Layer GetDefaultLayer()
{
return this.GetRootLayer();
}
/// <summary>
/// Add a child view to window.
/// </summary>
/// <param name="view">the child should be added to the window.</param>
/// <since_tizen> 3 </since_tizen>
public void Add(View view)
{
Interop.Actor.Actor_Add(Layer.getCPtr(GetRootLayer()), View.getCPtr(view));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
this.GetRootLayer().AddViewToLayerList(view); // Maintain the children list in the Layer
view.InternalParent = this.GetRootLayer();
}
/// <summary>
/// Remove a child view from window.
/// </summary>
/// <param name="view">the child to be removed.</param>
/// <since_tizen> 3 </since_tizen>
public void Remove(View view)
{
Interop.Actor.Actor_Remove(Layer.getCPtr(GetRootLayer()), View.getCPtr(view));
this.GetRootLayer().RemoveViewFromLayerList(view); // Maintain the children list in the Layer
view.InternalParent = null;
}
/// <summary>
/// Retrieves the layer at a specified depth.
/// </summary>
/// <param name="depth">The layer's depth index.</param>
/// <returns>The layer found at the given depth.</returns>
/// <since_tizen> 3 </since_tizen>
public Layer GetLayer(uint depth)
{
if (depth < LayersChildren?.Count)
{
Layer ret = LayersChildren?[Convert.ToInt32(depth)];
return ret;
}
else
{
return null;
}
}
/// <summary>
/// Destroy the window immediately.
/// </summary>
[EditorBrowsable(EditorBrowsableState.Never)]
public void Destroy()
{
this.Dispose();
}
/// <summary>
/// Keep rendering for at least the given amount of time.
/// </summary>
/// <param name="durationSeconds">Time to keep rendering, 0 means render at least one more frame.</param>
/// <since_tizen> 3 </since_tizen>
public void KeepRendering(float durationSeconds)
{
Interop.Stage.Stage_KeepRendering(stageCPtr, durationSeconds);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// Grabs the key specified by a key for a window only when a window is the topmost window.<br />
/// This function can be used for following example scenarios: <br />
/// - Mobile - Using volume up or down as zoom up or down in camera apps.<br />
/// </summary>
/// <param name="DaliKey">The key code to grab.</param>
/// <returns>True if the grab succeeds.</returns>
/// <since_tizen> 3 </since_tizen>
public bool GrabKeyTopmost(int DaliKey)
{
bool ret = Interop.Window.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Ungrabs the key specified by a key for the window.<br />
/// Note: If this function is called between key down and up events of a grabbed key, an application doesn't receive the key up event.<br />
/// </summary>
/// <param name="DaliKey">The key code to ungrab.</param>
/// <returns>True if the ungrab succeeds.</returns>
/// <since_tizen> 3 </since_tizen>
public bool UngrabKeyTopmost(int DaliKey)
{
bool ret = Interop.Window.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Grabs the key specified by a key for a window in a GrabMode. <br />
/// Details: This function can be used for following example scenarios: <br />
/// - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app. <br />
/// - Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app. <br />
/// - Mobile - Using the volume up or down as zoom up or down in camera apps. <br />
/// </summary>
/// <param name="DaliKey">The key code to grab.</param>
/// <param name="GrabMode">The grab mode for the key.</param>
/// <returns>True if the grab succeeds.</returns>
/// <since_tizen> 3 </since_tizen>
public bool GrabKey(int DaliKey, KeyGrabMode GrabMode)
{
bool ret = Interop.Window.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Ungrabs the key specified by a key for a window.<br />
/// Note: If this function is called between key down and up events of a grabbed key, an application doesn't receive the key up event. <br />
/// </summary>
/// <param name="DaliKey">The key code to ungrab.</param>
/// <returns>True if the ungrab succeeds.</returns>
/// <since_tizen> 3 </since_tizen>
public bool UngrabKey(int DaliKey)
{
bool ret = Interop.Window.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Sets the keyboard repeat information.
/// </summary>
/// <param name="rate">The key repeat rate value in seconds.</param>
/// <param name="delay">The key repeat delay value in seconds.</param>
/// <returns>True if setting the keyboard repeat succeeds.</returns>
/// <since_tizen> 5 </since_tizen>
public bool SetKeyboardRepeatInfo(float rate, float delay)
{
bool ret = Interop.Window.SetKeyboardRepeatInfo(rate, delay);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Gets the keyboard repeat information.
/// </summary>
/// <param name="rate">The key repeat rate value in seconds.</param>
/// <param name="delay">The key repeat delay value in seconds.</param>
/// <returns>True if setting the keyboard repeat succeeds.</returns>
/// <since_tizen> 5 </since_tizen>
public bool GetKeyboardRepeatInfo(out float rate, out float delay)
{
bool ret = Interop.Window.GetKeyboardRepeatInfo(out rate, out delay);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
return ret;
}
/// <summary>
/// Adds a layer to the stage.
/// </summary>
/// <param name="layer">Layer to add.</param>
/// <since_tizen> 3 </since_tizen>
public void AddLayer(Layer layer)
{
Interop.Window.Add(swigCPtr, Layer.getCPtr(layer));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
LayersChildren?.Add(layer);
layer.SetWindow(this);
}
/// <summary>
/// Removes a layer from the stage.
/// </summary>
/// <param name="layer">Layer to remove.</param>
/// <since_tizen> 3 </since_tizen>
public void RemoveLayer(Layer layer)
{
Interop.Window.Remove(swigCPtr, Layer.getCPtr(layer));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
LayersChildren?.Remove(layer);
layer.SetWindow(null);
}
/// <summary>
/// Feeds a key event into the window.
/// </summary>
/// <param name="keyEvent">The key event to feed.</param>
/// <since_tizen> 5 </since_tizen>
public void FeedKey(Key keyEvent)
{
Interop.Window.Window_FeedKeyEvent(Key.getCPtr(keyEvent));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// Allows at least one more render, even when paused.
/// The window should be shown, not minimised.
/// </summary>
/// <since_tizen> 4 </since_tizen>
public void RenderOnce()
{
Interop.Window.Window_RenderOnce(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// Sets whether the window is transparent or not.
/// </summary>
/// <param name="transparent">Whether the window is transparent or not.</param>
/// <since_tizen> 5 </since_tizen>
public void SetTransparency(bool transparent)
{
Interop.Window.SetTransparency(swigCPtr, transparent);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
// Setting transparency of the window should request a relayout of the tree in the case the window changes from fully transparent.
}
/// <summary>
/// Sets parent window of the window.
/// After setting that, these windows do together when raise-up, lower and iconified/deiconified.
/// Initially, the window is located on top of the parent. The window can go below parent by calling Lower().
/// If parent's window stack is changed by calling Raise() or Lower(), child windows are located on top of the parent again.
/// </summary>
/// <param name="parent">The parent window.</param>
/// <since_tizen> 6 </since_tizen>
public void SetParent(Window parent)
{
Interop.Window.SetParent(swigCPtr, Window.getCPtr(parent));
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>
/// Unsets parent window of the window.
/// After unsetting, the window is disconnected his parent window.
/// </summary>
/// <since_tizen> 6 </since_tizen>
public void Unparent()
{
Interop.Window.Unparent(swigCPtr);
if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve();
}
/// <summary>