xuidownloadslist.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. #ifndef __THEMESLIST_H
  2. #define __THEMESLIST_H
  3. #include "api/wnd/wndclass/listwnd.h"
  4. #include "main.h"
  5. //#include "../Components/wac_downloads/wac_downloads_download_manager.h"
  6. #include "../../../../Components/wac_network/wac_network_http_receiver_api.h"
  7. #include "../nu/AutoWide.h"
  8. #include "api/script/objects/systemobj.h"
  9. #define DOWNLOADSLIST_PARENT ListWnd
  10. // -----------------------------------------------------------------------
  11. class DownloadsList : public DOWNLOADSLIST_PARENT
  12. {
  13. public:
  14. DownloadsList();
  15. virtual ~DownloadsList();
  16. virtual int onInit();
  17. virtual void onDoubleClick(int itemnum);
  18. virtual int onPaint(Canvas *canvas);
  19. virtual int onRightClick(int itemnum);
  20. virtual int onColumnDblClick(int col, int x, int y);
  21. virtual int onColumnLabelClick(int col, int x, int y);
  22. virtual int onAction(const wchar_t *action, const wchar_t *param, int x, int y, intptr_t p1, intptr_t p2, void *data, size_t datalen, ifc_window *source);
  23. virtual int onResize();
  24. virtual int wantResizeCols() { return 0; }
  25. virtual int setXuiParam(int _xuihandle, int xmlattrid, const wchar_t *name, const wchar_t *value);
  26. virtual int wantHScroll() { return !nohscroll; }
  27. // virtual int getTextBold(LPARAM lParam);
  28. virtual void onSetVisible(int show);
  29. // Callbacks from MediaDownloader
  30. static void onDownloadStart(const char *url, DownloadToken token);
  31. static void onDownloadTick(DownloadToken token);
  32. static void onDownloadEnd(DownloadToken token, const wchar_t * filename);
  33. static void onDownloadError(DownloadToken token, int code);
  34. static void onDownloadCancel(DownloadToken token);
  35. enum {
  36. CTLIST_NOHSCROLL = 0,
  37. };
  38. protected:
  39. /*static */void CreateXMLParameters(int master_handle);
  40. private:
  41. static XMLParamPair params[];
  42. int xuihandle;
  43. int nohscroll;
  44. int ensure_on_paint;
  45. void newItem(int status, DownloadToken token);
  46. static PtrList<void> activeDownloads;
  47. static PtrList<DownloadsList> skinObjects;
  48. enum DOWNLOAD_STATUS
  49. {
  50. STATUS_WAITING = 0,
  51. STATUS_TRANSFERRING = 1,
  52. STATUS_FINISHED = 2,
  53. STATUS_ERROR = -1,
  54. STATUS_CANCEL = -2,
  55. };
  56. };
  57. // -----------------------------------------------------------------------
  58. extern const wchar_t DownloadsListXuiObjectStr[];
  59. extern char DownloadsListXuiSvcName[];
  60. class DownloadsListXuiSvc : public XuiObjectSvc<DownloadsList, DownloadsListXuiObjectStr, DownloadsListXuiSvcName> {};
  61. #endif