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.

165 lines
4.3 KiB

  1. /****************************************************************************
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name: rules.h
  4. Abstract: Rules Object definitions
  5. Author: noela - 09/11/98
  6. Notes:
  7. Rev History:
  8. ****************************************************************************/
  9. #ifndef __RULES_H_
  10. #define __RULES_H_
  11. #include "utils.h"
  12. #include "list.h"
  13. #include "loc_comn.h"
  14. #include "client.h"
  15. #include "clntprivate.h"
  16. class CAreaCodeProcessingRule;
  17. //***************************************************************************
  18. //
  19. // Class Definition - CRuleSet
  20. //
  21. //***************************************************************************
  22. class CRuleSet
  23. {
  24. public:
  25. PWSTR m_pszInternationalRule;
  26. PWSTR m_pszLongDistanceRule;
  27. PWSTR m_pszLocalRule;
  28. CRuleSet();
  29. ~CRuleSet();
  30. #ifdef TRACELOG
  31. DECLARE_TRACELOG_CLASS(CRuleSet)
  32. #endif
  33. STDMETHOD(Initialize) ( PWSTR pszInternationalRule,
  34. PWSTR pszLongDistanceRule,
  35. PWSTR pszLocalRule
  36. );
  37. };
  38. //***************************************************************************
  39. //
  40. // Class Definition - CAreaCodeRule
  41. //
  42. //***************************************************************************
  43. class CAreaCodeRule
  44. {
  45. private:
  46. PWSTR m_pszAreaCode;
  47. PWSTR m_pszNumberToDial;
  48. DWORD m_dwOptions;
  49. PWSTR m_pszzPrefixList; // contains REG_MULTI_SZ data
  50. // An array of null-terminated strings,
  51. // terminated by two null characters.
  52. DWORD m_dwPrefixListSize; // Size, in bytes, of the prefix list
  53. public:
  54. CAreaCodeRule();
  55. ~CAreaCodeRule();
  56. #ifdef TRACELOG
  57. DECLARE_TRACELOG_CLASS(CAreaCodeRule)
  58. #endif
  59. STDMETHOD(Initialize) ( PWSTR pszAreaCode,
  60. PWSTR pszNumberToDial,
  61. DWORD dwOptions,
  62. PWSTR pszzPrefixList,
  63. DWORD dwPrefixListSize
  64. );
  65. BOOL HasDialAreaCode() {return m_dwOptions & RULE_DIALAREACODE;}
  66. void SetDialAreaCode(BOOL bDa);
  67. BOOL HasDialNumber() {return m_dwOptions & RULE_DIALNUMBER;}
  68. void SetDialNumber(BOOL bDn);
  69. BOOL HasAppliesToAllPrefixes(){return m_dwOptions & RULE_APPLIESTOALLPREFIXES;}
  70. void SetAppliesToAllPrefixes(BOOL bApc);
  71. PWSTR GetAreaCode(){return m_pszAreaCode;}
  72. STDMETHOD (SetAreaCode)(PWSTR pszAreaCode);
  73. PWSTR GetNumberToDial(){return m_pszNumberToDial;}
  74. STDMETHOD (SetNumberToDial)(PWSTR pszNumberToDial);
  75. DWORD GetPrefixListSize(){return m_dwPrefixListSize;}
  76. PWSTR GetPrefixList(){return m_pszzPrefixList;}
  77. STDMETHOD (SetPrefixList)(PWSTR pszzPrefixList, DWORD dwSize);
  78. DWORD TapiSize();
  79. DWORD GetOptions(){return m_dwOptions;}
  80. void BuildProcessingRule(CAreaCodeProcessingRule * pRule);
  81. };
  82. /////////////////////////////////////////////
  83. // Fill out the list template
  84. //
  85. typedef LinkedList<CAreaCodeRule*> AreaCodeRulePtrList;
  86. typedef ListNode<CAreaCodeRule*> AreaCodeRulePtrNode;
  87. //***************************************************************************
  88. STDMETHODIMP CreateDialingRule
  89. (
  90. PWSTR *pszRule,
  91. PWSTR pszNumberToDial,
  92. BOOL bDialAreaCode
  93. );
  94. #if DBG
  95. #define ClientAllocString( __psz__ ) ClientAllocStringReal( __psz__, __LINE__, __FILE__ )
  96. PWSTR ClientAllocStringReal(PCWSTR psz,
  97. DWORD dwLine,
  98. PSTR pszFile
  99. );
  100. #else
  101. #define ClientAllocString( __psz__ ) ClientAllocStringReal( __psz__ )
  102. PWSTR ClientAllocStringReal(PCWSTR psz );
  103. #endif
  104. #endif //__RULES_H_