Merge pull request #4875 from koying/fixdroidremotekeyboard
[vuplus_xbmc] / xbmc / interfaces / legacy / Control.h
1 /*
2  *      Copyright (C) 2005-2013 Team XBMC
3  *      http://xbmc.org
4  *
5  *  This Program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2, or (at your option)
8  *  any later version.
9  *
10  *  This Program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with XBMC; see the file COPYING.  If not, see
17  *  <http://www.gnu.org/licenses/>.
18  *
19  */
20
21 #pragma once
22
23 #include "guilib/GUIControl.h"
24 #include "guilib/GUIFont.h"
25 #include "guilib/Key.h"
26
27 #include "Alternative.h"
28 #include "Tuple.h"
29 #include "ListItem.h"
30 #include "swighelper.h"
31 #include "WindowException.h"
32
33
34 // hardcoded offsets for button controls (and controls that use button controls)
35 // ideally they should be dynamically read in as with all the other properties.
36 #define CONTROL_TEXT_OFFSET_X 10
37 #define CONTROL_TEXT_OFFSET_Y 2
38
39 namespace XBMCAddon
40 {
41   namespace xbmcgui
42   {
43     /**
44      * Control class.
45      * 
46      * Base class for all controls.
47      */
48     class Control : public AddonClass
49     {
50     protected:
51       Control() : iControlId(0), iParentId(0), dwPosX(0), dwPosY(0), dwWidth(0),
52                   dwHeight(0), iControlUp(0), iControlDown(0), iControlLeft(0),
53                   iControlRight(0), pGUIControl(NULL) {}
54
55     public:
56       virtual ~Control();
57
58 #ifndef SWIG
59       virtual CGUIControl* Create() throw (WindowException);
60 #endif
61
62       // currently we only accept messages from a button or controllist with a select action
63       virtual bool canAcceptMessages(int actionId) { return false; }
64
65       /**
66        * getId() -- Returns the control's current id as an integer.
67        * 
68        * example:
69        *   - id = self.button.getId()
70        */
71       virtual int getId() { return iControlId; }
72
73       inline bool operator==(const Control& other) const { return iControlId == other.iControlId; }
74       inline bool operator>(const Control& other) const { return iControlId > other.iControlId; }
75       inline bool operator<(const Control& other) const { return iControlId < other.iControlId; }
76
77       // hack this because it returns a tuple
78       /**
79        * getPosition() -- Returns the control's current position as a x,y integer tuple.
80        * 
81        * example:
82        *   - pos = self.button.getPosition()
83        */
84       virtual std::vector<int> getPosition();
85       virtual int getX() { return dwPosX; }
86       virtual int getY() { return dwPosY; }
87
88       /**
89        * getHeight() -- Returns the control's current height as an integer.
90        * 
91        * example:
92        *   - height = self.button.getHeight()
93        */
94       virtual int getHeight() { return dwHeight; }
95
96       // getWidth() Method
97       /**
98        * getWidth() -- Returns the control's current width as an integer.
99        * 
100        * example:
101        *   - width = self.button.getWidth()
102        */
103       virtual int getWidth() { return dwWidth; }
104
105       // setEnabled() Method
106       /**
107        * setEnabled(enabled) -- Set's the control's enabled/disabled state.
108        * 
109        * enabled        : bool - True=enabled / False=disabled.
110        * 
111        * example:
112        *   - self.button.setEnabled(False)n
113        */
114       virtual void setEnabled(bool enabled);
115
116       // setVisible() Method
117       /**
118        * setVisible(visible) -- Set's the control's visible/hidden state.
119        * 
120        * visible        : bool - True=visible / False=hidden.
121        * 
122        * example:
123        *   - self.button.setVisible(False)
124        */
125       virtual void setVisible(bool visible);
126
127       // setVisibleCondition() Method
128       /**
129        * setVisibleCondition(visible[,allowHiddenFocus]) -- Set's the control's visible condition.
130        *     Allows XBMC to control the visible status of the control.
131        * 
132        * visible          : string - Visible condition.\n
133        * allowHiddenFocus : bool - True=gains focus even if hidden.
134        * 
135        * List of Conditions - http://wiki.xbmc.org/index.php?title=List_of_Boolean_Conditions 
136        * 
137        * example:
138        *   - self.button.setVisibleCondition('[Control.IsVisible(41) + !Control.IsVisible(12)]', True)
139        */
140       virtual void setVisibleCondition(const char* visible, bool allowHiddenFocus = false);
141
142       // setEnableCondition() Method
143       /**
144        * setEnableCondition(enable) -- Set's the control's enabled condition.
145        *     Allows XBMC to control the enabled status of the control.
146        * 
147        * enable           : string - Enable condition.
148        * 
149        * List of Conditions - http://wiki.xbmc.org/index.php?title=List_of_Boolean_Conditions 
150        * 
151        * example:
152        *   - self.button.setEnableCondition('System.InternetState')
153        */
154       virtual void setEnableCondition(const char* enable);
155
156       // setAnimations() Method
157       /**
158        * setAnimations([(event, attr,)*]) -- Set's the control's animations.
159        * 
160        * [(event,attr,)*] : list - A list of tuples consisting of event and attributes pairs.
161        *   - event        : string - The event to animate.
162        *   - attr         : string - The whole attribute string separated by spaces.
163        * 
164        * Animating your skin - http://wiki.xbmc.org/?title=Animating_Your_Skin 
165        * 
166        * example:
167        *   - self.button.setAnimations([('focus', 'effect=zoom end=90,247,220,56 time=0',)])
168        */
169       virtual void setAnimations(const std::vector< Tuple<String,String> >& eventAttr) throw (WindowException);
170
171       // setPosition() Method
172       /**
173        * setPosition(x, y) -- Set's the controls position.
174        * 
175        * x              : integer - x coordinate of control.\n
176        * y              : integer - y coordinate of control.
177        * 
178        * *Note, You may use negative integers. (e.g sliding a control into view)
179        * 
180        * example:
181        *   - self.button.setPosition(100, 250)
182        */
183       virtual void setPosition(long x, long y);
184
185       // setWidth() Method
186       /**
187        * setWidth(width) -- Set's the controls width.
188        * 
189        * width          : integer - width of control.
190        * 
191        * example:
192        *   - self.image.setWidth(100)
193        */
194       virtual void setWidth(long width);
195
196       // setHeight() Method
197       /**
198        * setHeight(height) -- Set's the controls height.
199        * 
200        * height         : integer - height of control.
201        * 
202        * example:
203        *   - self.image.setHeight(100)
204        */
205       virtual void setHeight(long height);
206
207       // setNavigation() Method
208       /**
209        * setNavigation(up, down, left, right) -- Set's the controls navigation.
210        * 
211        * up             : control object - control to navigate to on up.\n
212        * down           : control object - control to navigate to on down.\n
213        * left           : control object - control to navigate to on left.\n
214        * right          : control object - control to navigate to on right.
215        * 
216        * *Note, Same as controlUp(), controlDown(), controlLeft(), controlRight().
217        *        Set to self to disable navigation for that direction.
218        * 
219        * Throws:
220        *     - TypeError, if one of the supplied arguments is not a control type.
221        *     - ReferenceError, if one of the controls is not added to a window.
222        * 
223        * example:
224        *   - self.button.setNavigation(self.button1, self.button2, self.button3, self.button4)
225        */
226       virtual void setNavigation(const Control* up, const Control* down,
227                                  const Control* left, const Control* right) 
228         throw (WindowException);
229
230       // controlUp() Method
231       /**
232        * controlUp(control) -- Set's the controls up navigation.
233        * 
234        * control        : control object - control to navigate to on up.
235        * 
236        * *Note, You can also use setNavigation(). Set to self to disable navigation.
237        * 
238        * Throws: 
239        *      - TypeError, if one of the supplied arguments is not a control type.
240        *      - ReferenceError, if one of the controls is not added to a window.
241        * 
242        * example:
243        *   - self.button.controlUp(self.button1)
244        */
245       virtual void controlUp(const Control* up) throw (WindowException);
246
247       // controlDown() Method
248       /**
249        * controlDown(control) -- Set's the controls down navigation.
250        * 
251        * control        : control object - control to navigate to on down.
252        * 
253        * *Note, You can also use setNavigation(). Set to self to disable navigation.
254        * 
255        * Throws: 
256        *    - TypeError, if one of the supplied arguments is not a control type.
257        *    - ReferenceError, if one of the controls is not added to a window.
258        * 
259        * example:
260        *   - self.button.controlDown(self.button1)
261        */
262       virtual void controlDown(const Control* control) throw (WindowException);
263
264       // controlLeft() Method
265       /**
266        * controlLeft(control) -- Set's the controls left navigation.
267        * 
268        * control        : control object - control to navigate to on left.
269        * 
270        * *Note, You can also use setNavigation(). Set to self to disable navigation.
271        * 
272        * Throws:
273        *    - TypeError, if one of the supplied arguments is not a control type.
274        *    - ReferenceError, if one of the controls is not added to a window.
275        * 
276        * example:
277        *   - self.button.controlLeft(self.button1)
278        */
279       virtual void controlLeft(const Control* control) throw (WindowException);
280
281       // controlRight() Method
282       /**
283        * controlRight(control) -- Set's the controls right navigation.
284        * 
285        * control        : control object - control to navigate to on right.
286        * 
287        * *Note, You can also use setNavigation(). Set to self to disable navigation.
288        * 
289        * Throws: 
290        *    - TypeError, if one of the supplied arguments is not a control type.
291        *    - ReferenceError, if one of the controls is not added to a window.
292        * 
293        * example:
294        *   - self.button.controlRight(self.button1)
295        */
296       virtual void controlRight(const Control* control) throw (WindowException);
297
298 #ifndef SWIG
299       int iControlId;
300       int iParentId;
301       int dwPosX;
302       int dwPosY;
303       int dwWidth;
304       int dwHeight;
305       int iControlUp;
306       int iControlDown;
307       int iControlLeft;
308       int iControlRight;
309       CGUIControl* pGUIControl;
310 #endif
311
312     };
313
314     /**
315      * ControlSpin class.
316      * 
317      *  - Not working yet -.
318      * 
319      * you can't create this object, it is returned by objects like ControlTextBox and ControlList.
320      */
321     class ControlSpin : public Control
322     {
323     public:
324       virtual ~ControlSpin();
325
326       /**
327        * setTextures(up, down, upFocus, downFocus) -- Set's textures for this control.
328        * 
329        * texture are image files that are used for example in the skin
330        */
331       virtual void setTextures(const char* up, const char* down, 
332                                const char* upFocus, 
333                                const char* downFocus) throw(UnimplementedException);
334 #ifndef SWIG
335       color_t color;
336       std::string strTextureUp;
337       std::string strTextureDown;
338       std::string strTextureUpFocus;
339       std::string strTextureDownFocus;
340 #endif
341
342     private:
343       ControlSpin();
344
345       friend class Window;
346       friend class ControlList;
347
348     };
349
350     /**
351      * ControlLabel class.
352      * 
353      * ControlLabel(x, y, width, height, label[, font, textColor, 
354      *              disabledColor, alignment, hasPath, angle])
355      * 
356      * x              : integer - x coordinate of control.\n
357      * y              : integer - y coordinate of control.\n
358      * width          : integer - width of control.\n
359      * height         : integer - height of control.\n
360      * label          : string or unicode - text string.\n
361      * font           : [opt] string - font used for label text. (e.g. 'font13')\n
362      * textColor      : [opt] hexstring - color of enabled label's label. (e.g. '0xFFFFFFFF')\n
363      * disabledColor  : [opt] hexstring - color of disabled label's label. (e.g. '0xFFFF3300')\n
364      * alignment      : [opt] integer - alignment of label - *Note, see xbfont.h\n
365      * hasPath        : [opt] bool - True=stores a path / False=no path.\n
366      * angle          : [opt] integer - angle of control. (+ rotates CCW, - rotates C\n
367      * 
368      * example:
369      *   - self.label = xbmcgui.ControlLabel(100, 250, 125, 75, 'Status', angle=45)
370      */
371     class ControlLabel : public Control
372     {
373     public:
374       ControlLabel(long x, long y, long width, long height, const String& label,
375                   const char* font = NULL, const char* textColor = NULL, 
376                   const char* disabledColor = NULL,
377                   long alignment = XBFONT_LEFT, 
378                   bool hasPath = false, long angle = 0);
379
380       virtual ~ControlLabel();
381
382       /**
383        * getLabel() -- Returns the text value for this label.
384        * 
385        * example:
386        *   - label = self.label.getLabel()
387        */
388       virtual String getLabel() throw(UnimplementedException);
389
390       /**
391        * setLabel(label) -- Set's text for this label.
392        * 
393        * label          : string or unicode - text string.
394        * 
395        * example:
396        *   - self.label.setLabel('Status')
397        */
398       virtual void setLabel(const String& label = emptyString, 
399                             const char* font = NULL,
400                             const char* textColor = NULL,
401                             const char* disabledColor = NULL,
402                             const char* shadowColor = NULL,
403                             const char* focusedColor = NULL,
404                             const String& label2 = emptyString) throw(UnimplementedException);
405 #ifndef SWIG
406       ControlLabel() : 
407         bHasPath(false),
408         iAngle  (0)
409       {}
410
411       std::string strFont;
412       std::string strText;
413       color_t textColor;
414       color_t disabledColor;
415       uint32_t align;
416       bool bHasPath;
417       int iAngle;
418
419       SWIGHIDDENVIRTUAL CGUIControl* Create() throw (WindowException);
420
421 #endif
422     };
423
424     // ControlEdit class
425     /**
426      * ControlEdit class.
427      * 
428      * ControlEdit(x, y, width, height, label[, font, textColor, 
429      *              disabledColor, alignment, focusTexture, noFocusTexture])
430      * 
431      * x              : integer - x coordinate of control.\n
432      * y              : integer - y coordinate of control.\n
433      * width          : integer - width of control.\n
434      * height         : integer - height of control.\n
435      * label          : string or unicode - text string.\n
436      * font           : [opt] string - font used for label text. (e.g. 'font13')\n
437      * textColor      : [opt] hexstring - color of enabled label's label. (e.g. '0xFFFFFFFF')\n
438      * disabledColor  : [opt] hexstring - color of disabled label's label. (e.g. '0xFFFF3300')\n
439      * alignment      : [opt] integer - alignment of label - *Note, see xbfont.h\n
440      * focusTexture   : [opt] string - filename for focus texture.\n
441      * noFocusTexture : [opt] string - filename for no focus texture.\n
442      * isPassword     : [opt] bool - if true, mask text value.
443      * 
444      * *Note, You can use the above as keywords for arguments and skip certain optional arguments.\n
445      *        Once you use a keyword, all following arguments require the keyword.\n
446      *        After you create the control, you need to add it to the window with addControl().\n
447      * 
448      * example:
449      *   - self.edit = xbmcgui.ControlEdit(100, 250, 125, 75, 'Status')
450      */
451     class ControlEdit : public Control
452     {
453     public:
454       ControlEdit(long x, long y, long width, long height, const String& label,
455                   const char* font = NULL, const char* textColor = NULL, 
456                   const char* disabledColor = NULL,
457                   long _alignment = XBFONT_LEFT, const char* focusTexture = NULL,
458                   const char* noFocusTexture = NULL, bool isPassword = false);
459
460
461       // setLabel() Method
462       /**
463        * setLabel(label) -- Set's text heading for this edit control.
464        * 
465        * label          : string or unicode - text string.
466        * 
467        * example:
468        *   - self.edit.setLabel('Status')
469        */
470       virtual void setLabel(const String& label = emptyString, 
471                             const char* font = NULL,
472                             const char* textColor = NULL,
473                             const char* disabledColor = NULL,
474                             const char* shadowColor = NULL,
475                             const char* focusedColor = NULL,
476                             const String& label2 = emptyString) throw(UnimplementedException);
477
478       // getLabel() Method
479       /**
480        * getLabel() -- Returns the text heading for this edit control.
481        * 
482        * example:
483        *   - label = self.edit.getLabel()
484        */
485       virtual String getLabel() throw(UnimplementedException);
486
487       // setText() Method
488       /**
489        * setText(value) -- Set's text value for this edit control.
490        * 
491        * value          : string or unicode - text string.
492        * 
493        * example:
494        *   - self.edit.setText('online')
495        */
496       virtual void setText(const String& text) throw(UnimplementedException);
497
498       // getText() Method
499       /**
500        * getText() -- Returns the text value for this edit control.
501        * 
502        * example:
503        *   - value = self.edit.getText()
504        */
505       virtual String getText() throw(UnimplementedException);
506
507 #ifndef SWIG
508       ControlEdit() :
509         bIsPassword (false)
510       {}
511
512       std::string strFont;
513       std::string strText;
514       std::string strTextureFocus;
515       std::string strTextureNoFocus;
516       color_t textColor;
517       color_t disabledColor;
518       uint32_t align;
519       bool bIsPassword;
520
521       SWIGHIDDENVIRTUAL CGUIControl* Create() throw (WindowException);
522 #endif
523     };
524
525     /**
526      * ControlList class.
527      * 
528      * ControlList(x, y, width, height[, font, textColor, buttonTexture, buttonFocusTexture,
529      *             selectedColor, imageWidth, imageHeight, itemTextXOffset, itemTextYOffset,
530      *             itemHeight, space, alignmentY])n"//, shadowColor])
531      * 
532      * x                  : integer - x coordinate of control.\n
533      * y                  : integer - y coordinate of control.\n
534      * width              : integer - width of control.\n
535      * height             : integer - height of control.\n
536      * font               : [opt] string - font used for items label. (e.g. 'font13')\n
537      * textColor          : [opt] hexstring - color of items label. (e.g. '0xFFFFFFFF')\n
538      * buttonTexture      : [opt] string - filename for focus texture.\n
539      * buttonFocusTexture : [opt] string - filename for no focus texture.\n
540      * selectedColor      : [opt] integer - x offset of label.\n
541      * imageWidth         : [opt] integer - width of items icon or thumbnail.\n
542      * imageHeight        : [opt] integer - height of items icon or thumbnail.\n
543      * itemTextXOffset    : [opt] integer - x offset of items label.\n
544      * itemTextYOffset    : [opt] integer - y offset of items label.\n
545      * itemHeight         : [opt] integer - height of items.\n
546      * space              : [opt] integer - space between items.\n
547      * alignmentY         : [opt] integer - Y-axis alignment of items label - *Note, see xbfont.h\n
548      * //"shadowColor        : [opt] hexstring - color of items label's shadow. (e.g. '0xFF000000')
549      * 
550      * *Note, You can use the above as keywords for arguments and skip certain optional arguments.\n
551      *        Once you use a keyword, all following arguments require the keyword.\n
552      *        After you create the control, you need to add it to the window with addControl().\n
553      * 
554      * example:
555      *   - self.cList = xbmcgui.ControlList(100, 250, 200, 250, 'font14', space=5)
556      */
557     class ControlList : public Control 
558     {
559       void internAddListItem(AddonClass::Ref<ListItem> listitem, bool sendMessage) throw(WindowException);
560
561     public:
562       ControlList(long x, long y, long width, long height, const char* font = NULL,
563                   const char* textColor = NULL, const char* buttonTexture = NULL,
564                   const char* buttonFocusTexture = NULL,
565                   const char* selectedColor = NULL,
566                   long _imageWidth=10, long _imageHeight=10, long _itemTextXOffset = CONTROL_TEXT_OFFSET_X,
567                   long _itemTextYOffset = CONTROL_TEXT_OFFSET_Y, long _itemHeight = 27, long _space = 2, 
568                   long _alignmentY = XBFONT_CENTER_Y);
569
570       virtual ~ControlList();
571
572       /**
573        * addItem(item) -- Add a new item to this list control.
574        * 
575        * item               : string, unicode or ListItem - item to add.
576        * 
577        * example:
578        *   - cList.addItem('Reboot XBMC')
579        */
580       virtual void addItem(const Alternative<String, const XBMCAddon::xbmcgui::ListItem* > & item, bool sendMessage = true);
581
582       /**
583        * addItems(items) -- Adds a list of listitems or strings to this list control.
584        * 
585        * items                : List - list of strings, unicode objects or ListItems to add.
586        * 
587        * *Note, You can use the above as keywords for arguments.
588        * 
589        * Large lists benefit considerably, than using the standard addItem()
590        * 
591        * example:
592        *   - cList.addItems(items=listitems)
593        */
594       virtual void addItems(const std::vector<Alternative<String, const XBMCAddon::xbmcgui::ListItem* > > & items);
595
596       /**
597        * selectItem(item) -- Select an item by index number.
598        * 
599        * item               : integer - index number of the item to select.
600        * 
601        * example:
602        *   - cList.selectItem(12)
603        */
604       virtual void selectItem(long item) throw(UnimplementedException);
605
606       /**
607        * removeItem(index) -- Remove an item by index number.
608        *
609        * index              : integer - index number of the item to remove.
610        *
611        * example:
612        *   - cList.removeItem(12)
613        */
614       virtual void removeItem(int index) throw (UnimplementedException,WindowException);
615
616       /**
617        * reset() -- Clear all ListItems in this control list.
618        * 
619        * example:
620        *   - cList.reset()
621        */
622       virtual void reset() throw (UnimplementedException);
623
624       /**
625        * getSpinControl() -- returns the associated ControlSpin object.
626        * 
627        * *Note, Not working completely yet -\n
628        *        After adding this control list to a window it is not possible to change\n
629        *        the settings of this spin control.
630        * 
631        * example:
632        *   - ctl = cList.getSpinControl()
633        */
634       virtual Control* getSpinControl() throw (UnimplementedException);
635
636       /**
637        * getSelectedPosition() -- Returns the position of the selected item as an integer.
638        * 
639        * *Note, Returns -1 for empty lists.
640        * 
641        * example:
642        *   - pos = cList.getSelectedPosition()
643        */
644       virtual long getSelectedPosition() throw (UnimplementedException);
645
646       /**
647        * getSelectedItem() -- Returns the selected item as a ListItem object.
648        * 
649        * *Note, Same as getSelectedPosition(), but instead of an integer a ListItem object\n
650        *        is returned. Returns None for empty lists.\n
651        *        See windowexample.py on how to use this.
652        * 
653        * example:
654        *   - item = cList.getSelectedItem()
655        */
656       virtual XBMCAddon::xbmcgui::ListItem* getSelectedItem() throw (UnimplementedException);
657
658
659       // setImageDimensions() method
660       /**
661        * setImageDimensions(imageWidth, imageHeight) -- Sets the width/height of items icon or thumbnail.
662        * 
663        * imageWidth         : [opt] integer - width of items icon or thumbnail.\n
664        * imageHeight        : [opt] integer - height of items icon or thumbnail.
665        * 
666        * example:
667        *   - cList.setImageDimensions(18, 18)
668        */
669       virtual void setImageDimensions(long imageWidth,long imageHeight) throw (UnimplementedException);
670
671       // setItemHeight() method
672       /**
673        * setItemHeight(itemHeight) -- Sets the height of items.
674        * 
675        * itemHeight         : integer - height of items.
676        * 
677        * example:
678        *   - cList.setItemHeight(25)
679        */
680       virtual void setItemHeight(long height) throw (UnimplementedException);
681
682       // setSpace() method
683       /**
684        * setSpace(space) -- Set's the space between items.
685        * 
686        * space              : [opt] integer - space between items.
687        * 
688        * example:
689        *   - cList.setSpace(5)
690        */
691       virtual void setSpace(int space) throw (UnimplementedException);
692
693       // setPageControlVisible() method
694       /**
695        * setPageControlVisible(visible) -- Sets the spin control's visible/hidden state.
696        * 
697        * visible            : boolean - True=visible / False=hidden.
698        * 
699        * example:
700        *   - cList.setPageControlVisible(True)
701        */
702       virtual void setPageControlVisible(bool visible) throw(UnimplementedException);
703
704       // size() method
705       /**
706        * size() -- Returns the total number of items in this list control as an integer.
707        * 
708        * example:
709        *   - cnt = cList.size()
710        */
711       virtual long size() throw (UnimplementedException);
712
713
714       // getItemHeight() Method
715       /**
716        * getItemHeight() -- Returns the control's current item height as an integer.
717        * 
718        * example:
719        *   - item_height = self.cList.getItemHeight()
720        */
721       virtual long getItemHeight() throw(UnimplementedException);
722
723       // getSpace() Method
724       /**
725        * getSpace() -- Returns the control's space between items as an integer.
726        * 
727        * example:
728        *   - gap = self.cList.getSpace()
729        */
730       virtual long getSpace() throw (UnimplementedException);
731
732       // getListItem() method
733       /**
734        * getListItem(index) -- Returns a given ListItem in this List.
735        * 
736        * index           : integer - index number of item to return.
737        * 
738        * *Note, throws a ValueError if index is out of range.
739        * 
740        * example:
741        *   - listitem = cList.getListItem(6)
742        */
743       virtual XBMCAddon::xbmcgui::ListItem* getListItem(int index) throw (UnimplementedException,WindowException);
744
745       /**
746        * setStaticContent(items) -- Fills a static list with a list of listitems.
747        * 
748        * items                : List - list of listitems to add.
749        * 
750        * *Note, You can use the above as keywords for arguments.
751        * 
752        * example:
753        *   - cList.setStaticContent(items=listitems)
754        */
755       virtual void setStaticContent(const ListItemList* items) throw (UnimplementedException);
756
757 #ifndef SWIG
758       void sendLabelBind(int tail);
759
760       SWIGHIDDENVIRTUAL bool canAcceptMessages(int actionId) 
761       { return ((actionId == ACTION_SELECT_ITEM) | (actionId == ACTION_MOUSE_LEFT_CLICK)); }
762
763       // This is called from AddonWindow.cpp but shouldn't be available
764       //  to the scripting languages.
765       ControlList() :
766         imageHeight     (0),
767         imageWidth      (0),
768         itemHeight      (0),
769         space           (0),
770         itemTextOffsetX (0),
771         itemTextOffsetY (0)
772       {}
773
774       std::vector<AddonClass::Ref<ListItem> > vecItems;
775       std::string strFont;
776       AddonClass::Ref<ControlSpin> pControlSpin;
777
778       color_t textColor;
779       color_t selectedColor;
780       std::string strTextureButton;
781       std::string strTextureButtonFocus;
782
783       int imageHeight;
784       int imageWidth;
785       int itemHeight;
786       int space;
787
788       int itemTextOffsetX;
789       int itemTextOffsetY;
790       uint32_t alignmentY;
791
792       SWIGHIDDENVIRTUAL CGUIControl* Create() throw (WindowException);
793 #endif
794     };
795
796     // ControlFadeLabel class
797     /**
798      * ControlFadeLabel class.\n
799      * Control that scroll's labl
800      * 
801      * ControlFadeLabel(x, y, width, height[, font, textColor, alignment])
802      * 
803      * x              : integer - x coordinate of control.\n
804      * y              : integer - y coordinate of control.\n
805      * width          : integer - width of control.\n
806      * height         : integer - height of control.\n
807      * font           : [opt] string - font used for label text. (e.g. 'font13')\n
808      * textColor      : [opt] hexstring - color of fadelabel's labels. (e.g. '0xFFFFFFFF')\n
809      * alignment      : [opt] integer - alignment of label - *Note, see xbfont.h
810      * 
811      * *Note, You can use the above as keywords for arguments and skip certain optional arguments.\n
812      *        Once you use a keyword, all following arguments require the keyword.\n
813      *        After you create the control, you need to add it to the window with addControl().
814      * 
815      * example:
816      *   - self.fadelabel = xbmcgui.ControlFadeLabel(100, 250, 200, 50, textColor='0xFFFFFFFF')
817      */
818     class ControlFadeLabel : public Control
819     {
820     public:
821       ControlFadeLabel(long x, long y, long width, long height, 
822                        const char* font = NULL, 
823                        const char* textColor = NULL, 
824                        long _alignment = XBFONT_LEFT);
825
826       // addLabel() Method
827       /**
828        * addLabel(label) -- Add a label to this control for scrolling.
829        * 
830        * label          : string or unicode - text string.
831        * 
832        * example:
833        *   - self.fadelabel.addLabel('This is a line of text that can scroll.')
834        */
835        virtual void addLabel(const String& label) throw (UnimplementedException);
836
837       /**
838        * reset() -- Clear this fade label.
839        * 
840        * example:
841        *   - self.fadelabel.reset()
842        */
843       virtual void reset() throw (UnimplementedException);
844
845 #ifndef SWIG
846       std::string strFont;
847       color_t textColor;
848       std::vector<std::string> vecLabels;
849       uint32_t align;
850
851       SWIGHIDDENVIRTUAL CGUIControl* Create() throw (WindowException);
852
853       ControlFadeLabel() {}
854 #endif
855     };
856
857     /**
858      * ControlTextBox class.
859      * 
860      * ControlTextBox(x, y, width, height[, font, textColor])
861      * 
862      * x              : integer - x coordinate of control.\n
863      * y              : integer - y coordinate of control.\n
864      * width          : integer - width of control.\n
865      * height         : integer - height of control.\n
866      * font           : [opt] string - font used for text. (e.g. 'font13')\n
867      * textColor      : [opt] hexstring - color of textbox's text. (e.g. '0xFFFFFFFF')
868      * 
869      * *Note, You can use the above as keywords for arguments and skip certain optional arguments.\n
870      *        Once you use a keyword, all following arguments require the keyword.\n
871      *        After you create the control, you need to add it to the window with addControl().
872      * 
873      * example:
874      *   - self.textbox = xbmcgui.ControlTextBox(100, 250, 300, 300, textColor='0xFFFFFFFF')
875      */
876     class ControlTextBox : public Control
877     {
878     public:
879       ControlTextBox(long x, long y, long width, long height, 
880                      const char* font = NULL, 
881                      const char* textColor = NULL);
882
883       // SetText() Method
884       /**
885        * setText(text) -- Set's the text for this textbox.
886        * 
887        * text           : string or unicode - text string.
888        * 
889        * example:
890        *   - self.textbox.setText('This is a line of text that can wrap.')
891        */
892       virtual void setText(const String& text) throw(UnimplementedException);
893
894       // getText() Method
895       /**
896        * getText() -- Returns the text value for this textbox.
897        *
898        * example:
899        *   - text = self.text.getText()
900        */
901       virtual String getText() throw(UnimplementedException);
902
903       // reset() Method
904       /**
905        * reset() -- Clear's this textbox.
906        * 
907        * example:
908        *   - self.textbox.reset()
909        */
910       virtual void reset() throw(UnimplementedException);
911
912       // scroll() Method
913       /**
914        * scroll(position) -- Scrolls to the given position.
915        * 
916        * id           : integer - position to scroll to.
917        * 
918        * example:
919        *   - self.textbox.scroll(10)
920        */
921       virtual void scroll(long id) throw(UnimplementedException);
922
923 #ifndef SWIG
924       std::string strFont;
925       color_t textColor;
926
927       SWIGHIDDENVIRTUAL CGUIControl* Create() throw (WindowException);
928
929       ControlTextBox() {}
930 #endif
931     };
932
933     // ControlImage class
934     /**
935      * ControlImage class.
936      * 
937      * ControlImage(x, y, width, height, filename[, aspectRatio, colorDiffuse])
938      * 
939      * x              : integer - x coordinate of control.\n
940      * y              : integer - y coordinate of control.\n
941      * width          : integer - width of control.\n
942      * height         : integer - height of control.\n
943      * filename       : string - image filename.\n
944      * aspectRatio    : [opt] integer - (values 0 = stretch (default), 1 = scale up (crops), 2 = scale down (black bar\n
945      * colorDiffuse   : hexString - (example, '0xC0FF0000' (red tint))
946      * 
947      * *Note, You can use the above as keywords for arguments and skip certain optional arguments.\n
948      *        Once you use a keyword, all following arguments require the keyword.\n
949      *        After you create the control, you need to add it to the window with addControl().
950      * 
951      * example:
952      *   - self.image = xbmcgui.ControlImage(100, 250, 125, 75, aspectRatio=2)
953      */
954     class ControlImage : public Control
955     {
956     public:
957       ControlImage(long x, long y, long width, long height, 
958                    const char* filename, long aspectRatio = 0,
959                    const char* colorDiffuse = NULL);
960
961       /**
962        * setImage(filename, useCache) -- Changes the image.
963        * 
964        * filename       : string - image filename.
965        * useCache       : [opt] bool - true/use cache, false/don't use cache
966        * 
967        * example:
968        *   - self.image.setImage('special://home/scripts/test.png')
969        */
970       virtual void setImage(const char* imageFilename, const bool useCache = true) throw (UnimplementedException);
971
972       /**
973        * setColorDiffuse(colorDiffuse) -- Changes the images color.
974        * 
975        * colorDiffuse   : hexString - (example, '0xC0FF0000' (red tint))
976        * 
977        * example:
978        *   - self.image.setColorDiffuse('0xC0FF0000')
979        */
980       virtual void setColorDiffuse(const char* hexString) throw (UnimplementedException);
981
982 #ifndef SWIG
983       ControlImage() :
984         aspectRatio (0)
985       {}
986
987       std::string strFileName;
988       int aspectRatio;
989       color_t colorDiffuse;
990
991       SWIGHIDDENVIRTUAL CGUIControl* Create() throw (WindowException);
992 #endif
993     };
994
995     class ControlProgress : public Control
996     {
997     public:
998       ControlProgress(long x, long y, long width, long height, 
999                       const char* texturebg = NULL,
1000                       const char* textureleft = NULL,
1001                       const char* texturemid = NULL,
1002                       const char* textureright = NULL,
1003                       const char* textureoverlay = NULL);
1004
1005       /**
1006        * setPercent(percent) -- Sets the percentage of the progressbar to show.
1007        * 
1008        * percent       : float - percentage of the bar to show.
1009        * 
1010        * *Note, valid range for percent is 0-100
1011        * 
1012        * example:
1013        *   - self.progress.setPercent(60)
1014        */
1015       virtual void setPercent(float pct) throw (UnimplementedException);
1016
1017       /**
1018        * getPercent() -- Returns a float of the percent of the progress.
1019        * 
1020        * example:
1021        *   - print self.progress.getValue()
1022        */
1023        virtual float getPercent() throw (UnimplementedException);
1024
1025 #ifndef SWIG
1026       std::string strTextureLeft;
1027       std::string strTextureMid;
1028       std::string strTextureRight;
1029       std::string strTextureBg;
1030       std::string strTextureOverlay;
1031       int aspectRatio;
1032       color_t colorDiffuse;
1033
1034       SWIGHIDDENVIRTUAL CGUIControl* Create() throw (WindowException);
1035       ControlProgress() :
1036         aspectRatio (0)
1037       {}
1038 #endif
1039     };
1040
1041     // ControlButton class
1042     /**
1043      * ControlButton class.
1044      * 
1045      * ControlButton(x, y, width, height, label[, focusTexture, noFocusTexture, textOffsetX, textOffsetY,
1046      *               alignment, font, textColor, disabledColor, angle, shadowColor, focusedColor])
1047      * 
1048      * x              : integer - x coordinate of control.\n
1049      * y              : integer - y coordinate of control.\n
1050      * width          : integer - width of control.\n
1051      * height         : integer - height of control.\n
1052      * label          : string or unicode - text string.\n
1053      * focusTexture   : [opt] string - filename for focus texture.\n
1054      * noFocusTexture : [opt] string - filename for no focus texture.\n
1055      * textOffsetX    : [opt] integer - x offset of label.\n
1056      * textOffsetY    : [opt] integer - y offset of label.\n
1057      * alignment      : [opt] integer - alignment of label - *Note, see xbfont.h\n
1058      * font           : [opt] string - font used for label text. (e.g. 'font13')\n
1059      * textColor      : [opt] hexstring - color of enabled button's label. (e.g. '0xFFFFFFFF')\n
1060      * disabledColor  : [opt] hexstring - color of disabled button's label. (e.g. '0xFFFF3300')\n
1061      * angle          : [opt] integer - angle of control. (+ rotates CCW, - rotates CW)\n
1062      * shadowColor    : [opt] hexstring - color of button's label's shadow. (e.g. '0xFF000000')\n
1063      * focusedColor   : [opt] hexstring - color of focused button's label. (e.g. '0xFF00FFFF')
1064      * 
1065      * *Note, You can use the above as keywords for arguments and skip certain optional arguments.\n
1066      *        Once you use a keyword, all following arguments require the keyword.\n
1067      *        After you create the control, you need to add it to the window with addControl().
1068      * 
1069      * example:
1070      *   - self.button = xbmcgui.ControlButton(100, 250, 200, 50, 'Status', font='font14')
1071      */
1072     class ControlButton : public Control
1073     {
1074     public:
1075       ControlButton(long x, long y, long width, long height, const String& label,
1076                     const char* focusTexture = NULL, const char* noFocusTexture = NULL, 
1077                     long textOffsetX = CONTROL_TEXT_OFFSET_X, 
1078                     long textOffsetY = CONTROL_TEXT_OFFSET_Y, 
1079                     long alignment = (XBFONT_LEFT | XBFONT_CENTER_Y), 
1080                     const char* font = NULL, const char* textColor = NULL,
1081                     const char* disabledColor = NULL, long angle = 0,
1082                     const char* shadowColor = NULL, const char* focusedColor = NULL);
1083
1084       // setLabel() Method
1085       /**
1086        * setLabel([label, font, textColor, disabledColor, shadowColor, focusedColor]) -- Set's this buttons text attributes.
1087        * 
1088        * label          : [opt] string or unicode - text string.\n
1089        * font           : [opt] string - font used for label text. (e.g. 'font13')\n
1090        * textColor      : [opt] hexstring - color of enabled button's label. (e.g. '0xFFFFFFFF')\n
1091        * disabledColor  : [opt] hexstring - color of disabled button's label. (e.g. '0xFFFF3300')\n
1092        * shadowColor    : [opt] hexstring - color of button's label's shadow. (e.g. '0xFF000000')\n
1093        * focusedColor   : [opt] hexstring - color of focused button's label. (e.g. '0xFFFFFF00')\n
1094        * label2         : [opt] string or unicode - text string.
1095        * 
1096        * *Note, You can use the above as keywords for arguments and skip certain optional arguments.\n
1097        *        Once you use a keyword, all following arguments require the keyword.
1098        * 
1099        * example:
1100        *   - self.button.setLabel('Status', 'font14', '0xFFFFFFFF', '0xFFFF3300', '0xFF000000')
1101        */
1102       virtual void setLabel(const String& label = emptyString, 
1103                             const char* font = NULL,
1104                             const char* textColor = NULL,
1105                             const char* disabledColor = NULL,
1106                             const char* shadowColor = NULL,
1107                             const char* focusedColor = NULL,
1108                             const String& label2 = emptyString) throw (UnimplementedException);
1109
1110       // setDisabledColor() Method
1111       /**
1112        * setDisabledColor(disabledColor) -- Set's this buttons disabled color.
1113        * 
1114        * disabledColor  : hexstring - color of disabled button's label. (e.g. '0xFFFF3300')
1115        * 
1116        * example:
1117        *   - self.button.setDisabledColor('0xFFFF3300')
1118        */
1119       virtual void setDisabledColor(const char* color) throw (UnimplementedException);
1120
1121       // getLabel() Method
1122       /**
1123        * getLabel() -- Returns the buttons label as a unicode string.
1124        * 
1125        * example:
1126        *   - label = self.button.getLabel()
1127        */
1128       virtual String getLabel() throw (UnimplementedException);
1129
1130       // getLabel2() Method
1131       /**
1132        * getLabel2() -- Returns the buttons label2 as a unicode string.
1133        * 
1134        * example:
1135        *   - label = self.button.getLabel2()
1136        */
1137       virtual String getLabel2() throw (UnimplementedException);
1138 #ifndef SWIG
1139       SWIGHIDDENVIRTUAL bool canAcceptMessages(int actionId) { return true; }
1140
1141       int textOffsetX;
1142       int textOffsetY;
1143       color_t align;
1144       std::string strFont;
1145       color_t textColor;
1146       color_t disabledColor;
1147       int iAngle;
1148       int shadowColor;
1149       int focusedColor;
1150       std::string strText;
1151       std::string strText2;
1152       std::string strTextureFocus;
1153       std::string strTextureNoFocus;
1154
1155       SWIGHIDDENVIRTUAL CGUIControl* Create() throw (WindowException);
1156
1157       ControlButton() :
1158         textOffsetX (0),
1159         textOffsetY (0),
1160         iAngle      (0),
1161         shadowColor (0),
1162         focusedColor(0)
1163       {}
1164 #endif
1165     };
1166
1167     // ControlCheckMark class
1168     /**
1169      * ControlCheckMark class.
1170      * 
1171      * ControlCheckMark(x, y, width, height, label[, focusTexture, noFocusTexture,
1172      *                  checkWidth, checkHeight, alignment, font, textColor, disabledColor])
1173      * 
1174      * x              : integer - x coordinate of control.\n
1175      * y              : integer - y coordinate of control.\n
1176      * width          : integer - width of control.\n
1177      * height         : integer - height of control.\n
1178      * label          : string or unicode - text string.\n
1179      * focusTexture   : [opt] string - filename for focus texture.\n
1180      * noFocusTexture : [opt] string - filename for no focus texture.\n
1181      * checkWidth     : [opt] integer - width of checkmark.\n
1182      * checkHeight    : [opt] integer - height of checkmark.\n
1183      * alignment      : [opt] integer - alignment of label - *Note, see xbfont.h\n
1184      * font           : [opt] string - font used for label text. (e.g. 'font13')\n
1185      * textColor      : [opt] hexstring - color of enabled checkmark's label. (e.g. '0xFFFFFFFF')\n
1186      * disabledColor  : [opt] hexstring - color of disabled checkmark's label. (e.g. '0xFFFF3300')
1187      * 
1188      * *Note, You can use the above as keywords for arguments and skip certain optional arguments.\n
1189      *        Once you use a keyword, all following arguments require the keyword.\n
1190      *        After you create the control, you need to add it to the window with addControl().
1191      * 
1192      * example:
1193      *   - self.checkmark = xbmcgui.ControlCheckMark(100, 250, 200, 50, 'Status', font='font14')
1194      */
1195     class ControlCheckMark : public Control
1196     {
1197     public:
1198
1199       ControlCheckMark(long x, long y, long width, long height, const String& label,
1200                        const char* focusTexture = NULL, const char* noFocusTexture = NULL, 
1201                        long checkWidth = 30, long checkHeight = 30,
1202                        long _alignment = XBFONT_RIGHT, const char* font = NULL, 
1203                        const char* textColor = NULL, const char* disabledColor = NULL);
1204
1205       // getSelected() Method
1206       /**
1207        * getSelected() -- Returns the selected status for this checkmark as a bool.
1208        * 
1209        * example:
1210        *   - selected = self.checkmark.getSelected()
1211        */
1212       virtual bool getSelected() throw (UnimplementedException);
1213
1214       // setSelected() Method
1215       /**
1216        * setSelected(isOn) -- Sets this checkmark status to on or off.
1217        * 
1218        * isOn           : bool - True=selected (on) / False=not selected (off)
1219        * 
1220        * example:
1221        *   - self.checkmark.setSelected(True)
1222        */
1223       virtual void setSelected(bool selected) throw (UnimplementedException);
1224
1225       // setLabel() Method
1226       /**
1227        * setLabel(label[, font, textColor, disabledColor]) -- Set's this controls text attributes.
1228        * 
1229        * label          : string or unicode - text string.\n
1230        * font           : [opt] string - font used for label text. (e.g. 'font13')\n
1231        * textColor      : [opt] hexstring - color of enabled checkmark's label. (e.g. '0xFFFFFFFF')\n
1232        * disabledColor  : [opt] hexstring - color of disabled checkmark's label. (e.g. '0xFFFF3300')
1233        * 
1234        * example:
1235        *   - self.checkmark.setLabel('Status', 'font14', '0xFFFFFFFF', '0xFFFF3300')
1236        */
1237       virtual void setLabel(const String& label = emptyString, 
1238                             const char* font = NULL,
1239                             const char* textColor = NULL,
1240                             const char* disabledColor = NULL,
1241                             const char* shadowColor = NULL,
1242                             const char* focusedColor = NULL,
1243                             const String& label2 = emptyString) throw (UnimplementedException);
1244
1245       // setDisabledColor() Method
1246       /**
1247        * setDisabledColor(disabledColor) -- Set's this controls disabled color.
1248        * 
1249        * disabledColor  : hexstring - color of disabled checkmark's label. (e.g. '0xFFFF3300')
1250        * 
1251        * example:
1252        *   - self.checkmark.setDisabledColor('0xFFFF3300')
1253        */
1254       virtual void setDisabledColor(const char* color) throw (UnimplementedException);
1255
1256 #ifndef SWIG
1257       SWIGHIDDENVIRTUAL bool canAcceptMessages(int actionId) { return true; }
1258
1259       std::string strFont;
1260       int checkWidth;
1261       int checkHeight;
1262       uint32_t align;
1263       color_t textColor;
1264       color_t disabledColor;
1265       std::string strTextureFocus;
1266       std::string strTextureNoFocus;
1267       std::string strText;
1268
1269       SWIGHIDDENVIRTUAL CGUIControl* Create() throw (WindowException);
1270
1271       ControlCheckMark() :
1272         checkWidth  (0),
1273         checkHeight (0)
1274       {}
1275 #endif
1276     };
1277
1278     // ControlGroup class
1279     /**
1280      * ControlGroup class.
1281      * 
1282      * ControlGroup(x, y, width, height
1283      * 
1284      * x              : integer - x coordinate of control.\n
1285      * y              : integer - y coordinate of control.\n
1286      * width          : integer - width of control.\n
1287      * height         : integer - height of control.
1288      * example:
1289      *   - self.group = xbmcgui.ControlGroup(100, 250, 125, 75)
1290      */
1291     class ControlGroup : public Control 
1292     {
1293     public:
1294       ControlGroup(long x, long y, long width, long height);
1295
1296 #ifndef SWIG
1297       SWIGHIDDENVIRTUAL CGUIControl* Create() throw (WindowException);
1298
1299       inline ControlGroup() {}
1300 #endif
1301     };
1302
1303     // ControlRadioButton class
1304     /**
1305      * ControlRadioButton class.
1306      * 
1307      * ControlRadioButton(x, y, width, height, label[, focusOnTexture, noFocusOnTexture,\n
1308      *                   focusOffTexture, noFocusOffTexture, focusTexture, noFocusTexture,\n
1309      *                   textOffsetX, textOffsetY, alignment, font, textColor, disabledColor])
1310      * 
1311      * x                 : integer - x coordinate of control.\n
1312      * y                 : integer - y coordinate of control.\n
1313      * width             : integer - width of control.\n
1314      * height            : integer - height of control.\n
1315      * label             : string or unicode - text string.\n
1316      * focusOnTexture    : [opt] string - filename for radio ON focused texture.\n
1317      * noFocusOnTexture  : [opt] string - filename for radio ON not focused texture.\n
1318      * focusOfTexture    : [opt] string - filename for radio OFF focused texture.\n
1319      * noFocusOffTexture : [opt] string - filename for radio OFF not focused texture.\n
1320      * focusTexture      : [opt] string - filename for radio ON texture (deprecated, use focusOnTexture and noFocusOnTexture).\n
1321      * noFocusTexture    : [opt] string - filename for radio OFF texture (deprecated, use focusOffTexture and noFocusOffTexture).\n
1322      * textOffsetX       : [opt] integer - horizontal text offset\n
1323      * textOffsetY       : [opt] integer - vertical text offset\n
1324      * alignment         : [opt] integer - alignment of label - *Note, see xbfont.h\n
1325      * font              : [opt] string - font used for label text. (e.g. 'font13')\n
1326      * textColor         : [opt] hexstring - color of enabled checkmark's label. (e.g. '0xFFFFFFFF')\n
1327      * disabledColor     : [opt] hexstring - color of disabled checkmark's label. (e.g. '0xFFFF3300')
1328      * 
1329      * *Note, You can use the above as keywords for arguments and skip certain optional arguments.\n
1330      *        Once you use a keyword, all following arguments require the keyword.\n
1331      *        After you create the control, you need to add it to the window with addControl().
1332      * 
1333      * example:
1334      *   - self.radiobutton = xbmcgui.ControlRadioButton(100, 250, 200, 50, 'Enable', font='font14')
1335      */
1336     class ControlRadioButton : public Control
1337     {
1338     public:
1339       ControlRadioButton(long x, long y, long width, long height, const String& label,
1340                          const char* focusOnTexture = NULL, const char* noFocusOnTexture = NULL,
1341                          const char* focusOffTexture = NULL, const char* noFocusOffTexture = NULL,
1342                          const char* focusTexture = NULL, const char* noFocusTexture = NULL, 
1343                          long textOffsetX = CONTROL_TEXT_OFFSET_X, 
1344                          long textOffsetY = CONTROL_TEXT_OFFSET_Y, 
1345                          long _alignment = (XBFONT_LEFT | XBFONT_CENTER_Y), 
1346                          const char* font = NULL, const char* textColor = NULL,
1347                          const char* disabledColor = NULL, long angle = 0,
1348                          const char* shadowColor = NULL, const char* focusedColor = NULL);
1349
1350       // setSelected() Method
1351       /**
1352        * setSelected(selected) -- Sets the radio buttons's selected status.
1353        * 
1354        * selected            : bool - True=selected (on) / False=not selected (off)
1355        * 
1356        * *Note, You can use the above as keywords for arguments and skip certain optional arguments.\n
1357        *        Once you use a keyword, all following arguments require the keyword.
1358        * 
1359        * example:
1360        *   - self.radiobutton.setSelected(True)
1361        */
1362       virtual void setSelected(bool selected) throw (UnimplementedException);
1363
1364       // isSelected() Method
1365       /**
1366        * isSelected() -- Returns the radio buttons's selected status.
1367        * 
1368        * example:
1369        *   - is = self.radiobutton.isSelected()
1370        */
1371       virtual bool isSelected() throw (UnimplementedException);
1372
1373       // setLabel() Method
1374       /**
1375        * setLabel(label[, font, textColor, disabledColor, shadowColor, focusedColor]) -- Set's the radio buttons text attributes.
1376        * 
1377        * label          : string or unicode - text string.\n
1378        * font           : [opt] string - font used for label text. (e.g. 'font13')\n
1379        * textColor      : [opt] hexstring - color of enabled radio button's label. (e.g. '0xFFFFFFFF')\n
1380        * disabledColor  : [opt] hexstring - color of disabled radio button's label. (e.g. '0xFFFF3300')\n
1381        * shadowColor    : [opt] hexstring - color of radio button's label's shadow. (e.g. '0xFF000000')\n
1382        * focusedColor   : [opt] hexstring - color of focused radio button's label. (e.g. '0xFFFFFF00')
1383        * 
1384        * *Note, You can use the above as keywords for arguments and skip certain optional arguments.\n
1385        *        Once you use a keyword, all following arguments require the keyword.
1386        * 
1387        * example:
1388        *   - self.radiobutton.setLabel('Status', 'font14', '0xFFFFFFFF', '0xFFFF3300', '0xFF000000')
1389        */
1390       virtual void setLabel(const String& label = emptyString, 
1391                             const char* font = NULL,
1392                             const char* textColor = NULL,
1393                             const char* disabledColor = NULL,
1394                             const char* shadowColor = NULL,
1395                             const char* focusedColor = NULL,
1396                             const String& label2 = emptyString) throw (UnimplementedException);
1397
1398       // setRadioDimension() Method
1399       /**
1400        * setRadioDimension(x, y, width, height) -- Sets the radio buttons's radio texture's position and size.
1401        * 
1402        * x                   : integer - x coordinate of radio texture.\n
1403        * y                   : integer - y coordinate of radio texture.\n
1404        * width               : integer - width of radio texture.\n
1405        * height              : integer - height of radio texture.
1406        * 
1407        * *Note, You can use the above as keywords for arguments and skip certain optional arguments.\n
1408        *        Once you use a keyword, all following arguments require the keyword.
1409        * 
1410        * example:
1411        *   - self.radiobutton.setRadioDimension(x=100, y=5, width=20, height=20)
1412        */
1413       virtual void setRadioDimension(long x, long y, long width, long height) throw (UnimplementedException);
1414
1415 #ifndef SWIG
1416       SWIGHIDDENVIRTUAL bool canAcceptMessages(int actionId) { return true; }
1417
1418       std::string strFont;
1419       std::string strText;
1420       std::string strTextureFocus;
1421       std::string strTextureNoFocus;
1422       std::string strTextureRadioOnFocus;
1423       std::string strTextureRadioOnNoFocus;
1424       std::string strTextureRadioOffFocus;
1425       std::string strTextureRadioOffNoFocus;
1426       color_t textColor;
1427       color_t disabledColor;
1428       int textOffsetX;
1429       int textOffsetY; 
1430      uint32_t align;
1431       int iAngle;
1432       color_t shadowColor;
1433       color_t focusedColor;
1434
1435       SWIGHIDDENVIRTUAL CGUIControl* Create() throw (WindowException);
1436
1437       ControlRadioButton() :
1438         textOffsetX (0),
1439         textOffsetY (0),
1440         iAngle      (0)
1441       {}
1442 #endif
1443     };
1444         
1445     /**
1446      * ControlSlider class.
1447      * 
1448      * ControlSlider(x, y, width, height[, textureback, texture, texturefocus])
1449      * 
1450      * x              : integer - x coordinate of control.\n
1451      * y              : integer - y coordinate of control.\n
1452      * width          : integer - width of control.\n
1453      * height         : integer - height of control.\n
1454      * textureback    : [opt] string - image filename.\n
1455      * texture        : [opt] string - image filename.\n
1456      * texturefocus   : [opt] string - image filename.n"
1457      *
1458      * *Note, You can use the above as keywords for arguments and skip certain optional arguments.\n
1459      *        Once you use a keyword, all following arguments require the keyword.\n
1460      *        After you create the control, you need to add it to the window with addControl().
1461      * 
1462      * example:
1463      *   - self.slider = xbmcgui.ControlSlider(100, 250, 350, 40)
1464      */
1465     class ControlSlider : public Control
1466     {
1467     public:
1468       ControlSlider(long x, long y, long width, long height, 
1469                     const char* textureback = NULL, 
1470                     const char* texture = NULL,
1471                     const char* texturefocus = NULL);
1472
1473       /**
1474        * getPercent() -- Returns a float of the percent of the slider.
1475        * 
1476        * example:
1477        *   - print self.slider.getPercent()
1478        */
1479       virtual float getPercent() throw (UnimplementedException);
1480
1481       /**
1482        * setPercent(50) -- Sets the percent of the slider.
1483        * 
1484        * example:
1485        *   - self.slider.setPercent(50)
1486        */
1487       virtual void setPercent(float pct) throw (UnimplementedException);
1488
1489 #ifndef SWIG
1490       std::string strTextureBack;
1491       std::string strTexture;
1492       std::string strTextureFoc;    
1493
1494       SWIGHIDDENVIRTUAL CGUIControl* Create() throw (WindowException);
1495
1496       inline ControlSlider() {}
1497 #endif
1498     };
1499   }
1500 }
1501