Source code of Windows XP (NT5)
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.

136 lines
4.9 KiB

  1. //*********************************************************************
  2. //* Microsoft Windows **
  3. //* Copyright(c) Microsoft Corp., 1999 **
  4. //*********************************************************************
  5. //
  6. // USERINFO.H - Header for the implementation of CTapiLocationInfo
  7. //
  8. // HISTORY:
  9. //
  10. // 1/27/99 vyung Created.
  11. //
  12. #ifndef __TAPILOCATIONINFO_H_
  13. #define __TAPILOCATIONINFO_H_
  14. #include <windows.h>
  15. #include <tapi.h>
  16. #include <ras.h>
  17. #include <assert.h>
  18. #include <oleauto.h>
  19. #define TAPI_PATH_LOCATIONS \
  20. L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Telephony\\Locations"
  21. #define TAPI_PATH_LOC0 \
  22. L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Telephony\\Locations\\Location0"
  23. #define TAPI_LOCATION L"Location"
  24. #define TAPI_AREACODE L"AreaCode"
  25. #define TAPI_COUNTRY L"Country"
  26. #define TAPILOCKEY L"Locations"
  27. #define TAPI_FLAG L"Flags"
  28. #define TAPI_CALLWAIT L"DisableCallWaiting"
  29. #define TAPI_ID L"ID"
  30. #define NULL_SZ L"\0"
  31. #define TAPI_NAME L"Name"
  32. #define TAPI_OUTSIDE L"OutsideAccess"
  33. #define TAPI_LONGDIST L"LongDistanceAccess"
  34. #define TAPI_CURRENTID L"CurrentID"
  35. #define TAPI_NUMENTRIES L"NumEntries"
  36. #define TAPI_NEXTID L"NextID"
  37. static const WCHAR szOptionTag[] = L"<OPTION>%ws</OPTION>";
  38. typedef LONG (WINAPI * LINEGETCOUNTRY) ( DWORD dwCountryID,
  39. DWORD dwAPIVersion,
  40. LPLINECOUNTRYLIST lpLineCountryList
  41. );
  42. typedef struct tagCNTRYNAMELOOKUPELEMENT {
  43. // psCountryName is an LPSTR because it points to an ANSI string in a
  44. // LINECOUNTRYLIST structure.
  45. //
  46. LPWSTR psCountryName;
  47. DWORD dwNameSize;
  48. LPLINECOUNTRYENTRY pLCE;
  49. } CNTRYNAMELOOKUPELEMENT, far *LPCNTRYNAMELOOKUPELEMENT;
  50. class CTapiLocationInfo : public IDispatch
  51. {
  52. // ITapiLocationInfo
  53. public:
  54. STDMETHOD(GetNumCountries) (long *plNumOfCountry);
  55. STDMETHOD(GetCountryName) (long lCountryIndex, BSTR * pszCountryName);
  56. STDMETHOD(GetAllCountryName) (BSTR *pbstrAllCountryName);
  57. STDMETHOD(GetlCountryIndex) (long *plVal);
  58. STDMETHOD(SetlCountryIndex) (long lVal);
  59. STDMETHOD(GetDefaultCountry) (long* lCountryIndex);
  60. STDMETHOD(PutCountry) (long lCountryIndex);
  61. STDMETHOD(GetbstrAreaCode) (BSTR *pbstrAreaCode);
  62. STDMETHOD(PutbstrAreaCode) (BSTR bstrAreaCode);
  63. STDMETHOD(IsAreaCodeRequired)(long lVal, BOOL* pbVal);
  64. STDMETHOD(GetOutsideDial) (BSTR *pbstrOutside);
  65. STDMETHOD(PutOutsideDial) (BSTR bstrOutside);
  66. STDMETHOD(GetPhoneSystem) (long* plTone);
  67. STDMETHOD(PutPhoneSystem) (long lTone);
  68. STDMETHOD(GetCallWaiting) (BSTR *pbstrCallWaiting);
  69. STDMETHOD(PutCallWaiting) (BSTR bstrCallWaiting);
  70. CTapiLocationInfo();
  71. ~CTapiLocationInfo();
  72. STDMETHOD(InitTapiInfo) (BOOL *pbRetVal);
  73. STDMETHOD(GetCountryID) (DWORD* dwCountryID);
  74. STDMETHOD(GetCountryCode) (DWORD* dwCountryCode);
  75. STDMETHOD(TapiServiceRunning) (BOOL *pbRetVal);
  76. // IUnknown Interfaces
  77. STDMETHODIMP QueryInterface (REFIID riid, LPVOID* ppvObj);
  78. STDMETHODIMP_(ULONG) AddRef ();
  79. STDMETHODIMP_(ULONG) Release ();
  80. //IDispatch Interfaces
  81. STDMETHOD (GetTypeInfoCount) (UINT* pcInfo);
  82. STDMETHOD (GetTypeInfo) (UINT, LCID, ITypeInfo** );
  83. STDMETHOD (GetIDsOfNames) (REFIID, OLECHAR**, UINT, LCID, DISPID* );
  84. STDMETHOD (Invoke) (DISPID dispidMember, REFIID riid, LCID lcid,
  85. WORD wFlags, DISPPARAMS* pdispparams,
  86. VARIANT* pvarResult, EXCEPINFO* pexcepinfo,
  87. UINT* puArgErr);
  88. void DeleteTapiInfo ();
  89. void CheckModemCountry ();
  90. protected:
  91. HLINEAPP m_hLineApp;
  92. WORD m_wNumTapiLocations;
  93. DWORD m_dwCountryID;
  94. DWORD m_dwCountrycode;
  95. DWORD m_dwCurrLoc;
  96. WCHAR m_szAreaCode[RAS_MaxAreaCode+1];
  97. WCHAR m_szDialOut[RAS_MaxAreaCode+1];
  98. WCHAR m_szCallWaiting[MAX_PATH];
  99. BSTR m_bstrDefaultCountry;
  100. LPLINECOUNTRYLIST m_pLineCountryList;
  101. LPCNTRYNAMELOOKUPELEMENT m_rgNameLookUp;
  102. LPLINELOCATIONENTRY m_plle;
  103. LPLINETRANSLATECAPS m_pTC;
  104. long m_lNumOfCountry;
  105. BOOL m_bTapiAvailable;
  106. DWORD m_dwComboCountryIndex;
  107. ULONG m_cRef;
  108. LPWSTR m_szAllCountryPairs;
  109. BOOL m_bTapiCountrySet;
  110. BOOL m_bCheckModemCountry;
  111. };
  112. #endif