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.

200 lines
8.0 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. // Copyright (c) Microsoft Corporation 1993-1994
  4. //
  5. // File: brfcasep.h
  6. //
  7. // Internal header shared between SHELL232 and SYNCUI
  8. //
  9. // History:
  10. // 01-27-94 ScottH Copied from brfcase.h
  11. //
  12. //---------------------------------------------------------------------------
  13. #ifndef _BRFCASEP_H_
  14. #define _BRFCASEP_H_
  15. //===========================================================================
  16. //
  17. // IBriefcaseStg Interface
  18. //
  19. // This is a private interface for use between the shell and the briefcase.
  20. //
  21. // This interface is used by the Shell's IShellFolder implementation
  22. // when it is bound to a folder that is (in) a briefcase. The IShellView
  23. // of the particular folder binds to this interface to open the briefcase
  24. // database storage and optionally make modifications. File-objects that
  25. // are added to a folder in a briefcase are not added to the storage
  26. // database until IBriefcaseStg::AddObject is called. Keep in mind the
  27. // difference between IBriefcaseStg and IShellFolder. IBriefcaseStg
  28. // simply provides access to the briefcase storage database--the file-system
  29. // objects are only affected upon subsequent reconciliation using
  30. // IBriefcaseStg::UpdateObject, unless otherwise noted.
  31. //
  32. //
  33. // [Member functions]
  34. //
  35. //
  36. // IBriefcaseStg::Initialize(pszFolder, hwndOwner)
  37. //
  38. // Initializes the interface by specifying the folder for this storage
  39. // instance. If the folder does not exist somewhere in a briefcase
  40. // storage hierarchy, then a briefcase database is created for this
  41. // folder.
  42. //
  43. // IBriefcaseStg::AddObject(pdtobj, pszFolderEx, uFlags, hwndOwner)
  44. //
  45. // Adds a file-object(s) to the briefcase storage. This function also
  46. // performs an update of the specific files to immediately make them
  47. // up-to-date.
  48. //
  49. // Typically pdtobj refers to a file-object(s) outside the
  50. // briefcase. Calling this function implies adding the object(s) to
  51. // the briefcase storage database in the folder that was specified by
  52. // IBriefcaseStg::Initialize(). This rule holds unless pszFolderEx is
  53. // non-NULL, in which case pdtobj is sync-associated to pszFolderEx
  54. // instead.
  55. //
  56. // AddObject() returns NOERROR if the object(s) were added. S_FALSE
  57. // is returned if the caller should handle the action (eg, moving
  58. // files from folder-to-folder within the briefcase).
  59. //
  60. // IBriefcaseStg::ReleaseObject(pdtobj, hwndOwner)
  61. //
  62. // Releases a file-object(s) from the briefcase storage database. This
  63. // does not delete the file from the file-system.
  64. //
  65. // IBriefcaseStg::UpdateObject(pdtobj, hwndOwner)
  66. //
  67. // Performs a file-synchronization update to pdtobj. If pdtobj refers to
  68. // the root of a briefcase storage hierarchy, the entire storage is updated.
  69. //
  70. // IBriefcaseStg::UpdateOnEvent(uEvent, hwndOwner)
  71. //
  72. // Performs a complete update of the briefcase storage based on the
  73. // indicated event. The event ordinals may be:
  74. //
  75. // UOE_CONFIGCHANGED Indicates a PnP DBT_CONFIGCHANGED message wants
  76. // to be processed. This occurs when a machine
  77. // hot-docks.
  78. //
  79. // UOE_QUERYCHANGECONFIG Indicates a PnP DBT_QUERYCHANGECONFIG message
  80. // wants to be processed. This occurs when a
  81. // machine is about to hot-undock.
  82. //
  83. // IBriefcaseStg::GetExtraInfo(pszName, uInfo, wParam, lParam)
  84. //
  85. // Gets some specified extra info from the briefcase storage. The
  86. // info is determined by uInfo, which is one of GEI_* values.
  87. //
  88. // IBriefcaseStg::Notify(pszPath, lEvent, puFlags, hwndOwner)
  89. //
  90. // Sends a notify event to the briefcase storage, so it can mark
  91. // cached items stale. If lEvent is NOE_RENAME, pszPath must be a double
  92. // null-terminated string, where the first is the old pathname, and the
  93. // second is the new pathname. *puFlags is filled with flags pertaining
  94. // to what the member function did. NF_REDRAWWINDOW means the window
  95. // needs to be redrawn. NF_ITEMMARKED means the cached item in the
  96. // briefcase storage associated with pszPath was marked stale.
  97. //
  98. // IBriefcaseStg::GetRootOf(pszBuffer, cbBuffer)
  99. //
  100. // Queries the briefcase storage for the root of the briefcase storage
  101. // hierarchy.
  102. //
  103. // IBriefcaseStg::FindFirst(pszBuffer, cbBuffer)
  104. //
  105. // Finds the root of the first briefcase storage on the system. The
  106. // buffer is filled with the fully qualified pathname. This function
  107. // returns S_OK if a briefcase was found. S_FALSE is returned to end
  108. // enumeration.
  109. //
  110. // IBriefcaseStg::FindNext(pszBuffer, cbBuffer)
  111. //
  112. // Finds the root of the next briefcase storage on the system. The
  113. // buffer is filled with the fully qualified pathname. This function
  114. // returns S_OK if a briefcase was found. S_FALSE is returned to end
  115. // enumeration.
  116. //
  117. //
  118. //
  119. //===========================================================================
  120. #undef INTERFACE
  121. #define INTERFACE IBriefcaseStg
  122. DECLARE_INTERFACE_(IBriefcaseStg, IUnknown)
  123. {
  124. // *** IUnknown methods ***
  125. STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
  126. STDMETHOD_(ULONG,AddRef) (THIS) PURE;
  127. STDMETHOD_(ULONG,Release) (THIS) PURE;
  128. // *** IBriefcaseStg methods ***
  129. STDMETHOD(Initialize) (THIS_ LPCTSTR pszFolder, HWND hwnd) PURE;
  130. STDMETHOD(AddObject) (THIS_ LPDATAOBJECT lpdobj, LPCTSTR pszFolderEx, UINT uFlags, HWND hwnd) PURE;
  131. STDMETHOD(ReleaseObject) (THIS_ LPDATAOBJECT lpdobj, HWND hwnd) PURE;
  132. STDMETHOD(UpdateObject) (THIS_ LPDATAOBJECT lpdobj, HWND hwnd) PURE;
  133. STDMETHOD(UpdateOnEvent) (THIS_ UINT uEvent, HWND hwnd) PURE;
  134. STDMETHOD(GetExtraInfo) (THIS_ LPCTSTR pszName, UINT uInfo, WPARAM wParam, LPARAM lParam) PURE;
  135. STDMETHOD(Notify) (THIS_ LPCTSTR pszPath, LONG lEvent, UINT * puFlags, HWND hwndOwner) PURE;
  136. STDMETHOD(FindFirst) (THIS_ LPTSTR pszPath, int cchMax) PURE;
  137. STDMETHOD(FindNext) (THIS_ LPTSTR pszPath, int cchMax) PURE;
  138. };
  139. // Events for UpdateOnEvent member function
  140. #define UOE_CONFIGCHANGED 1
  141. #define UOE_QUERYCHANGECONFIG 2
  142. // Flags for AddObject
  143. #define AOF_DEFAULT 0x0000
  144. #define AOF_UPDATEONREPLACE 0x0001
  145. #define AOF_FILTERPROMPT 0x0002
  146. // Notify events
  147. #define NOE_RENAME 1L
  148. #define NOE_RENAMEFOLDER 2L
  149. #define NOE_CREATE 3L
  150. #define NOE_CREATEFOLDER 4L
  151. #define NOE_DELETE 5L
  152. #define NOE_DELETEFOLDER 6L
  153. #define NOE_DIRTY 7L
  154. #define NOE_DIRTYFOLDER 8L
  155. #define NOE_DIRTYALL 9L
  156. // Flags that are returned by Notify member function
  157. #define NF_REDRAWWINDOW 0x0001
  158. #define NF_ITEMMARKED 0x0002
  159. // Flags for GetExtraInfo wParam lParam
  160. #define GEI_ROOT 1 // cchBuf pszBuf
  161. #define GEI_ORIGIN 2 // cchBuf pszBuf
  162. #define GEI_STATUS 3 // cchBuf pszBuf
  163. #define GEI_DELAYHANDLE 4 // -- phandle
  164. #define GEI_DATABASENAME 5 // cchBuf pszBuf
  165. typedef IBriefcaseStg * LPBRIEFCASESTG;
  166. // Special briefcase object struct
  167. //
  168. typedef struct _BriefObj
  169. {
  170. UINT cbSize; // size of allocated struct
  171. UINT ibFileList; // offset of file list in struct
  172. UINT ibBriefPath; // offset of briefcase path in struct
  173. UINT cItems; // count of file-system objects
  174. UINT cbListSize; // size of file list
  175. TCHAR data[1]; // data
  176. } BriefObj, * PBRIEFOBJ;
  177. // Helper macros for briefcase object struct
  178. #define BOBriefcasePath(pbo) ((LPTSTR)((LPBYTE)(pbo) + (pbo)->ibBriefPath))
  179. #define BOFileList(pbo) ((LPTSTR)((LPBYTE)(pbo) + (pbo)->ibFileList))
  180. #define BOFileCount(pbo) ((pbo)->cItems)
  181. #define BOFileListSize(pbo) ((pbo)->cbListSize)
  182. // Clipboard format for above struct
  183. //
  184. #define CFSTR_BRIEFOBJECT TEXT("Briefcase File Object")
  185. #endif // _BRFCASEP_H_