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.

128 lines
3.4 KiB

  1. //+------------------------------------------------------------------
  2. //
  3. // Copyright (C) Microsoft Corporation, 1991 - 1997
  4. //
  5. // File: gencur.hxx
  6. //
  7. // Contents: Base cursor
  8. //
  9. // Classes: CGenericCursor
  10. //
  11. // History: 19-Aug-91 KyleP Created
  12. //
  13. //-------------------------------------------------------------------
  14. #pragma once
  15. #include <objcur.hxx>
  16. #include <xpr.hxx>
  17. #include <fa.hxx>
  18. #include <ciintf.h>
  19. //+---------------------------------------------------------------------------
  20. //
  21. // Class: CGenericCursor
  22. //
  23. // Purpose: Maps the object and property tables into one.
  24. //
  25. // History: 19-Aug-91 KyleP Created.
  26. // 03-May-94 KyleP Notification
  27. //
  28. //----------------------------------------------------------------------------
  29. class CGenericCursor : public CRetriever
  30. {
  31. public:
  32. CGenericCursor( XXpr & xxpr,
  33. ACCESS_MASK accessMask,
  34. BOOL& fAbort );
  35. virtual ~CGenericCursor();
  36. //
  37. // Control
  38. //
  39. virtual void Quiesce();
  40. WORKID SetWorkId(WORKID wid);
  41. //
  42. // Iteration
  43. //
  44. inline WORKID WorkId();
  45. WORKID NextWorkId();
  46. virtual void RatioFinished (ULONG& denom, ULONG& num);
  47. //
  48. // Property retrieval
  49. //
  50. virtual GetValueResult GetPropertyValue( PROPID pid,
  51. PROPVARIANT * pbData,
  52. ULONG * pcb );
  53. virtual void SwapOutWorker()
  54. {
  55. //
  56. // Override if anything needs to be done at the time of worker
  57. // thread swap out
  58. //
  59. Quiesce();
  60. }
  61. protected:
  62. virtual WORKID NextObject() = 0;
  63. void SetFirstWorkId( WORKID wid );
  64. virtual LONG Rank() = 0;
  65. virtual ULONG HitCount() = 0;
  66. virtual CCursor * GetCursor() { return 0; }
  67. BOOL IsAccessPermitted ( WORKID wid ); // Security check
  68. BOOL IsMatch( WORKID wid ); // Full match check, incl. security
  69. BOOL InScope( WORKID wid );
  70. BOOL& _fAbort; // To abort long-running methods.
  71. XInterface<ICiCPropRetriever> _xPropRetriever; // Client specific property retriever
  72. private:
  73. inline void PrimeWidForPropRetrieval( WORKID wid );
  74. void SetupWidForPropRetrieval( WORKID wid );
  75. WORKID _widCurrent; // Wid on which we are currently positioned
  76. XXpr _xxpr; // Restriction (expression)
  77. ACCESS_MASK _am;
  78. WORKID _widPrimedForPropRetrieval; // Set to the wid for which BeginPropRetreival has been
  79. // called. After EndPropRetrieval has been called, this
  80. // is reset to widInvalid.
  81. # ifdef CIEXTMODE
  82. void CiExtDump(void *ciExtSelf) const;
  83. # endif
  84. };
  85. //+---------------------------------------------------------------------------
  86. //
  87. // Member: CGenericCursor::WorkID, public
  88. //
  89. // Returns: The WorkID of the object under the cursor. widInvalid if
  90. // no object is under the cursor.
  91. //
  92. // History: 31-Oct-91 KyleP Created.
  93. //
  94. //----------------------------------------------------------------------------
  95. inline WORKID CGenericCursor::WorkId()
  96. {
  97. return( _widCurrent );
  98. }
  99. DECLARE_SMARTP( GenericCursor );