copyinternal.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. #ifndef NULLOSFT_MEDIALIBRARY_MLDISC_COPYFILES_INTERNAL_HEADER
  2. #define NULLOSFT_MEDIALIBRARY_MLDISC_COPYFILES_INTERNAL_HEADER
  3. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  4. #pragma once
  5. #endif
  6. #include <windows.h>
  7. #include "../Agave/Metadata/api_metadata.h"
  8. #include "../ml_local/api_mldb.h"
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. #define STRCOMP_INVARIANT MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US), SORT_DEFAULT)
  13. #define CPM_UPDATEDISKSIZE (WM_APP + 2)
  14. typedef struct _COPYDATA
  15. {
  16. LONG ref;
  17. HWND hDialog;
  18. HWND hOwner;
  19. HANDLE hThread;
  20. BOOL bCancel;
  21. DWORD errorCode;
  22. UINT errorMsgId;
  23. LPWSTR *ppszFiles;
  24. ULONGLONG *pFSizes;
  25. INT count;
  26. UINT uFlags;
  27. api_metadata *pMetaReader;
  28. api_mldb *pMlDb;
  29. WCHAR szDestination[MAX_PATH];
  30. WCHAR szTitleFormat[128];
  31. } COPYDATA;
  32. #define FCF_ADDTOMLDB 0x00000002L
  33. #define FCF_USETITLEFMT 0x00000004L
  34. #define FCF_SKIPFILE 0x00010000L
  35. #define FCF_OVERWRITEFILE 0x00020000L
  36. #define FCF_DELETEREADONLY 0x00040000L
  37. INT_PTR CALLBACK CopyPrepare_DialogProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  38. INT_PTR CALLBACK CopyProgress_DialogProc(HWND hdlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
  39. LONG CopyFiles_AddRef(COPYDATA *pcd);
  40. LONG CopyFiles_Release(COPYDATA *pcd);
  41. BOOL CopyFiles_StartCopy(COPYDATA *pcd);
  42. BOOL CopyFiles_CancelCopy(COPYDATA *pcd);
  43. BOOL CopyFiles_CreateDirectory(LPCTSTR pszDirectory);
  44. BOOL CopyFiles_FormatFileName(LPTSTR pszNewFileName, INT cchBufferMax, LPCTSTR pszFileToRename, LPCTSTR pszOrigFileName, LPCTSTR pszDestination, LPCTSTR pszFormat, api_metadata *pMetaReader);
  45. HBITMAP CopyFiles_LoadResourcePng(LPCTSTR pszResource);
  46. #define CFM_NOTIFY (WM_APP + 3)
  47. // notify task
  48. #define CFT_INITIALIZING 0x0001
  49. #define CFT_COPYING 0x0002
  50. #define CFT_FINISHED 0x0003
  51. #define CFT_CONFLICT 0x0004 // conflicts always use SendMessage
  52. // init task operations code
  53. #define CFO_INIT 0x0000
  54. #define CFO_CACLSIZE 0x0001
  55. #define CFO_CHECKDESTINATION 0x0002
  56. // copy task operations code
  57. #define CFO_INIT 0x0000 // time to set tast text
  58. #define CFO_NEXTFILE 0x0001 // lParam - MAKELPARAM(file index, total count)
  59. #define CFO_PROGRESS 0x0002 // lParam - percent
  60. #define CFO_POSTCOPY 0x0003
  61. // conflicts
  62. #define EXISTFILE_CANCELCOPY 0x0001 // almost like return FALSE but will not produce error
  63. #define EXISTFILE_SKIP 0x0002 // skip
  64. #define EXISTFILE_OVERWRITE 0x0003 // overwrite
  65. #define EXISTFILE_APPLY_ONCE 0x0000 // apply only once
  66. #define EXISTFILE_APPLY_TO_ALL 0x0100 // apply to all files with the same conflict
  67. #define READONLY_CANCELCOPY 0x0001
  68. #define READONLY_DELETE 0x0002
  69. #define READONLY_DELETEALL 0x0003
  70. typedef struct _FILECONFLICT
  71. {
  72. LPCTSTR pszNameExisting;
  73. LPCTSTR pszNameNew;
  74. } FILECONFLICT;
  75. #define CFO_DESTNOTEXIST 0x0000 // return FALSE to create destination or TRUE to cancel copy operation. param -pszDestionation
  76. #define CFO_FILEALREDYEXIST 0x0001 // return FALSE to fail with access denied, or EXISTFILE_XXX, param = (FILECONFLICT*)
  77. #define CFO_READONLY 0x0002 // return FALSE to fail, or RADONLY_XXX, param = (LPCTSTR)pszFileName
  78. // finished task operations code
  79. #define CFO_FAILED 0x0001
  80. #define CFO_SUCCESS 0x0002
  81. #define CFO_CANCELLED 0x0003
  82. #ifdef __cplusplus
  83. }
  84. #endif
  85. #endif // NULLOSFT_MEDIALIBRARY_MLDISC_COPYFILES_INTERNAL_HEADER