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.

220 lines
9.0 KiB

  1. // @doc
  2. /******************************************************************************
  3. *
  4. * @module JoyInfoExCollection.h |
  5. *
  6. * CControlItemJoyInfoExCollection template class header file
  7. *
  8. * Implements the CControlItemJoyInfoExCollection control item collection class,
  9. * which is used to convert back and forth between JOYINFOEX packets and
  10. * CONTROL_ITEM_XFER packets.
  11. *
  12. * History<nl>
  13. * ---------------------------------------------------<nl>
  14. * Daniel M. Sangster Original 2/1/99<nl>
  15. *<nl>
  16. * (c) 1986-1999 Microsoft Corporation. All rights reserved.<nl>
  17. * <nl>
  18. *
  19. ******************************************************************************/
  20. #ifndef __JoyInfoExCollection_H_
  21. #define __JoyInfoExCollection_H_
  22. #define JOY_FLAGS_PEDALS_NOT_PRESENT 2
  23. /////////////////////////////////////////////////////////////////////////////
  24. // @class CJoyInfoExControlItem, which derives virtually from CControlItem, is
  25. // used as the base class for all items in the CControlItemJoyInfoExCollection.
  26. // It has only two pure virtual functions. GetItemState gets the current state
  27. // of the item into a JOYINFOEX structure. SetItemState does the opposite.
  28. class CJoyInfoExControlItem : public virtual CControlItem
  29. {
  30. public:
  31. CJoyInfoExControlItem();
  32. virtual HRESULT GetItemState(JOYINFOEX* pjix) = 0;
  33. virtual HRESULT SetItemState(JOYINFOEX* pjix) = 0;
  34. };
  35. ///////////////////////////////////////////////////////////////////////////////
  36. // @func ControlItemJoyInfoExFactory is the factory that is required by the
  37. // CControlItemCollection template class to create control items derived from
  38. // CJoyInfoExControlItem.
  39. HRESULT ControlItemJoyInfoExFactory
  40. (
  41. USHORT usType,
  42. const CONTROL_ITEM_DESC* cpControlItemDesc,
  43. CJoyInfoExControlItem **ppControlItem
  44. );
  45. ////////////////////////////////////////////////////////////////////////////////////
  46. // @class CControlItemJoyInfoExCollection, which is derived from the template
  47. // class CControlItemCollection, implements a collection of CJoyInfoExControlItems.
  48. // Its two members, GetState2() and SetState2(), will get or set the current
  49. // state of the collection into a JOYINFOEX structure. Using the GetState()
  50. // and SetState() members of ControlItemCollection, the user can freely convert
  51. // between JOYINFOEX structures and CONTROL_ITEM_XFER structures.
  52. class CControlItemJoyInfoExCollection : public CControlItemCollection<CJoyInfoExControlItem>
  53. {
  54. public:
  55. CControlItemJoyInfoExCollection(ULONG ulVidPid);
  56. HRESULT GetState2(JOYINFOEX* pjix);
  57. HRESULT SetState2(JOYINFOEX* pjix);
  58. };
  59. ///////////////////////////////////////////////////////////////////////////////
  60. // @class CJoyInfoExAxesItem, which derives simultaneously from our
  61. // custom CJoyInfoExControlItem and the standard CAxesItem, implements
  62. // an item whose state can be read/written as JOYINFOEX structures
  63. // or CONTROL_ITEM_XFERs.
  64. class CJoyInfoExAxesItem : public CJoyInfoExControlItem, public CAxesItem
  65. {
  66. public:
  67. CJoyInfoExAxesItem(const CONTROL_ITEM_DESC *cpControlItemDesc);
  68. virtual HRESULT GetItemState(JOYINFOEX* pjix);
  69. virtual HRESULT SetItemState(JOYINFOEX* pjix);
  70. };
  71. ///////////////////////////////////////////////////////////////////////////////
  72. // @class CJoyInfoExDPADItem, which derives simultaneously from our
  73. // custom CJoyInfoExControlItem and the standard CDPADItem, implements
  74. // an item whose state can be read/written as JOYINFOEX structures
  75. // or CONTROL_ITEM_XFERs.
  76. class CJoyInfoExDPADItem : public CJoyInfoExControlItem, public CDPADItem
  77. {
  78. public:
  79. CJoyInfoExDPADItem(const CONTROL_ITEM_DESC *cpControlItemDesc);
  80. virtual HRESULT GetItemState(JOYINFOEX* pjix);
  81. virtual HRESULT SetItemState(JOYINFOEX* pjix);
  82. };
  83. ///////////////////////////////////////////////////////////////////////////////
  84. // @class CJoyInfoExPropDPADItem, which derives simultaneously from our
  85. // custom CJoyInfoExControlItem and the standard CPropDPADItem, implements
  86. // an item whose state can be read/written as JOYINFOEX structures
  87. // or CONTROL_ITEM_XFERs.
  88. class CJoyInfoExPropDPADItem : public CJoyInfoExControlItem, public CPropDPADItem
  89. {
  90. public:
  91. CJoyInfoExPropDPADItem(const CONTROL_ITEM_DESC *cpControlItemDesc);
  92. virtual HRESULT GetItemState(JOYINFOEX* pjix);
  93. virtual HRESULT SetItemState(JOYINFOEX* pjix);
  94. };
  95. ///////////////////////////////////////////////////////////////////////////////
  96. // @class CJoyInfoExButtonsItem, which derives simultaneously from our
  97. // custom CJoyInfoExControlItem and the standard CButtonsItem, implements
  98. // an item whose state can be read/written as JOYINFOEX structures
  99. // or CONTROL_ITEM_XFERs.
  100. class CJoyInfoExButtonsItem : public CJoyInfoExControlItem, public CButtonsItem
  101. {
  102. public:
  103. CJoyInfoExButtonsItem(const CONTROL_ITEM_DESC *cpControlItemDesc);
  104. virtual HRESULT GetItemState(JOYINFOEX* pjix);
  105. virtual HRESULT SetItemState(JOYINFOEX* pjix);
  106. };
  107. ///////////////////////////////////////////////////////////////////////////////
  108. // @class CJoyInfoExProfileSelectorsItem, which derives simultaneously from our
  109. // custom CJoyInfoExControlItem and the standard CProfileSelector, implements
  110. // an item whose state can be read/written as JOYINFOEX structures
  111. // or CONTROL_ITEM_XFERs.
  112. class CJoyInfoExProfileSelectorsItem : public CJoyInfoExControlItem, public CProfileSelector
  113. {
  114. public:
  115. CJoyInfoExProfileSelectorsItem(const CONTROL_ITEM_DESC *cpControlItemDesc);
  116. virtual HRESULT GetItemState(JOYINFOEX* pjix);
  117. virtual HRESULT SetItemState(JOYINFOEX* pjix);
  118. };
  119. ///////////////////////////////////////////////////////////////////////////////
  120. // @class CJoyInfoExPOVItem, which derives simultaneously from our
  121. // custom CJoyInfoExControlItem and the standard CPOVItem, implements
  122. // an item whose state can be read/written as JOYINFOEX structures
  123. // or CONTROL_ITEM_XFERs.
  124. class CJoyInfoExPOVItem : public CJoyInfoExControlItem, public CPOVItem
  125. {
  126. public:
  127. CJoyInfoExPOVItem(const CONTROL_ITEM_DESC *cpControlItemDesc);
  128. virtual HRESULT GetItemState(JOYINFOEX* pjix);
  129. virtual HRESULT SetItemState(JOYINFOEX* pjix);
  130. };
  131. ///////////////////////////////////////////////////////////////////////////////
  132. // @class CJoyInfoExThrottleItem, which derives simultaneously from our
  133. // custom CJoyInfoExControlItem and the standard CThrottleItem, implements
  134. // an item whose state can be read/written as JOYINFOEX structures
  135. // or CONTROL_ITEM_XFERs.
  136. class CJoyInfoExThrottleItem : public CJoyInfoExControlItem, public CThrottleItem
  137. {
  138. public:
  139. CJoyInfoExThrottleItem(const CONTROL_ITEM_DESC *cpControlItemDesc);
  140. virtual HRESULT GetItemState(JOYINFOEX* pjix);
  141. virtual HRESULT SetItemState(JOYINFOEX* pjix);
  142. };
  143. ///////////////////////////////////////////////////////////////////////////////
  144. // @class CJoyInfoExRudderItem, which derives simultaneously from our
  145. // custom CJoyInfoExControlItem and the standard CRudderItem, implements
  146. // an item whose state can be read/written as JOYINFOEX structures
  147. // or CONTROL_ITEM_XFERs.
  148. class CJoyInfoExRudderItem : public CJoyInfoExControlItem, public CRudderItem
  149. {
  150. public:
  151. CJoyInfoExRudderItem(const CONTROL_ITEM_DESC *cpControlItemDesc);
  152. virtual HRESULT GetItemState(JOYINFOEX* pjix);
  153. virtual HRESULT SetItemState(JOYINFOEX* pjix);
  154. };
  155. ///////////////////////////////////////////////////////////////////////////////
  156. // @class CJoyInfoExWheelItem, which derives simultaneously from our
  157. // custom CJoyInfoExControlItem and the standard CWheelItem, implements
  158. // an item whose state can be read/written as JOYINFOEX structures
  159. // or CONTROL_ITEM_XFERs.
  160. class CJoyInfoExWheelItem : public CJoyInfoExControlItem, public CWheelItem
  161. {
  162. public:
  163. CJoyInfoExWheelItem(const CONTROL_ITEM_DESC *cpControlItemDesc);
  164. virtual HRESULT GetItemState(JOYINFOEX* pjix);
  165. virtual HRESULT SetItemState(JOYINFOEX* pjix);
  166. };
  167. ///////////////////////////////////////////////////////////////////////////////
  168. // @class CJoyInfoExPedalItem, which derives simultaneously from our
  169. // custom CJoyInfoExControlItem and the standard CPedalItem, implements
  170. // an item whose state can be read/written as JOYINFOEX structures
  171. // or CONTROL_ITEM_XFERs.
  172. class CJoyInfoExPedalItem : public CJoyInfoExControlItem, public CPedalItem
  173. {
  174. public:
  175. CJoyInfoExPedalItem(const CONTROL_ITEM_DESC *cpControlItemDesc);
  176. virtual HRESULT GetItemState(JOYINFOEX* pjix);
  177. virtual HRESULT SetItemState(JOYINFOEX* pjix);
  178. };
  179. ///////////////////////////////////////////////////////////////////////////////
  180. // @class CJoyInfoExDualZoneIndicatorItem, which derives simultaneously from our
  181. // custom CJoyInfoExControlItem and the standard CDualZoneIndicatorItem, implements
  182. // an item whose state can be read/written as JOYINFOEX structures
  183. // or CONTROL_ITEM_XFERs.
  184. class CJoyInfoExDualZoneIndicatorItem : public CJoyInfoExControlItem, public CDualZoneIndicatorItem
  185. {
  186. public:
  187. CJoyInfoExDualZoneIndicatorItem(const CONTROL_ITEM_DESC *cpControlItemDesc);
  188. virtual HRESULT GetItemState(JOYINFOEX* pjix);
  189. virtual HRESULT SetItemState(JOYINFOEX* pjix);
  190. };
  191. #endif