Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

224 lines
6.1 KiB

  1. //
  2. // recact.h: Declares data, defines and struct types for RecAct
  3. // module.
  4. //
  5. //
  6. #ifndef __RECACT_H__
  7. #define __RECACT_H__
  8. ///////////////////////////////////////////////////// INCLUDES
  9. ///////////////////////////////////////////////////// DEFINES
  10. // RecAct message ranges
  11. //
  12. #define RAM_FIRST (WM_USER+1)
  13. #define RAM_LAST (WM_USER+20)
  14. #define RN_FIRST (0U-700U)
  15. #define RN_LAST (0U-799U)
  16. // Window class name
  17. //
  18. #define WC_RECACT TEXT("RecAction")
  19. // BOOL RecAct_Enable(HWND hwnd, BOOL fEnable);
  20. //
  21. #define RecAct_Enable(hwnd, fEnable) \
  22. EnableWindow((hwnd), (fEnable))
  23. // int RecAct_GetItemCount(HWND hwnd);
  24. //
  25. #define RAM_GETITEMCOUNT (RAM_FIRST + 0)
  26. #define RecAct_GetItemCount(hwnd) \
  27. (int)SendMessage(hwnd, RAM_GETITEMCOUNT, 0, 0L)
  28. // Side item structure
  29. //
  30. #define SI_UNCHANGED 0
  31. #define SI_CHANGED 1
  32. #define SI_NEW 2
  33. #define SI_NOEXIST 3
  34. #define SI_UNAVAILABLE 4
  35. #define SI_DELETED 5
  36. typedef struct tagSIDE_ITEM
  37. {
  38. LPTSTR pszDir;
  39. UINT uState; // One of SI_* flags
  40. FILESTAMP fs;
  41. UINT ichRealPath; // index to beginning of real path
  42. } SIDEITEM, * LPSIDEITEM;
  43. // RecAction Item structure
  44. //
  45. #define RAIF_ACTION 0x0001 // Mask codes
  46. #define RAIF_NAME 0x0002
  47. #define RAIF_STYLE 0x0004
  48. #define RAIF_INSIDE 0x0008
  49. #define RAIF_OUTSIDE 0x0010
  50. #define RAIF_LPARAM 0x0020
  51. #define RAIF_HTWIN 0x0040
  52. #define RAIF_ALL 0x007f
  53. typedef struct tagRA_ITEM
  54. {
  55. UINT mask; // One of RAIF_
  56. int iItem;
  57. UINT uStyle; // One of RAIS_
  58. UINT uAction; // One of RAIA_
  59. LPTSTR pszName;
  60. SIDEITEM siInside;
  61. SIDEITEM siOutside;
  62. LPARAM lParam;
  63. HTWIN htwin;
  64. } RA_ITEM, * LPRA_ITEM;
  65. // RecAct item styles
  66. //
  67. #define RAIS_CANMERGE 0x0001
  68. #define RAIS_FOLDER 0x0002
  69. // RecAct actions
  70. //
  71. #define RAIA_TOOUT 0 // Don't change these values without changing
  72. #define RAIA_TOIN 1 // the order of the bitmaps in s_rgidAction
  73. #define RAIA_SKIP 2
  74. #define RAIA_CONFLICT 3
  75. #define RAIA_MERGE 4
  76. #define RAIA_SOMETHING 5 // These two require RAIS_FOLDER
  77. #define RAIA_NOTHING 6
  78. #define RAIA_ORPHAN 7
  79. #define RAIA_DELETEOUT 8
  80. #define RAIA_DELETEIN 9
  81. #define RAIA_DONTDELETE 10
  82. // Insert item at specified index. Item is inserted at end if
  83. // i is greater than or equal to the number of items in the twinview.
  84. // Returns the index of the inserted item, or -1 on error.
  85. //
  86. // int RecAct_InsertItem(HWND hwnd, const LPRA_ITEM pitem);
  87. //
  88. #define RAM_INSERTITEM (RAM_FIRST + 1)
  89. #define RecAct_InsertItem(hwnd, pitem) \
  90. (int)SendMessage((hwnd), RAM_INSERTITEM, 0, (LPARAM)(const LPRA_ITEM)(pitem))
  91. // Delete an item at the specified index.
  92. //
  93. // int RecAct_DeleteItem(HWND hwnd, int i);
  94. //
  95. #define RAM_DELETEITEM (RAM_FIRST + 2)
  96. #define RecAct_DeleteItem(hwnd, i) \
  97. (int)SendMessage((hwnd), RAM_DELETEITEM, (WPARAM)(int)(i), 0L)
  98. // Deletes all items in the control
  99. //
  100. // BOOL RecAct_DeleteAllItems(HWND hwnd);
  101. //
  102. #define RAM_DELETEALLITEMS (RAM_FIRST + 3)
  103. #define RecAct_DeleteAllItems(hwnd) \
  104. (BOOL)SendMessage((hwnd), RAM_DELETEALLITEMS, 0, 0L)
  105. // BOOL RecAct_GetItem(HWND hwnd, LPRA_ITEM pitem);
  106. //
  107. #define RAM_GETITEM (RAM_FIRST + 4)
  108. #define RecAct_GetItem(hwnd, pitem) \
  109. (BOOL)SendMessage((hwnd), RAM_GETITEM, 0, (LPARAM)(LPRA_ITEM)(pitem))
  110. // BOOL RecAct_SetItem(HWND hwnd, const LPRA_ITEM pitem);
  111. //
  112. #define RAM_SETITEM (RAM_FIRST + 5)
  113. #define RecAct_SetItem(hwnd, pitem) \
  114. (BOOL)SendMessage((hwnd), RAM_SETITEM, 0, (LPARAM)(const LPRA_ITEM)(pitem))
  115. // Get the current selection by index. -1 if nothing is selected.
  116. //
  117. // int RecAct_GetCurSel(HWND hwnd);
  118. //
  119. #define RAM_GETCURSEL (RAM_FIRST + 6)
  120. #define RecAct_GetCurSel(hwnd) \
  121. (int)SendMessage((hwnd), RAM_GETCURSEL, (WPARAM)0, 0L)
  122. // Set the current selection by index. -1 to deselect.
  123. //
  124. // int RecAct_SetCurSel(HWND hwnd, int i);
  125. //
  126. #define RAM_SETCURSEL (RAM_FIRST + 7)
  127. #define RecAct_SetCurSel(hwnd, i) \
  128. (int)SendMessage((hwnd), RAM_SETCURSEL, (WPARAM)(i), 0L)
  129. // RecAct_FindItem flags
  130. //
  131. #define RAFI_NAME 0x0001
  132. #define RAFI_LPARAM 0x0002
  133. #define RAFI_ACTION 0x0004
  134. typedef struct tagRA_FINDITEM
  135. {
  136. UINT flags; // One of RAFI_* flags
  137. UINT uAction; // One of RAIA_* flags
  138. LPCTSTR psz;
  139. LPARAM lParam;
  140. } RA_FINDITEM;
  141. // Find an item according to RA_FINDITEM struct. iStart = -1 to
  142. // start at beginning.
  143. //
  144. // int RecAct_FindItem(HWND hwnd, int iStart, const RA_FINDITEM FAR* prafi);
  145. #define RAM_FINDITEM (RAM_FIRST + 8)
  146. #define RecAct_FindItem(hwnd, iStart, prafi) \
  147. (int)SendMessage((hwnd), RAM_FINDITEM, (WPARAM)(int)(iStart), (LPARAM)(const RA_FINDINFO *)(prafi))
  148. // Refresh the control.
  149. //
  150. // void RecAct_Refresh(HWND hwnd);
  151. #define RAM_REFRESH (RAM_FIRST + 9)
  152. #define RecAct_Refresh(hwnd) \
  153. SendMessage((hwnd), RAM_REFRESH, 0, 0L)
  154. // Notification codes
  155. //
  156. #define RN_SELCHANGED (RN_FIRST-0)
  157. #define RN_ITEMCHANGED (RN_FIRST-1)
  158. typedef struct tagNM_RECACT
  159. {
  160. NMHDR hdr;
  161. int iItem;
  162. UINT mask; // One of RAIF_*
  163. UINT uAction; // One of RAIA_*
  164. UINT uActionOld; // One of RAIA_*
  165. LPARAM lParam;
  166. } NM_RECACT;
  167. // Window styles
  168. #define RAS_SINGLEITEM 0x0001L
  169. ///////////////////////////////////////////////////// EXPORTED DATA
  170. ///////////////////////////////////////////////////// PUBLIC PROTOTYPES
  171. BOOL PUBLIC RecAct_Init (HINSTANCE hinst);
  172. void PUBLIC RecAct_Term(HINSTANCE hinst);
  173. HRESULT PUBLIC RAI_Create(LPRA_ITEM * ppitem, LPCTSTR pszBrfPath, LPCTSTR pszPath, PRECLIST prl, PFOLDERTWINLIST pftl);
  174. HRESULT PUBLIC RAI_CreateFromRecItem(LPRA_ITEM * ppitem, LPCTSTR pszBrfPath, PRECITEM pri);
  175. HRESULT PUBLIC RAI_Free(LPRA_ITEM pitem);
  176. #endif // __RECACT_H__