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