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.

230 lines
4.4 KiB

  1. //
  2. // USER.HPP
  3. // User Class
  4. //
  5. // Copyright Microsoft 1998-
  6. //
  7. #ifndef __USER_HPP_
  8. #define __USER_HPP_
  9. //
  10. //
  11. // Class: WbUser
  12. //
  13. // Purpose: User object recorder
  14. //
  15. //
  16. class DCWbGraphicPointer;
  17. class WbUser
  18. {
  19. public:
  20. //
  21. // Constructor
  22. //
  23. WbUser(POM_OBJECT hUser = NULL);
  24. //
  25. // Destructor
  26. //
  27. ~WbUser(void);
  28. //
  29. // Return the user handle
  30. //
  31. POM_OBJECT Handle(void) const { return(m_hUser);}
  32. //
  33. // Refresh the user details
  34. //
  35. void Refresh(void);
  36. //
  37. // Update the external copy of the user information
  38. //
  39. void Update(void);
  40. //
  41. // Return the user name
  42. //
  43. LPCSTR Name(void) const { return(m_strName); }
  44. //
  45. // Synchronize the users page with other synced users
  46. //
  47. void Sync(void);
  48. void Unsync(void);
  49. //
  50. // Update the user's position from the sync position. This does not
  51. // change the sync position.
  52. //
  53. void GetSyncPosition(void);
  54. //
  55. // Update the sync position from the user's current position
  56. //
  57. void PutSyncPosition(void);
  58. //
  59. // Return a remote pointer object for this user
  60. //
  61. DCWbGraphicPointer* GetPointer(void) { return(m_pRemotePointer); }
  62. //
  63. // Put the user's remote pointer at the position specified
  64. //
  65. void PutPointer(WB_PAGE_HANDLE hPage, POINT point);
  66. //
  67. // Remove the user's remote pointer
  68. //
  69. void RemovePointer(void);
  70. //
  71. // Return TRUE if the user is synced
  72. //
  73. BOOL IsSynced(void) const { return m_bSynced; }
  74. //
  75. // Return TRUE if the user has the contents lock
  76. //
  77. BOOL HasContentsLock(void) const;
  78. //
  79. // Return TRUE if the user has their remote pointer active
  80. //
  81. BOOL IsUsingPointer(void) const;
  82. //
  83. // Return the current page of the user
  84. //
  85. WB_PAGE_HANDLE Page(void) const {return m_hPageCurrent; }
  86. void SetPage(WB_PAGE_HANDLE hPage);
  87. //
  88. // Return the current position within the page of the user
  89. //
  90. void GetVisibleRect(LPRECT lprc) { *lprc = m_rectVisible; }
  91. void SetVisibleRect(LPCRECT lprc);
  92. //
  93. // Return the page of the user's pointer
  94. //
  95. WB_PAGE_HANDLE PointerPage(void) const;
  96. //
  97. // Return the position of the user's pointer
  98. //
  99. void GetPointerPosition(LPPOINT lpptPos);
  100. //
  101. // Return the user's color
  102. //
  103. COLORREF Color(void) const { return(m_color); }
  104. //
  105. // Return TRUE if this is the local user
  106. //
  107. BOOL IsLocalUser(void) const { return(m_bLocalUser); }
  108. //
  109. // Operators
  110. //
  111. virtual WbUser& operator=(const WbUser& user);
  112. virtual BOOL operator!=(const WbUser& user) const;
  113. virtual BOOL operator==(const WbUser& user) const;
  114. //
  115. // Set zoom/unzoom state
  116. //
  117. void Zoom(void) { m_zoomed = TRUE; }
  118. void Unzoom(void) { m_zoomed = FALSE; }
  119. BOOL GetZoom(void) const { return(m_zoomed); }
  120. protected:
  121. //
  122. // Core access handle
  123. //
  124. POM_OBJECT m_hUser;
  125. //
  126. // Flag indicating Whether this is the local user
  127. //
  128. BOOL m_bLocalUser;
  129. BOOL m_zoomed;
  130. //
  131. // Local copies of the user information
  132. //
  133. char m_strName[TSHR_MAX_PERSON_NAME_LEN];
  134. BOOL m_bSynced;
  135. WB_PAGE_HANDLE m_hPageCurrent;
  136. RECT m_rectVisible;
  137. COLORREF m_color;
  138. //
  139. // Graphic pointer associated with this user
  140. //
  141. DCWbGraphicPointer* m_pRemotePointer;
  142. };
  143. //
  144. //
  145. // Class: WbUserList
  146. //
  147. // Purpose: Map from user handles to user object pointers
  148. //
  149. //
  150. class WbUserList : public COBLIST
  151. {
  152. public:
  153. //
  154. // Destructor
  155. //
  156. ~WbUserList(void);
  157. //
  158. // Clear all entries from the map, deleting the associated object
  159. //
  160. void Clear(void);
  161. };
  162. //
  163. // Return lock status
  164. //
  165. BOOL WB_Locked(void);
  166. BOOL WB_ContentsLocked(void);
  167. BOOL WB_GotLock(void);
  168. BOOL WB_GotContentsLock(void);
  169. BOOL WB_PresentationMode(void);
  170. //
  171. // Return an object representing the local user
  172. //
  173. WbUser* WB_LocalUser(void);
  174. //
  175. // Retrieving users
  176. //
  177. WbUser* WB_GetUser(POM_OBJECT hUser);
  178. WbUser* WB_GetFirstUser(void);
  179. WbUser* WB_GetNextUser(const WbUser* pUser);
  180. //
  181. // Return an object representing the user who has the lock
  182. //
  183. WbUser* WB_LockUser(void);
  184. #endif // __USER_HPP_