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.

177 lines
3.1 KiB

  1. /*++
  2. Copyright (C) Microsoft Corporation, 1998 - 1998
  3. All rights reserved.
  4. Module Name:
  5. select.hxx
  6. Abstract:
  7. Command/Selection handling.
  8. Command line argument selection
  9. Author:
  10. Steve Kiraly (SteveKi) Feb-26-1998
  11. Revision History:
  12. --*/
  13. #ifndef _SELECT_HXX
  14. #define _SELECT_HXX
  15. class MPrinterClient;
  16. class TPrinter;
  17. /********************************************************************
  18. Command/Selection handling.
  19. ********************************************************************/
  20. class TSelection {
  21. SIGNATURE( 'sel' )
  22. public:
  23. enum COMMAND_TYPE {
  24. kCommandTypePrinter = 1, // Printer command argument
  25. kCommandTypeJob = 2, // Print Job command
  26. kCommandTypePrinterAttributes = 3, // Printer command attribute change
  27. };
  28. COUNT _cSelected;
  29. VAR( PIDENT, pid );
  30. DLINK( TSelection, Selection );
  31. COMMAND_TYPE _CommandType;
  32. DWORD _dwCommandAction;
  33. TSelection(
  34. const MPrinterClient* pPrinterClient,
  35. const TPrinter* pPrinter
  36. );
  37. ~TSelection(
  38. VOID
  39. );
  40. BOOL
  41. bValid(
  42. VOID
  43. ) const
  44. {
  45. return _pid != NULL;
  46. }
  47. };
  48. /********************************************************************
  49. Command line argument selection
  50. ********************************************************************/
  51. class TSelect
  52. {
  53. SIGNATURE( 'selt' )
  54. public:
  55. enum EDataType
  56. {
  57. kString,
  58. kInt,
  59. kBitTable,
  60. kValTable,
  61. kNone,
  62. };
  63. enum EOperation
  64. {
  65. kOr,
  66. kNot,
  67. kAnd,
  68. kXor,
  69. kNop,
  70. };
  71. struct Selection
  72. {
  73. UINT iKeyWord;
  74. EDataType eDataType;
  75. PVOID pTable;
  76. UINT iOffset;
  77. };
  78. struct SelectionBit
  79. {
  80. UINT iKeyWord;
  81. UINT uBit;
  82. EOperation Op;
  83. };
  84. struct SelectionVal
  85. {
  86. UINT iKeyWord;
  87. UINT uValue;
  88. UINT iOffset;
  89. };
  90. TSelect(
  91. VOID
  92. );
  93. ~TSelect(
  94. VOID
  95. );
  96. BOOL
  97. bValid(
  98. VOID
  99. );
  100. BOOL
  101. bLookup(
  102. IN Selection *pSelection,
  103. IN PVOID pInfo,
  104. IN LPCTSTR pKey,
  105. IN LPCTSTR pValue
  106. );
  107. BOOL
  108. bApplyBitTableToValue(
  109. IN SelectionBit *pBitTable,
  110. IN UINT uBit,
  111. IN LPDWORD pdwBit
  112. );
  113. BOOL
  114. TSelect::
  115. bLookupBitTable(
  116. IN SelectionBit *pBitTable,
  117. IN LPCTSTR pKey
  118. );
  119. BOOL
  120. TSelect::
  121. bLookupValTable(
  122. IN SelectionVal *pValTable,
  123. IN PVOID pInfo,
  124. IN LPCTSTR pKey
  125. );
  126. BOOL
  127. TSelect::
  128. bMatch(
  129. IN LPCTSTR pszString,
  130. IN UINT iResId
  131. );
  132. };
  133. #endif // _SELECT_HXX