Leaked source code of windows server 2003
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.

218 lines
5.8 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 "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. LPSTR pszDir;
  39. UINT uState; // One of SI_* flags
  40. FILESTAMP fs;
  41. } SIDEITEM, FAR * LPSIDEITEM;
  42. // RecAction Item structure
  43. //
  44. #define RAIF_ACTION 0x0001 // Mask codes
  45. #define RAIF_NAME 0x0002
  46. #define RAIF_STYLE 0x0004
  47. #define RAIF_INSIDE 0x0008
  48. #define RAIF_OUTSIDE 0x0010
  49. #define RAIF_LPARAM 0x0020
  50. #define RAIF_ALL 0x001f
  51. typedef struct tagRA_ITEM
  52. {
  53. UINT mask; // One of RAIF_
  54. int iItem;
  55. UINT uStyle; // One of RAIS_
  56. UINT uAction; // One of RAIA_
  57. LPCSTR pszName;
  58. SIDEITEM siInside;
  59. SIDEITEM siOutside;
  60. LPARAM lParam;
  61. } RA_ITEM, FAR * LPRA_ITEM;
  62. // RecAct item styles
  63. //
  64. #define RAIS_CANMERGE 0x0001
  65. #define RAIS_FOLDER 0x0002
  66. #define RAIS_CANSKIP 0x0004
  67. // RecAct actions
  68. //
  69. #define RAIA_TOOUT 0 // Don't change these values without changing
  70. #define RAIA_TOIN 1 // the order of the bitmaps in s_rgidAction
  71. #define RAIA_SKIP 2
  72. #define RAIA_CONFLICT 3
  73. #define RAIA_MERGE 4
  74. #define RAIA_SOMETHING 5 // These two require RAIS_FOLDER
  75. #define RAIA_NOTHING 6
  76. #define RAIA_ORPHAN 7
  77. // Insert item at specified index. Item is inserted at end if
  78. // i is greater than or equal to the number of items in the twinview.
  79. // Returns the index of the inserted item, or -1 on error.
  80. //
  81. // int RecAct_InsertItem(HWND hwnd, const LPRA_ITEM pitem);
  82. //
  83. #define RAM_INSERTITEM (RAM_FIRST + 1)
  84. #define RecAct_InsertItem(hwnd, pitem) \
  85. (int)SendMessage((hwnd), RAM_INSERTITEM, 0, (LPARAM)(const LPRA_ITEM)(pitem))
  86. // Delete an item at the specified index.
  87. //
  88. // int RecAct_DeleteItem(HWND hwnd, int i);
  89. //
  90. #define RAM_DELETEITEM (RAM_FIRST + 2)
  91. #define RecAct_DeleteItem(hwnd, i) \
  92. (int)SendMessage((hwnd), RAM_DELETEITEM, (WPARAM)(int)(i), 0L)
  93. // Deletes all items in the control
  94. //
  95. // BOOL RecAct_DeleteAllItems(HWND hwnd);
  96. //
  97. #define RAM_DELETEALLITEMS (RAM_FIRST + 3)
  98. #define RecAct_DeleteAllItems(hwnd) \
  99. (BOOL)SendMessage((hwnd), RAM_DELETEALLITEMS, 0, 0L)
  100. // BOOL RecAct_GetItem(HWND hwnd, LPRA_ITEM pitem);
  101. //
  102. #define RAM_GETITEM (RAM_FIRST + 4)
  103. #define RecAct_GetItem(hwnd, pitem) \
  104. (BOOL)SendMessage((hwnd), RAM_GETITEM, 0, (LPARAM)(LPRA_ITEM)(pitem))
  105. // BOOL RecAct_SetItem(HWND hwnd, const LPRA_ITEM pitem);
  106. //
  107. #define RAM_SETITEM (RAM_FIRST + 5)
  108. #define RecAct_SetItem(hwnd, pitem) \
  109. (BOOL)SendMessage((hwnd), RAM_SETITEM, 0, (LPARAM)(const LPRA_ITEM)(pitem))
  110. // Get the current selection by index. -1 if nothing is selected.
  111. //
  112. // int RecAct_GetCurSel(HWND hwnd);
  113. //
  114. #define RAM_GETCURSEL (RAM_FIRST + 6)
  115. #define RecAct_GetCurSel(hwnd) \
  116. (int)SendMessage((hwnd), RAM_GETCURSEL, (WPARAM)0, 0L)
  117. // Set the current selection by index. -1 to deselect.
  118. //
  119. // int RecAct_SetCurSel(HWND hwnd, int i);
  120. //
  121. #define RAM_SETCURSEL (RAM_FIRST + 7)
  122. #define RecAct_SetCurSel(hwnd, i) \
  123. (int)SendMessage((hwnd), RAM_SETCURSEL, (WPARAM)(i), 0L)
  124. // RecAct_FindItem flags
  125. //
  126. #define RAFI_NAME 0x0001
  127. #define RAFI_LPARAM 0x0002
  128. #define RAFI_ACTION 0x0004
  129. typedef struct tagRA_FINDITEM
  130. {
  131. UINT flags; // One of RAFI_* flags
  132. UINT uAction; // One of RAIA_* flags
  133. LPCSTR psz;
  134. LPARAM lParam;
  135. } RA_FINDITEM;
  136. // Find an item according to RA_FINDITEM struct. iStart = -1 to
  137. // start at beginning.
  138. //
  139. // int RecAct_FindItem(HWND hwnd, int iStart, const RA_FINDITEM FAR* prafi);
  140. #define RAM_FINDITEM (RAM_FIRST + 8)
  141. #define RecAct_FindItem(hwnd, iStart, prafi) \
  142. (int)SendMessage((hwnd), RAM_FINDITEM, (WPARAM)(int)(iStart), (LPARAM)(const RA_FINDINFO FAR*)(prafi))
  143. // Refresh the control.
  144. //
  145. // void RecAct_Refresh(HWND hwnd);
  146. #define RAM_REFRESH (RAM_FIRST + 9)
  147. #define RecAct_Refresh(hwnd) \
  148. SendMessage((hwnd), RAM_REFRESH, 0, 0L)
  149. // Notification codes
  150. //
  151. #define RN_SELCHANGED (RN_FIRST-0)
  152. #define RN_ITEMCHANGED (RN_FIRST-1)
  153. typedef struct tagNM_RECACT
  154. {
  155. NMHDR hdr;
  156. int iItem;
  157. UINT mask; // One of RAIF_*
  158. UINT uAction; // One of RAIA_*
  159. UINT uActionOld; // One of RAIA_*
  160. LPARAM lParam;
  161. } NM_RECACT;
  162. // Window styles
  163. #define RAS_SINGLEITEM 0x0001L
  164. ///////////////////////////////////////////////////// EXPORTED DATA
  165. ///////////////////////////////////////////////////// PUBLIC PROTOTYPES
  166. BOOL PUBLIC RecAct_Init (HINSTANCE hinst);
  167. void PUBLIC RecAct_Term(HINSTANCE hinst);
  168. void PUBLIC RAI_FillFromObject(LPRA_ITEM pitem, int atomBrf, LPCSTR pszInsideDir, PRECITEM lpri, HTWIN FAR * lphtwin);
  169. BOOL PUBLIC RAI_FillFromFolder(LPRA_ITEM pitem, PFOLDERTWINLIST lpftl, PRECLIST lprl, LPCSTR lpcszPath, HTWIN FAR * lphtwin);
  170. #endif // __RECACT_H__