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.

197 lines
4.3 KiB

  1. /***********************************************************************
  2. *
  3. * _ABCTBL.H
  4. *
  5. * Header file for code in ABCTBL.C
  6. *
  7. * Copyright 1992, 1993 Microsoft Corporation. All Rights Reserved.
  8. *
  9. ***********************************************************************/
  10. /*
  11. * BookMark structure
  12. */
  13. #define MAX_BOOKMARKS 10
  14. #define BK_PEGGEDTOEND ((ULONG)0x00000001)
  15. typedef struct _ABCBK
  16. {
  17. ULONG ulFlags; /* Flags */
  18. FILETIME filetime; /* Time of file when bookmark created */
  19. ULONG ulPosition; /* Position of record in file */
  20. ABCREC abcrec; /* Record associated with this bookmark */
  21. } ABCBK, *LPABCBK;
  22. #define CBABCBK sizeof(ABCBK)
  23. /*
  24. * Function Prototypes
  25. */
  26. /*
  27. * Reuses methods:
  28. * ROOT_QueryInterface
  29. * ROOT_AddRef
  30. * ROOT_GetLastError
  31. * IVTROOT_RegisterNotification
  32. */
  33. #undef INTERFACE
  34. #define INTERFACE struct _IVTABC
  35. #undef MAPIMETHOD_
  36. #define MAPIMETHOD_(type, method) MAPIMETHOD_DECLARE(type, method, IVTABC_)
  37. MAPI_IUNKNOWN_METHODS(IMPL)
  38. MAPI_IMAPITABLE_METHODS(IMPL)
  39. #undef MAPIMETHOD_
  40. #define MAPIMETHOD_(type, method) MAPIMETHOD_TYPEDEF(type, method, IVTABC_)
  41. MAPI_IUNKNOWN_METHODS(IMPL)
  42. MAPI_IMAPITABLE_METHODS(IMPL)
  43. #undef MAPIMETHOD_
  44. #define MAPIMETHOD_(type, method) STDMETHOD_(type, method)
  45. DECLARE_MAPI_INTERFACE(IVTABC_)
  46. {
  47. MAPI_IUNKNOWN_METHODS(IMPL)
  48. MAPI_IMAPITABLE_METHODS(IMPL)
  49. };
  50. /*
  51. * _IVTABC is the structure returned to the client when
  52. * the contents table is retrieved from the ab container
  53. * object (ABCONT.C).
  54. *
  55. * The first thing in the structure must be a jump table
  56. * with all the IMAPITable methods in it.
  57. *
  58. */
  59. typedef struct _IVTABC
  60. {
  61. const IVTABC_Vtbl FAR * lpVtbl;
  62. /*
  63. * Need to be the same as other objects
  64. * since this object reuses methods from
  65. * other objects.
  66. */
  67. FAB_IUnkWithLogon;
  68. /*
  69. * Private data
  70. */
  71. /* The list of active columns */
  72. LPSPropTagArray lpPTAColSet;
  73. /* HANDLE of file that I'm browsing... */
  74. HANDLE hFile;
  75. /* FILETIME time the file was last changed */
  76. FILETIME filetime;
  77. /* Size of file */
  78. ULONG ulMaxPos;
  79. /* Current position in file */
  80. ULONG ulPosition;
  81. /* BookMark array... */
  82. LPABCBK rglpABCBK[MAX_BOOKMARKS];
  83. /*
  84. * Restriction stuff
  85. */
  86. ULONG ulRstrDenom;
  87. /* Partial Name to match */
  88. LPTSTR lpszPartialName;
  89. /* 2 bit arrays of what's been checked, and what (of them) matches */
  90. BYTE *rgChecked;
  91. BYTE *rgMatched;
  92. ULONG ulConnectMic;
  93. UINT cAdvise; /* Count of registered notifications */
  94. LPMAPIADVISESINK * parglpAdvise; /* Registered notifications */
  95. FTG ftg; /* Idle function tag */
  96. LPTSTR lpszFileName;
  97. } IVTABC, *LPIVTABC;
  98. #define CBIVTABC sizeof(IVTABC)
  99. /*
  100. * Record for PR_INSTANCE_KEY. Need enough information to find the record quickly as
  101. * well as determine if the record is still valid.
  102. */
  103. typedef struct _abcrecinstance
  104. {
  105. ULONG ulRecordPosition;
  106. FILETIME filetime;
  107. TCHAR rgchzFileName[1]; /* Get's sized accordingly */
  108. } ABCRecInstance, FAR * LPABCRecInstance;
  109. /*
  110. * Private macros
  111. */
  112. /* Counts the number of bits in a byte */
  113. #define CBitsB(b, cbits) { \
  114. \
  115. cbits = 0; \
  116. \
  117. cbits = ((b) & 0x55) + ((b>>1) & 0x55); \
  118. cbits = (cbits & 0x33) + ((cbits>>2) & 0x33); \
  119. cbits = (cbits & 0x0f) + (cbits>>4); \
  120. }
  121. /*
  122. * Functions prototypes
  123. */
  124. // Creates a new IVTAbc object
  125. HRESULT
  126. NewIVTAbc (LPVOID * lppIVTAbc, LPABPLOGON lpABPLogon, LPABCNT lpABC);
  127. // Internal functions
  128. HRESULT HrOpenFile(LPIVTABC lpIVTAbc);
  129. void FreeANRBitmaps(LPIVTABC lpIVTAbc);
  130. HRESULT HrValidateEntry (LPIVTABC lpIVTAbc, ULONG ulNewPos);
  131. BOOL FNameMatch (LPIVTABC lpIVTAbc, LPTSTR rgchDisplayName);
  132. BOOL FMatched (LPIVTABC lpIVTAbc, ULONG ulNewPos);
  133. BOOL FChecked (LPIVTABC lpIVTAbc, ULONG ulNewPos);
  134. /*
  135. * Default column set
  136. */
  137. enum { ivalvtPR_DISPLAY_NAME,
  138. ivalvtPR_ENTRYID,
  139. ivalvtPR_ADDRTYPE,
  140. ivalvtPR_EMAIL_ADDRESS,
  141. ivalvtPR_OBJECT_TYPE,
  142. ivalvtPR_DISPLAY_TYPE,
  143. ivalvtPR_INSTANCE_KEY,
  144. cvalvtMax };
  145. /*
  146. * Externs defined for use in the three table modules
  147. */
  148. extern const IVTABC_Vtbl vtblIVTABC;
  149. extern const LPSPropTagArray ptagaivtabcColSet;