grouplist.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. //PORTABLE
  2. #ifndef _GROUPLIST_H
  3. #define _GROUPLIST_H
  4. #include <api/script/objects/guiobj.h>
  5. #include <api/wnd/wndclass/guiobjwnd.h>
  6. #include <bfc/ptrlist.h>
  7. // {01E28CE1-B059-11d5-979F-E4DE6F51760A}
  8. static const GUID grouplistGuid =
  9. { 0x1e28ce1, 0xb059, 0x11d5, { 0x97, 0x9f, 0xe4, 0xde, 0x6f, 0x51, 0x76, 0xa } };
  10. #define GROUPLIST_PARENT GuiObjectWnd
  11. class GroupListScriptController: public GuiObjectScriptController {
  12. public:
  13. virtual const wchar_t *getClassName();
  14. virtual const wchar_t *getAncestorClassName();
  15. virtual ScriptObjectController *getAncestorController() { return guiController; }
  16. virtual int getNumFunctions();
  17. virtual const function_descriptor_struct *getExportedFunctions();
  18. virtual GUID getClassGuid();
  19. virtual ScriptObject *instantiate();
  20. virtual void destroy(ScriptObject *o);
  21. virtual void *encapsulate(ScriptObject *o);
  22. virtual void deencapsulate(void *o);
  23. private:
  24. static function_descriptor_struct exportedFunction[];
  25. };
  26. extern GroupListScriptController *grouplistController;
  27. class GroupList : public GROUPLIST_PARENT {
  28. public:
  29. GroupList();
  30. virtual ~GroupList();
  31. Group *instantiate(const wchar_t *id, int n);
  32. void removeAll();
  33. Group *enumItem(int n);
  34. int getNumItems();
  35. void scrollToPercent(int p);
  36. void scrollTo(int y);
  37. void setRedraw(int i);
  38. void reposChildren();
  39. virtual int onResize();
  40. virtual int getPreferences(int what);
  41. private:
  42. void insert(const wchar_t *id, int where);
  43. public:
  44. static scriptVar script_vcpu_instantiate(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar id, scriptVar n);
  45. static scriptVar script_vcpu_getNumItems(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  46. static scriptVar script_vcpu_enumItem(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar n);
  47. static scriptVar script_vcpu_removeAll(SCRIPT_FUNCTION_PARAMS, ScriptObject *o);
  48. static scriptVar script_vcpu_scrollToPercent(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar n);
  49. static scriptVar script_vcpu_setRedraw(SCRIPT_FUNCTION_PARAMS, ScriptObject *o, scriptVar n);
  50. PtrList<Group> groups;
  51. int scrollY;
  52. int maxheight;
  53. int maxwidth;
  54. int redraw;
  55. };
  56. extern const wchar_t groupListXuiObjectStr[];
  57. extern char groupListXuiSvcName[];
  58. class GroupListXuiSvc : public XuiObjectSvc<GroupList, groupListXuiObjectStr, groupListXuiSvcName> {};
  59. #endif