1
0

wa2pledit.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. #ifndef _WA2PLEDIT_H
  2. #define _WA2PLEDIT_H
  3. #include <api/wnd/wndclass/listwnd.h>
  4. #include "wa2playlist.h"
  5. #define WA2PLAYLISTEDITOR_PARENT ListWnd
  6. class Wa2PlaylistEditor;
  7. class Wa2PlaylistEditor : public WA2PLAYLISTEDITOR_PARENT
  8. {
  9. public:
  10. static GUID getInterfaceGuid()
  11. {
  12. // {265947B2-3EDB-453e-B748-EC17890F4FE4}
  13. const GUID guid =
  14. { 0x265947b2, 0x3edb, 0x453e, { 0xb7, 0x48, 0xec, 0x17, 0x89, 0xf, 0x4f, 0xe4 } };
  15. return guid;
  16. }
  17. Wa2PlaylistEditor();
  18. virtual ~Wa2PlaylistEditor();
  19. virtual int onInit();
  20. virtual int onResize();
  21. virtual int wantHScroll() { return 0; }
  22. virtual void onVScrollToggle( int set );
  23. virtual COLORREF getTextColor( LPARAM lParam );
  24. virtual COLORREF getBgColor( LPARAM lParam );
  25. virtual void *getInterface( GUID interface_guid );
  26. virtual void setPlaylist( Wa2Playlist *playlist ); // -1 for working playlist
  27. virtual int needFocusRect( LPARAM lParam );
  28. virtual COLORREF getFocusRectColor( LPARAM lParam );
  29. virtual void onSetVisible( int show );
  30. virtual int onDeferredCallback( intptr_t p1, intptr_t p2 );
  31. virtual void timerCallback( int id );
  32. virtual void onDoubleClick( int itemnum );
  33. // object
  34. virtual void onNewCurrentIndex( int idx );
  35. virtual void onPlaylistModified();
  36. // class
  37. static void _onNewCurrentIndex( int idx );
  38. static void _onPlaylistModified();
  39. virtual void loadList();
  40. private:
  41. void _loadList();
  42. void resizeCols();
  43. int calcTrackNumWidth();
  44. Wa2Playlist *curplaylist;
  45. static PtrList<Wa2PlaylistEditor> editors;
  46. int cur_index;
  47. };
  48. // -----------------------------------------------------------------------
  49. extern const wchar_t Wa2PleditXuiObjectStr[];
  50. extern char Wa2PleditXuiSvcName[];
  51. class Wa2PleditXuiSvc : public XuiObjectSvc<Wa2PlaylistEditor, Wa2PleditXuiObjectStr, Wa2PleditXuiSvcName> {};
  52. #endif