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.

247 lines
8.8 KiB

  1. //+------------------------------------------------------------------------
  2. //
  3. // OLEDBSimpleProvider interface
  4. //
  5. // Copyright (C) Microsoft Corporation, 1993 - 1997.
  6. //
  7. // File: std.idl
  8. //
  9. //-------------------------------------------------------------------------
  10. //-------------------------------------------------------------------------
  11. //
  12. // This file is copied from IE4 build \ie\public\sdk\inc\simpdata.dil
  13. //
  14. //-------------------------------------------------------------------------
  15. // Usage in MSDEV:
  16. //
  17. // 1. Select Tools/Customize
  18. // 2. Go to Tools tab.
  19. // 3. Click on Add...
  20. // 4. Type MIDL.EXE and click OK (or press ENTER)
  21. // 5. Fill in definition of a new tool as follows:
  22. // Menu Text: Compile &IDL file
  23. // Command: MIDL.EXE
  24. // Arguments: /ms_ext /char unsigned /c_ext $(FileName)$(FileExt)
  25. // Initial Dir: $(FileDir)
  26. // 6. Click on Close
  27. //
  28. // Having done this, you can now use MSDEV to compile IDL files (such as
  29. // this one). Just open the file and select Tools/Compile IDL file.
  30. //
  31. // Contact: tedsmith, jerryd, terrylu, or cfranks
  32. //
  33. //-------------------------------------------------------------------------
  34. //+------------------------------------------------------------------------
  35. //
  36. // OLEDBSimpleProvider interface
  37. //
  38. // Copyright (C) Microsoft Corporation, 1993 - 1996.
  39. //
  40. // File: simpdata.idl
  41. //
  42. //-------------------------------------------------------------------------
  43. cpp_quote("//=--------------------------------------------------------------------------=")
  44. cpp_quote("// simpdata.h")
  45. cpp_quote("//=--------------------------------------------------------------------------=")
  46. cpp_quote("// (C) Copyright 1995-1996 Microsoft Corporation. All Rights Reserved.")
  47. cpp_quote("//")
  48. cpp_quote("// THIS CODE AND INFORMATION IS PROVIDED \"AS IS\" WITHOUT WARRANTY OF")
  49. cpp_quote("// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO")
  50. cpp_quote("// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A")
  51. cpp_quote("// PARTICULAR PURPOSE.")
  52. cpp_quote("//=--------------------------------------------------------------------------=")
  53. cpp_quote("")
  54. cpp_quote("#pragma comment(lib,\"uuid.lib\")")
  55. cpp_quote("")
  56. cpp_quote("//--------------------------------------------------------------------------")
  57. cpp_quote("// Simple Tabular Data.")
  58. cpp_quote("")
  59. cpp_quote("#ifndef SIMPDATA_H")
  60. cpp_quote("#define SIMPDATA_H")
  61. //import "ocidl.idl";
  62. import "objidl.idl";
  63. import "oleidl.idl";
  64. import "oaidl.idl";
  65. // We use signed integers for row and column numbers, starting with the value 1.
  66. // The value 0 refers to any "label" or "header" information, distinct from the
  67. // data. The value -1 refers to any an unknown value, or all values, so, for
  68. // example, iRow = -1, iCol = 2 refers to all of column 2
  69. cpp_quote("#define OSP_IndexLabel (0)")
  70. cpp_quote("#define OSP_IndexAll (~0ul)")
  71. cpp_quote("#define OSP_IndexUnknown (~0ul)")
  72. cpp_quote("")
  73. [
  74. uuid(E0E270C2-C0BE-11d0-8FE4-00A0C90A6341),
  75. helpstring("OLE-DB Simple Provider Type Library"),
  76. lcid(0x409),
  77. version(1.4)
  78. ]
  79. library std
  80. {
  81. typedef enum OSPFORMAT
  82. {
  83. OSPFORMAT_RAW = 0, // set/get variant as is
  84. OSPFORMAT_DEFAULT = 0, // default is RAW
  85. OSPFORMAT_FORMATTED = 1, // all variants converted to string representation
  86. OSPFORMAT_HTML = 2 // variant converted to HTML string representation
  87. // (providers not required to implement this).
  88. } OSPFORMAT;
  89. typedef enum OSPRW
  90. {
  91. // All cells are presumed to be readable.
  92. OSPRW_DEFAULT = 1,
  93. OSPRW_READONLY = 0, // readonly
  94. OSPRW_READWRITE = 1, // readwrite
  95. OSPRW_MIXED = 2 // mixed or unknown; most callers will treat
  96. // as READWRITE "Lazy" provider should just
  97. // return OSPRW_MIXED
  98. } OSPRW;
  99. typedef enum OSPFIND
  100. {
  101. OSPFIND_DEFAULT = 0,
  102. OSPFIND_UP = 1, // scan backwards(decreasing row #s)
  103. OSPFIND_CASESENSITIVE = 2
  104. } OSPFIND;
  105. typedef enum OSPCOMP
  106. {
  107. // These values derived from bitmasks
  108. // i.e. GT LT EQ
  109. OSPCOMP_EQ = 1, // OSPCOMP_EQ 1 Equal
  110. OSPCOMP_DEFAULT = 1, // OSPCOMP_EQ is the default
  111. OSPCOMP_LT = 2, // OSPCOMP_LT 1 0 Less than
  112. OSPCOMP_LE = 3, // OSPCOMP_LE 1 1 Less than or equal
  113. OSPCOMP_GE = 4, // OSPCOMP_GT 1 0 0 Greater than or equal
  114. OSPCOMP_GT = 5, // OSPCOMP_GE 1 0 1 Greater than
  115. OSPCOMP_NE = 6, // OSPCOMP_NE 1 1 0 Not equal
  116. } OSPCOMP;
  117. typedef enum OSPXFER
  118. {
  119. OSPXFER_COMPLETE = 0,
  120. OSPXFER_ABORT = 1,
  121. OSPXFER_ERROR = 2
  122. } OSPXFER;
  123. [
  124. object,
  125. uuid(E0E270C1-C0BE-11d0-8FE4-00A0C90A6341),
  126. pointer_default(unique),
  127. local,
  128. version(1.4)
  129. ]
  130. interface OLEDBSimpleProviderListener : IUnknown
  131. {
  132. // As noted above; a -1 (STD_IndexAll) can be used in the row or column
  133. // (or both). For example, CellChanged(STD_IndexAll, OSP_IndexAll)
  134. // implies that all rows and columns changed shape.
  135. HRESULT aboutToChangeCell([in] long iRow, [in] long iColumn);
  136. HRESULT cellChanged([in] long iRow, [in] long iColumn);
  137. HRESULT aboutToDeleteRows([in] long iRow, [in] long iColumn);
  138. HRESULT deletedRows([in] long iRow, [in] long cRows);
  139. HRESULT aboutToInsertRows([in] long iRow, [in] long cRows);
  140. HRESULT insertedRows([in] long iRow, [in] long cRows);
  141. HRESULT rowsAvailable([in] long iRow, [in] long cRows);
  142. HRESULT transferComplete([in] OSPXFER xfer);
  143. }
  144. [
  145. object,
  146. uuid(E0E270C0-C0BE-11d0-8FE4-00A0C90A6341),
  147. pointer_default(unique),
  148. local,
  149. version(1.4)
  150. ]
  151. interface OLEDBSimpleProvider : IUnknown
  152. {
  153. // Info-retrieving functions:
  154. // ==========================
  155. //
  156. // Note that column names are retrieved using GetString or GetVariant
  157. // with iRow == OSP_IndexLabel. RWStatus for a whole row or column
  158. // can be made with iRow or iColumn == OSP_IndexAll.
  159. HRESULT getRowCount([out,retval] long *pcRows);
  160. HRESULT getColumnCount([out,retval] long *pcColumns);
  161. HRESULT getRWStatus([in] long iRow, [in] long iColumn,
  162. [out, retval] OSPRW *prwStatus);
  163. // Variant-oriented Get/Set:
  164. // =========================
  165. //
  166. // Note that use of VARIANT precludes references.
  167. HRESULT getVariant([in] long iRow, [in] long iColumn,
  168. [in] OSPFORMAT format, [out, retval] VARIANT *pVar );
  169. HRESULT setVariant([in] long iRow, [in] long iColumn,
  170. [in] OSPFORMAT format, [in] VARIANT Var );
  171. // Locale information:
  172. // ===================
  173. //
  174. HRESULT getLocale([out,retval] BSTR *pbstrLocale);
  175. // Deletion and Insertion:
  176. // =======================
  177. //
  178. // For insertion, iRow or iColumn is index *before* which to insert; the
  179. // first inserted row or column will end up with that index.
  180. //
  181. // In case of error, provider may choose to insert or delete only the
  182. // first m of n rows or columns which client requested. OUT parameter
  183. // indicates how many rows or columns actually inserted or deleted. In
  184. // case of success, OUT parameter should be filled in with cRows.
  185. HRESULT deleteRows([in] long iRow, [in] long cRows,
  186. [out, retval] long *pcRowsDeleted );
  187. HRESULT insertRows([in] long iRow, [in] long cRows,
  188. [out, retval] long *pcRowsInserted );
  189. // Find
  190. // Find the first row in column iColumn that contains a value which
  191. // matches val according to the compType.
  192. // To continue searching past the found row, the caller should pass
  193. // *piRowFound+1 as the next iRowStart, or *piRowFound-1 for backward
  194. // searches (STDFIND_UP).
  195. HRESULT find([in] long iRowStart, [in] long iColumn,
  196. [in] VARIANT val,
  197. [in] OSPFIND findFlags,
  198. [in] OSPCOMP compType,
  199. [out, retval] long *piRowFound );
  200. // Establish or detach single event sink.
  201. HRESULT addOLEDBSimpleProviderListener([in] OLEDBSimpleProviderListener *pospIListener);
  202. HRESULT removeOLEDBSimpleProviderListener([in] OLEDBSimpleProviderListener *pospIListener);
  203. // Asynch support
  204. HRESULT isAsync([out, retval] bool *pbAsynch);
  205. HRESULT getEstimatedRows([out, retval] long *piRows);
  206. // Stops any asynchronous download that may be in progress.
  207. HRESULT stopTransfer();
  208. }
  209. cpp_quote("typedef OLEDBSimpleProvider *LPOLEDBSimpleProvider;")
  210. }
  211. cpp_quote("#endif")