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.

55 lines
1.8 KiB

  1. //---------------------------------------------------------------------------
  2. // Bookmark.h : CVDBookmark header file
  3. //
  4. // Copyright (c) 1996 Microsoft Corporation, All Rights Reserved
  5. // Developed by Sheridan Software Systems, Inc.
  6. //---------------------------------------------------------------------------
  7. #ifndef __CVDBOOKMARK__
  8. #define __CVDBOOKMARK__
  9. #define VDBOOKMARKSTATUS_INVALID 0 // same as CURSOR_DBBMK_INVALID
  10. #define VDBOOKMARKSTATUS_CURRENT 1 // same as CURSOR_DBBMK_CURRENT
  11. #define VDBOOKMARKSTATUS_BEGINNING 2 // same as CURSOR_DBBMK_BEGINNING
  12. #define VDBOOKMARKSTATUS_END 3 // same as CURSOR_DBBMK_END
  13. class CVDCursorPosition;
  14. class CVDBookmark
  15. {
  16. friend class CVDCursorPosition;
  17. public:
  18. // Construction/Destruction
  19. CVDBookmark();
  20. ~CVDBookmark();
  21. public:
  22. // Access functions
  23. CURSOR_DBVARIANT GetBookmarkVariant(){return m_varBookmark;}
  24. HROW GetHRow(){return m_hRow;}
  25. BYTE* GetBookmark(){return m_pBookmark;}
  26. ULONG GetBookmarkLen(){return m_cbBookmark;}
  27. WORD GetStatus(){return m_wStatus;}
  28. // validation functions
  29. BOOL IsSameBookmark(CVDBookmark * pbm);
  30. BOOL IsSameHRow(HROW hRow){return VDBOOKMARKSTATUS_CURRENT == m_wStatus && hRow == m_hRow ? TRUE : FALSE;}
  31. protected:
  32. // Data members
  33. CURSOR_DBVARIANT m_varBookmark; // variant that holds bookmark as a safearray
  34. ULONG m_cbBookmark; // length of bookmark in bytes
  35. BYTE * m_pBookmark; // pointer to bookmark's data
  36. HROW m_hRow; // hRow associated with this bookmark
  37. WORD m_wStatus; // beginning/end/row/unknown
  38. // Initialization functions
  39. void Reset();
  40. HRESULT SetBookmark(WORD wStatus, HROW hRow = 0, BYTE* pBookmark = NULL, ULONG cbBookmark = 0);
  41. };
  42. #endif //__CVDBOOKMARK__