summaryrefslogtreecommitdiffstats
path: root/xbmc/interfaces/legacy/Window.h
blob: b30be7ba379bc55f7480183d26556e74e94ff0a2 (plain)
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
/*
 *  Copyright (C) 2005-2018 Team Kodi
 *  This file is part of Kodi - https://kodi.tv
 *
 *  SPDX-License-Identifier: GPL-2.0-or-later
 *  See LICENSES/README.md for more information.
 */

#pragma once

#include "AddonCallback.h"
#include "AddonString.h"
#include "Control.h"
#include "swighelper.h"

#include <limits.h>
#include <mutex>
#include <vector>

namespace XBMCAddon
{
  namespace xbmcgui
  {
    // Forward declare the interceptor as the AddonWindowInterceptor.h
    // file needs to include the Window class because of the template
    class InterceptorBase;

    //
    /// \defgroup python_xbmcgui_action Action
    /// \ingroup python_xbmcgui
    ///@{
    /// @brief **Action class.**
    ///
    /// \python_class{ xbmcgui.Action(): }
    ///
    /// This class serves in addition to identify carried out
    /// \ref kodi_key_action_ids of Kodi and to be able to carry out thereby own
    /// necessary steps.
    ///
    /// The data of this class are always transmitted by callback
    /// Window::onAction at a window.
    ///
    class Action : public AddonClass
    {
    public:
      Action() = default;

#ifndef SWIG
      explicit Action(const CAction& caction) { setFromCAction(caction); }

      void setFromCAction(const CAction& caction);

      long id = -1;
      float fAmount1 = 0.0f;
      float fAmount2 = 0.0f;
      float fRepeat = 0.0f;
      unsigned long buttonCode = 0;
      std::string strAction;

      // Not sure if this is correct but it's here for now.
      AddonClass::Ref<Control> control; // previously pObject
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_action
      /// @brief \python_func{ getId() }
      /// To get \ref kodi_key_action_ids
      ///
      /// This function returns the identification code used by the explained
      /// order, it is necessary to determine the type of command from
      /// \ref kodi_key_action_ids.
      ///
      /// @return                      The action's current id as a long or 0 if
      ///                              no action is mapped in the xml's.
      ///
      ///
      ///-----------------------------------------------------------------------
      ///
      /// **Example:**
      /// ~~~~~~~~~~~~~{.py}
      /// ..
      /// def onAction(self, action):
      ///   if action.getId() == ACTION_PREVIOUS_MENU:
      ///     print('action received: previous')
      /// ..
      /// ~~~~~~~~~~~~~
      ///
      getId();
#else
      long getId() { XBMC_TRACE; return id; }
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_action
      /// @brief \python_func{ getButtonCode() }
      /// Returns the button code for this action.
      ///
      /// @return                        [integer] button code
      ///
      getButtonCode();
#else
      long getButtonCode() { XBMC_TRACE; return buttonCode; }
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_action
      /// @brief \python_func{ getAmount1() }
      /// Returns the first amount of force applied to the thumbstick.
      ///
      /// @return                        [float] first amount
      ///
      getAmount1();
#else
      float getAmount1() { XBMC_TRACE; return fAmount1; }
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_action
      /// @brief \python_func{ getAmount2() }
      /// Returns the second amount of force applied to the thumbstick.
      ///
      /// @return                        [float] second amount
      ///
      getAmount2();
#else
      float getAmount2() { XBMC_TRACE; return fAmount2; }
#endif
    };
    ///@}

    //==========================================================================
    // This is the main class for the xbmcgui.Window functionality. It is tied
    //  into the main Kodi windowing system via the Interceptor
    //==========================================================================
    //
    /// \defgroup python_xbmcgui_window Window
    /// \ingroup python_xbmcgui
    /// @{
    /// @brief __GUI window class for Add-Ons.__
    ///
    /// This class allows over their functions to create and edit windows that
    /// can be accessed from an Add-On.
    ///
    /// Likewise, all functions from here as well in the other window classes
    /// \ref python_xbmcgui_window_dialog "WindowDialog",
    /// \ref python_xbmcgui_window_xml "WindowXML" and
    /// \ref python_xbmcgui_window_dialog_xml "WindowXMLDialog"
    /// with inserted and available.
    ///
    ///
    ///--------------------------------------------------------------------------
    /// Constructor for window
    /// ----------------------------
    ///
    /// \python_class{ xbmcgui.Window([existingWindowId]): }
    ///
    /// Creates a new from Add-On usable window class. This is to create
    /// window for related controls by system calls.
    ///
    /// @param existingWindowId       [opt] Specify an id to use an existing
    ///                               window.
    /// @throws ValueError            if supplied window Id does not exist.
    /// @throws Exception             if more then 200 windows are created.
    ///
    /// Deleting this window will activate the old window that was active
    /// and resets (not delete) all controls that are associated with this
    /// window.
    ///
    ///
    ///--------------------------------------------------------------------------
    ///
    /// **Example:**
    /// ~~~~~~~~~~~~~{.py}
    /// ..
    /// win = xbmcgui.Window()
    /// width = win.getWidth()
    /// ..
    /// ~~~~~~~~~~~~~
    ///
    ///
    //
    class Window : public AddonCallback
    {
      friend class WindowDialogMixin;
      bool isDisposed = false;

      void doAddControl(Control* pControl, CCriticalSection* gcontext, bool wait);
      void doRemoveControl(Control* pControl, CCriticalSection* gcontext, bool wait);

    protected:
#ifndef SWIG
      InterceptorBase* window;
      int iWindowId = -1;

      std::vector<AddonClass::Ref<Control> > vecControls;
      int iOldWindowId = 0;
      int iCurrentControlId = 3000;
      bool bModal = false;
      CEvent m_actionEvent;

      bool canPulse = false;

      // I REALLY hate this ... but it's the simplest fix right now.
      bool existingWindow = true;
      bool destroyAfterDeInit = false;

      /**
       * This only takes a boolean to allow subclasses to explicitly use it. A
       * default constructor can be used as a concrete class and we need to tell
       * the difference.
       * subclasses should use this constructor and not the other.
       */
      explicit Window(bool discrim);

      void deallocating() override;

      /**
       * This helper retrieves the next available id. It is assumed that the
       * global lock is already being held.
       */
      static int getNextAvailableWindowId();

      /**
       * Child classes MUST call this in their constructors. It should be an
       * instance of Interceptor<P extends CGUIWindow>. Control of memory
       * management for this class is then given to the Window.
       */
      void setWindow(InterceptorBase* _window);

      /**
       * This is a helper method since popping the previous window id is a common
       * function.
       */
      void popActiveWindowId();

      /**
       * This is a helper method since getting a control by it's id is a common
       * function.
       */
      Control* GetControlById(int iControlId, CCriticalSection* gc);

      SWIGHIDDENVIRTUAL void PulseActionEvent();
      SWIGHIDDENVIRTUAL bool WaitForActionEvent(unsigned int milliseconds);
#endif

    public:
      explicit Window(int existingWindowId = -1);

      ~Window() override;

#ifndef SWIG
      SWIGHIDDENVIRTUAL bool    OnMessage(CGUIMessage& message);
      SWIGHIDDENVIRTUAL bool    OnAction(const CAction &action);
      SWIGHIDDENVIRTUAL bool    OnBack(int actionId);
      SWIGHIDDENVIRTUAL void    OnDeinitWindow(int nextWindowID);

      SWIGHIDDENVIRTUAL bool IsDialogRunning() const
      {
        XBMC_TRACE;
        return false;
      }
      SWIGHIDDENVIRTUAL bool IsDialog() const
      {
        XBMC_TRACE;
        return false;
      }
      SWIGHIDDENVIRTUAL bool IsModalDialog() const
      {
        XBMC_TRACE;
        return false;
      }
      SWIGHIDDENVIRTUAL bool IsMediaWindow() const
      {
        XBMC_TRACE;
        return false;
      }
      SWIGHIDDENVIRTUAL void    dispose();

      /**
       * This is called from the InterceptorBase destructor to prevent further
       * use of the interceptor from the window.
       */
      inline void interceptorClear()
      {
        std::unique_lock<CCriticalSection> lock(*this);
        window = NULL;
      }
#endif

      //
      /// @defgroup python_xbmcgui_window_cb Callback functions from Kodi to add-on
      /// \ingroup python_xbmcgui_window
      /// @{
      /// @brief __GUI window callback functions.__
      ///
      /// Functions to handle control callbacks from Kodi.
      ///
      /// Likewise, all functions from here as well in the all window classes
      /// (\ref python_xbmcgui_window "Window",
      /// \ref python_xbmcgui_window_dialog "WindowDialog",
      /// \ref python_xbmcgui_window_xml "WindowXML" and
      /// \ref python_xbmcgui_window_dialog_xml "WindowXMLDialog") with inserted
      /// and available.
      ///
      /// ------------------------------------------------------------------------
      ///
      /// @link python_xbmcgui_window Go back to normal functions from window@endlink
      //

      // callback takes a parameter
#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window_cb
      /// @brief \python_func{ onAction(self, Action action) }
      /// **onAction method.**
      ///
      /// This method will receive all actions that the main program will send
      /// to this window.
      ///
      /// @param self                Own base class pointer
      /// @param action              The action id to perform, see
      ///                            \ref python_xbmcgui_action to get use
      ///                            of them
      ///
      /// @note
      /// - By default, only the `PREVIOUS_MENU` and `NAV_BACK actions` are
      ///   handled.
      /// - Overwrite this method to let your script handle all actions.
      /// - Don't forget to capture `ACTION_PREVIOUS_MENU` or `ACTION_NAV_BACK`,
      ///   else the user can't close this window.
      ///
      ///
      ///-----------------------------------------------------------------------
      ///
      /// **Example:**
      /// ~~~~~~~~~~~~~{.py}
      /// ..
      /// # Define own function where becomes called from Kodi
      /// def onAction(self, action):
      ///   if action.getId() == ACTION_PREVIOUS_MENU:
      ///     print('action received: previous')
      ///     self.close()
      ///   if action.getId() == ACTION_SHOW_INFO:
      ///     print('action received: show info')
      ///   if action.getId() == ACTION_STOP:
      ///     print('action received: stop')
      ///   if action.getId() == ACTION_PAUSE:
      ///     print('action received: pause')
      /// ..
      /// ~~~~~~~~~~~~~
      ///
      onAction(...);
#else
      virtual void onAction(Action* action);
#endif

      // on control is not actually on Window in the api but is called into Python anyway.
#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window_cb
      /// @brief \python_func{ onControl(self, Control) }
      /// **onControl method.**
      ///
      /// This method will receive all click events on owned and selected
      /// controls when the control itself doesn't handle the message.
      ///
      /// @param self                Own base class pointer
      /// @param control             The \ref python_xbmcgui_control "Control" class
      ///
      ///
      ///-----------------------------------------------------------------------
      ///
      /// **Example:**
      /// ~~~~~~~~~~~~~{.py}
      /// ..
      /// # Define own function where becomes called from Kodi
      /// def onControl(self, control):
      ///   print("Window.onControl(control=[%s])"%control)
      /// ..
      /// ~~~~~~~~~~~~~
      ///
      void onControl(...);
#else
      virtual void onControl(Control* control);
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window_cb
      /// @brief \python_func{ onClick(self, int controlId) }
      /// **onClick method.**
      ///
      /// This method will receive all click events that the main program will
      /// send to this window.
      ///
      /// @param self                Own base class pointer
      /// @param controlId           The one time clicked GUI control
      ///                            identifier
      ///
      ///
      ///-----------------------------------------------------------------------
      ///
      /// **Example:**
      /// ~~~~~~~~~~~~~{.py}
      /// ..
      /// # Define own function where becomes called from Kodi
      /// def onClick(self,controlId):
      ///   if controlId == 10:
      ///     print("The control with Id 10 is clicked")
      /// ..
      /// ~~~~~~~~~~~~~
      ///
      onClick(...);
#else
      virtual void onClick(int controlId);
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window_cb
      /// @brief \python_func{ onDoubleClick(self, int controlId) }
      /// __onDoubleClick method.__
      ///
      /// This method will receive all double click events that the main program
      /// will send to this window.
      ///
      /// @param self                Own base class pointer
      /// @param controlId           The double clicked GUI control
      ///                            identifier
      ///
      ///
      ///-----------------------------------------------------------------------
      ///
      /// **Example:**
      /// ~~~~~~~~~~~~~{.py}
      /// ..
      /// # Define own function where becomes called from Kodi
      /// def onDoubleClick(self,controlId):
      ///   if controlId == 10:
      ///     print("The control with Id 10 is double clicked")
      /// ..
      /// ~~~~~~~~~~~~~
      ///
      onDoubleClick(...);
#else
      virtual void onDoubleClick(int controlId);
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window_cb
      /// @brief \python_func{ onFocus(self, int controlId) }
      /// __onFocus method.__
      ///
      /// This method will receive all focus events that the main program will
      /// send to this window.
      ///
      /// @param self                Own base class pointer
      /// @param controlId           The focused GUI control identifier
      ///
      ///
      ///-----------------------------------------------------------------------
      ///
      /// **Example:**
      /// ~~~~~~~~~~~~~{.py}
      /// ..
      /// # Define own function where becomes called from Kodi
      ///  def onDoubleClick(self,controlId):
      ///    if controlId == 10:
      ///      print("The control with Id 10 is focused")
      /// ..
      /// ~~~~~~~~~~~~~
      ///
      onFocus(...);
#else
      virtual void onFocus(int controlId);
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window_cb
      /// @brief \python_func{ onInit(self) }
      /// __onInit method.__
      ///
      /// This method will be called to initialize the window
      ///
      /// @param self                Own base class pointer
      ///
      ///
      ///-----------------------------------------------------------------------
      ///
      /// **Example:**
      /// ~~~~~~~~~~~~~{.py}
      /// ..
      /// # Define own function where becomes called from Kodi
      /// def onInit(self):
      ///   print("Window.onInit method called from Kodi")
      /// ..
      /// ~~~~~~~~~~~~~
      ///
      onInit(...);
#else
      virtual void onInit();
#endif
      //@}

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window
      /// @brief \python_func{ show() }
      /// Show this window.
      ///
      /// Shows this window by activating it, calling close() after it wil
      /// activate the current window again.
      ///
      /// @note If your script ends this window will be closed to. To show it
      /// forever, make a loop at the end of your script or use doModal()
      /// instead.
      ///
      show();
#else
      SWIGHIDDENVIRTUAL void show();
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window
      /// @brief \python_func{ setFocus(Control) }
      /// Give the supplied control focus.
      ///
      /// @param Control             \ref python_xbmcgui_control "Control" class to focus
      /// @throws TypeError          If supplied argument is not a \ref python_xbmcgui_control "Control"
      ///                            type
      /// @throws SystemError        On Internal error
      /// @throws RuntimeError       If control is not added to a window
      ///
      setFocus(...);
#else
      SWIGHIDDENVIRTUAL void setFocus(Control* pControl);
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window
      /// @brief \python_func{ setFocusId(ControlId) }
      /// Gives the control with the supplied focus.
      ///
      /// @param ControlId           [integer] On skin defined id of control
      /// @throws SystemError        On Internal error
      /// @throws RuntimeError       If control is not added to a window
      ///
      setFocusId(...);
#else
      SWIGHIDDENVIRTUAL void setFocusId(int iControlId);
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window
      /// @brief \python_func{ getFocus(Control) }
      /// Returns the control which is focused.
      ///
      /// @return                        Focused control class
      /// @throws SystemError            On Internal error
      /// @throws RuntimeError           If no control has focus
      ///
      getFocus();
#else
      SWIGHIDDENVIRTUAL Control* getFocus();
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window
      /// @brief \python_func{ getFocusId(int) }
      /// Returns the id of the control which is focused.
      ///
      /// @return                        Focused control id
      /// @throws SystemError            On Internal error
      /// @throws RuntimeError           If no control has focus
      ///
      getFocusId();
#else
      SWIGHIDDENVIRTUAL long getFocusId();
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window
      /// @brief \python_func{ removeControl(Control) }
      /// Removes the control from this window.
      ///
      /// @param Control             \ref python_xbmcgui_control "Control" class to remove
      /// @throws TypeError          If supplied argument is not a \ref python_xbmcgui_control
      ///                            type
      /// @throws RuntimeError       If control is not added to this window
      ///
      /// This will not delete the control. It is only removed from the window.
      ///
      removeControl(...);
#else
      SWIGHIDDENVIRTUAL void removeControl(Control* pControl);
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window
      /// @brief \python_func{ removeControls(List) }
      /// Removes a list of controls from this window.
      ///
      /// @param List               List with controls to remove
      /// @throws TypeError         If supplied argument is not a \ref python_xbmcgui_control
      ///                           type
      /// @throws RuntimeError      If control is not added to this window
      ///
      /// This will not delete the controls. They are only removed from the
      /// window.
      ///
      removeControls(...);
#else
      SWIGHIDDENVIRTUAL void removeControls(std::vector<Control*> pControls);
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window
      /// @brief \python_func{ getHeight() }
      /// Returns the height of this Window instance.
      ///
      /// @return                       Window height in pixels
      ///
      ///-----------------------------------------------------------------------
      /// @python_v18 Function changed
      ///
      getHeight();
#else
      SWIGHIDDENVIRTUAL long getHeight();
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window
      /// @brief \python_func{ getWidth() }
      /// Returns the width of this Window instance.
      ///
      /// @return                       Window width in pixels
      ///
      ///-----------------------------------------------------------------------
      /// @python_v18 Function changed
      ///
      getWidth();
#else
      SWIGHIDDENVIRTUAL long getWidth();
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window
      /// @brief \python_func{ setProperty(key, value) }
      /// Sets a window property, similar to an infolabel.
      ///
      /// @param key                 string - property name.
      /// @param value               string or unicode - value of property.
      ///
      /// @note  Key is NOT case sensitive. Setting value to an empty string is
      ///        equivalent to clearProperty(key).\n
      ///        You can use the above as keywords for arguments and skip
      ///        certain optional arguments.\n
      ///        Once you use a keyword, all following arguments require the
      ///        keyword.
      ///
      ///
      ///-----------------------------------------------------------------------
      ///
      /// **Example:**
      /// ~~~~~~~~~~~~~{.py}
      /// ..
      /// win = xbmcgui.Window(xbmcgui.getCurrentWindowId())
      /// win.setProperty('Category', 'Newest')
      /// ..
      /// ~~~~~~~~~~~~~
      ///
      setProperty(...);
#else
      SWIGHIDDENVIRTUAL void setProperty(const char* key, const String& value);
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window
      /// @brief \python_func{ getProperty(key) }
      /// Returns a window property as a string, similar to an infolabel.
      ///
      /// @param key                string - property name.
      ///
      /// @note  Key is NOT case sensitive.\n
      ///        You can use the above as keywords for arguments and skip
      ///        certain optional arguments.
      ///        Once you use a keyword, all following arguments require the
      ///        keyword.
      ///
      ///
      ///-----------------------------------------------------------------------
      ///
      /// **Example:**
      /// ~~~~~~~~~~~~~{.py}
      /// ..
      /// win = xbmcgui.Window(xbmcgui.getCurrentWindowId())
      /// category = win.getProperty('Category')
      /// ..
      /// ~~~~~~~~~~~~~
      ///
      getProperty(...);
#else
      SWIGHIDDENVIRTUAL String getProperty(const char* key);
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window
      /// @brief \python_func{ clearProperty(key) }
      /// Clears the specific window property.
      ///
      /// @param key                string - property name.
      ///
      /// @note Key is NOT case sensitive. Equivalent to setProperty(key,'')
      ///       You can use the above as keywords for arguments and skip certain
      ///       optional arguments.
      ///       Once you use a keyword, all following arguments require the
      ///       keyword.
      ///
      ///
      ///-----------------------------------------------------------------------
      ///
      /// **Example:**
      /// ~~~~~~~~~~~~~{.py}
      /// ..
      /// win = xbmcgui.Window(xbmcgui.getCurrentWindowId())
      /// win.clearProperty('Category')
      /// ..
      /// ~~~~~~~~~~~~~
      ///
      clearProperty(...);
#else
      SWIGHIDDENVIRTUAL void clearProperty(const char* key);
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window
      /// @brief \python_func{ clearProperties() }
      /// Clears all window properties.
      ///
      ///
      ///-----------------------------------------------------------------------
      ///
      /// **Example:**
      /// ~~~~~~~~~~~~~{.py}
      /// ..
      /// win = xbmcgui.Window(xbmcgui.getCurrentWindowId())
      /// win.clearProperties()
      /// ..
      /// ~~~~~~~~~~~~~
      ///
      clearProperties();
#else
      SWIGHIDDENVIRTUAL void clearProperties();
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window
      /// @brief \python_func{ close() }
      /// Closes this window.
      ///
      /// Closes this window by activating the old window.
      ///
      /// @note The window is not deleted with this method.
      ///
      close();
#else
      SWIGHIDDENVIRTUAL void close();
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window
      /// @brief \python_func{ doModal() }
      /// Display this window until close() is called.
      ///
      doModal();
#else

      SWIGHIDDENVIRTUAL void doModal();
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window
      /// @brief \python_func{ addControl(Control) }
      /// Add a \ref python_xbmcgui_control "Control" to this window.
      ///
      /// @param Control                \ref python_xbmcgui_control "Control" to add
      /// @throws TypeError             If supplied argument is not a \ref python_xbmcgui_control
      ///                               type
      /// @throws ReferenceError        If control is already used in another
      ///                               window
      /// @throws RuntimeError          Should not happen :-)
      ///
      /// The next controls can be added to a window atm
      ///   | Control-class       | Description                                                |
      ///   |---------------------|------------------------------------------------------------|
      ///   | \ref python_xbmcgui_control_label       "ControlLabel"        | Label control to show text
      ///   | \ref python_xbmcgui_control_fadelabel   "ControlFadeLabel"    | The fadelabel has multiple labels which it cycles through
      ///   | \ref python_xbmcgui_control_textbox     "ControlTextBox"      | To show bigger text field
      ///   | \ref python_xbmcgui_control_button      "ControlButton"       | Brings a button to do some actions
      ///   | \ref python_xbmcgui_control_edit        "ControlEdit"         | The edit control allows a user to input text in Kodi
      ///   | \ref python_xbmcgui_control_fadelabel   "ControlFadeLabel"    | The fade label control is used for displaying multiple pieces of text in the same space in Kodi
      ///   | \ref python_xbmcgui_control_list        "ControlList"         | Add a list for something like files
      ///   | \ref python_xbmcgui_control_group       "ControlGroup"        | Is for a group which brings the others together
      ///   | \ref python_xbmcgui_control_image       "ControlImage"        | Controls a image on skin
      ///   | \ref python_xbmcgui_control_radiobutton "ControlRadioButton"  | For a radio button which handle boolean values
      ///   | \ref python_xbmcgui_control_progress    "ControlProgress"     | Progress bar for a performed work or something else
      ///   | \ref python_xbmcgui_control_slider      "ControlSlider"       | The slider control is used for things where a sliding bar best represents the operation at hand
      ///   | \ref python_xbmcgui_control_spin        "ControlSpin"         | The spin control is used for when a list of options can be chosen
      ///   | \ref python_xbmcgui_control_textbox     "ControlTextBox"      | The text box is used for showing a large multipage piece of text in Kodi
      ///
      addControl(...);
#else
      SWIGHIDDENVIRTUAL void addControl(Control* pControl);
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window
      /// @brief \python_func{ addControls(List) }
      /// Add a list of Controls to this window.
      ///
      /// @param List                   List with controls to add
      /// @throws TypeError             If supplied argument is not of List
      ///                               type, or a control is not of \ref python_xbmcgui_control
      ///                               type
      /// @throws ReferenceError        If control is already used in another
      ///                               window
      /// @throws RuntimeError          Should not happen :-)
      ///
      addControls(...);
#else
      SWIGHIDDENVIRTUAL void addControls(std::vector<Control*> pControls);
#endif

#ifdef DOXYGEN_SHOULD_USE_THIS
      ///
      /// \ingroup python_xbmcgui_window
      /// @brief \python_func{ getControl(controlId) }
      /// Gets the control from this window.
      ///
      /// @param controlId              \ref python_xbmcgui_control id to get
      /// @throws Exception             If \ref python_xbmcgui_control doesn't exist
      ///
      /// @remark controlId doesn't have to be a python control, it can be a
      /// control id from a Kodi window too (you can find id's in the xml files.
      ///
      /// @note Not python controls are not completely usable yet
      /// You can only use the \ref python_xbmcgui_control functions
      ///
      getControl(...);
#else
      SWIGHIDDENVIRTUAL Control* getControl(int iControlId);
#endif
    };
    ///@}
  }
}