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.

713 lines
14 KiB

  1. #if !defined( calltoContext_h )
  2. #define calltoContext_h
  3. //--------------------------------------------------------------------------//
  4. //--------------------------------------------------------------------------//
  5. // Application Header Files. //
  6. //--------------------------------------------------------------------------//
  7. #include "callto.h"
  8. #include "SDKInternal.h"
  9. //--------------------------------------------------------------------------//
  10. // interface IUIContext. //
  11. //--------------------------------------------------------------------------//
  12. class IUIContext
  13. {
  14. protected: // protected constructors --------------------------------//
  15. IUIContext(){};
  16. public: // public destructor ------------------------------------//
  17. virtual
  18. ~IUIContext(){};
  19. public: // public methods ----------------------------------------//
  20. virtual
  21. HRESULT
  22. disambiguate
  23. (
  24. ICalltoCollection * const calltoCollection,
  25. ICallto * const emptyCallto,
  26. const ICallto ** const selectedCallto
  27. ) = 0;
  28. }; // End of interface IUIContext.
  29. //--------------------------------------------------------------------------//
  30. // interface IMutableUIContext. //
  31. //--------------------------------------------------------------------------//
  32. class IMutableUIContext
  33. {
  34. protected: // protected constructors --------------------------------//
  35. IMutableUIContext(){};
  36. public: // public destructor ------------------------------------//
  37. virtual
  38. ~IMutableUIContext(){};
  39. public: // public methods ----------------------------------------//
  40. virtual
  41. void
  42. set_parentWindow
  43. (
  44. const HWND window
  45. ) = 0;
  46. virtual
  47. void
  48. set_callFlags
  49. (
  50. const DWORD callFlags
  51. ) = 0;
  52. }; // End of interface IMutableUIContext.
  53. //--------------------------------------------------------------------------//
  54. // class CUIContext. //
  55. //--------------------------------------------------------------------------//
  56. class CUIContext: public IUIContext,
  57. public IMutableUIContext
  58. {
  59. public: // public constructors ------------------------------------//
  60. CUIContext();
  61. public: // public destructor ------------------------------------//
  62. virtual
  63. ~CUIContext();
  64. public: // public methods (IUIContext) ------------------------//
  65. virtual
  66. HRESULT
  67. disambiguate
  68. (
  69. ICalltoCollection * const calltoCollection,
  70. ICallto * const emptyCallto,
  71. const ICallto ** const callto
  72. );
  73. public: // public methods (IMutableUIContext) --------------------//
  74. virtual
  75. void
  76. set_parentWindow
  77. (
  78. const HWND window
  79. );
  80. virtual
  81. void
  82. set_callFlags
  83. (
  84. const DWORD callFlags
  85. );
  86. private: // private members ----------------------------------------//
  87. HWND m_parent;
  88. DWORD m_callFlags;
  89. }; // End of class CUIContext.
  90. //--------------------------------------------------------------------------//
  91. // interface IGatekeeperContext. //
  92. //--------------------------------------------------------------------------//
  93. class IGatekeeperContext
  94. {
  95. protected: // protected constructors --------------------------------//
  96. IGatekeeperContext(){};
  97. public: // public destructor ------------------------------------//
  98. virtual
  99. ~IGatekeeperContext(){};
  100. public: // public methods ----------------------------------------//
  101. virtual
  102. bool
  103. isEnabled(void) const = 0;
  104. virtual
  105. const TCHAR *
  106. get_ipAddress(void) const = 0;
  107. }; // End of interface IGatekeeperContext.
  108. //--------------------------------------------------------------------------//
  109. // interface IMutableGatekeeperContext. //
  110. //--------------------------------------------------------------------------//
  111. class IMutableGatekeeperContext
  112. {
  113. protected: // protected constructors --------------------------------//
  114. IMutableGatekeeperContext(){};
  115. public: // public destructor ------------------------------------//
  116. virtual
  117. ~IMutableGatekeeperContext(){};
  118. public: // public methods ----------------------------------------//
  119. virtual
  120. void
  121. set_enabled
  122. (
  123. const bool enabled
  124. ) = 0;
  125. virtual
  126. HRESULT
  127. set_gatekeeperName
  128. (
  129. const TCHAR * const gatekeeperName
  130. ) = 0;
  131. }; // End of interface IMutableGatekeeperContext.
  132. //--------------------------------------------------------------------------//
  133. // class CGatekeeperContext. //
  134. //--------------------------------------------------------------------------//
  135. class CGatekeeperContext: public IGatekeeperContext,
  136. public IMutableGatekeeperContext
  137. {
  138. public: // public constructors ------------------------------------//
  139. CGatekeeperContext();
  140. public: // public destructor ------------------------------------//
  141. virtual
  142. ~CGatekeeperContext();
  143. public: // public methods (IGatekeeperContext) ----------------//
  144. virtual
  145. bool
  146. isEnabled(void) const;
  147. virtual
  148. const TCHAR *
  149. get_ipAddress(void) const;
  150. public: // public methods (IMutableGatekeeperContext) ------------//
  151. virtual
  152. void
  153. set_enabled
  154. (
  155. const bool enabled
  156. );
  157. virtual
  158. HRESULT
  159. set_gatekeeperName
  160. (
  161. const TCHAR * const gatekeeperName
  162. );
  163. private: // private methods ------------------------------------//
  164. virtual
  165. HRESULT
  166. set_ipAddress
  167. (
  168. const TCHAR * const ipAddress
  169. );
  170. private: // private members ----------------------------------------//
  171. bool m_enabled;
  172. TCHAR * m_ipAddress;
  173. }; // End of class CGatekeeperContext.
  174. //--------------------------------------------------------------------------//
  175. // interface IGatewayContext. //
  176. //--------------------------------------------------------------------------//
  177. class IGatewayContext
  178. {
  179. protected: // protected constructors --------------------------------//
  180. IGatewayContext(){};
  181. public: // public destructor ------------------------------------//
  182. virtual
  183. ~IGatewayContext(){};
  184. public: // public methods ----------------------------------------//
  185. virtual
  186. bool
  187. isEnabled(void) const = 0;
  188. virtual
  189. const TCHAR *
  190. get_ipAddress(void) const = 0;
  191. }; // End of interface IGatewayContext.
  192. //--------------------------------------------------------------------------//
  193. // interface IMutableGatewayContext. //
  194. //--------------------------------------------------------------------------//
  195. class IMutableGatewayContext
  196. {
  197. protected: // protected constructors --------------------------------//
  198. IMutableGatewayContext(){};
  199. public: // public destructor ------------------------------------//
  200. virtual
  201. ~IMutableGatewayContext(){};
  202. public: // public methods ----------------------------------------//
  203. virtual
  204. void
  205. set_enabled
  206. (
  207. const bool enabled
  208. ) = 0;
  209. virtual
  210. HRESULT
  211. set_gatewayName
  212. (
  213. const TCHAR * const gatewayName
  214. ) = 0;
  215. }; // End of interface IMutableGatewayContext.
  216. //--------------------------------------------------------------------------//
  217. // class CGatewayContext. //
  218. //--------------------------------------------------------------------------//
  219. class CGatewayContext: public IGatewayContext,
  220. public IMutableGatewayContext
  221. {
  222. public: // public constructors ------------------------------------//
  223. CGatewayContext();
  224. public: // public destructor ------------------------------------//
  225. virtual
  226. ~CGatewayContext();
  227. public: // public methods (IGatewayContext) --------------------//
  228. virtual
  229. bool
  230. isEnabled(void) const;
  231. virtual
  232. const TCHAR *
  233. get_ipAddress(void) const;
  234. public: // public methods (IMutableGatewayContext) ------------//
  235. virtual
  236. void
  237. set_enabled
  238. (
  239. const bool enabled
  240. );
  241. virtual
  242. HRESULT
  243. set_gatewayName
  244. (
  245. const TCHAR * const gatewayName
  246. );
  247. private: // private methods ----------------------------------------//
  248. virtual
  249. HRESULT
  250. set_ipAddress
  251. (
  252. const TCHAR * const ipAddress
  253. );
  254. private: // private members ----------------------------------------//
  255. bool m_enabled;
  256. TCHAR * m_ipAddress;
  257. }; // End of class CGatewayContext.
  258. //--------------------------------------------------------------------------//
  259. // interface IILSContext. //
  260. //--------------------------------------------------------------------------//
  261. class IILSContext
  262. {
  263. protected: // protected constructors --------------------------------//
  264. IILSContext(){};
  265. public: // public destructor ------------------------------------//
  266. virtual
  267. ~IILSContext(){};
  268. public: // public methods ----------------------------------------//
  269. virtual
  270. bool
  271. isEnabled(void) const = 0;
  272. virtual
  273. const TCHAR *
  274. get_ipAddress(void) const = 0;
  275. virtual
  276. const TCHAR * const
  277. get_ilsName(void) const = 0;
  278. }; // End of interface IILSContext.
  279. //--------------------------------------------------------------------------//
  280. // interface IMutableILSContext. //
  281. //--------------------------------------------------------------------------//
  282. class IMutableILSContext
  283. {
  284. protected: // protected constructors --------------------------------//
  285. IMutableILSContext(){};
  286. public: // public destructor ------------------------------------//
  287. virtual
  288. ~IMutableILSContext(){};
  289. public: // public methods ----------------------------------------//
  290. virtual
  291. void
  292. set_enabled
  293. (
  294. const bool enabled
  295. ) = 0;
  296. virtual
  297. HRESULT
  298. set_ilsName
  299. (
  300. const TCHAR * const ilsName
  301. ) = 0;
  302. }; // End of interface IMutableILSContext.
  303. //--------------------------------------------------------------------------//
  304. // class CILSContext. //
  305. //--------------------------------------------------------------------------//
  306. class CILSContext: public IILSContext,
  307. public IMutableILSContext
  308. {
  309. public: // public constructors ------------------------------------//
  310. CILSContext
  311. (
  312. const TCHAR * const ilsServer = NULL
  313. );
  314. public: // public destructor ------------------------------------//
  315. virtual
  316. ~CILSContext();
  317. public: // public methods (IILSContext) ------------------------//
  318. virtual
  319. bool
  320. isEnabled(void) const;
  321. virtual
  322. const TCHAR *
  323. get_ipAddress(void) const;
  324. virtual
  325. const TCHAR * const
  326. get_ilsName(void) const;
  327. public: // public methods (IMutableILSContext) ----------------//
  328. virtual
  329. void
  330. set_enabled
  331. (
  332. const bool enabled
  333. );
  334. virtual
  335. HRESULT
  336. set_ilsName
  337. (
  338. const TCHAR * const ilsName
  339. );
  340. private: // private methods ----------------------------------------//
  341. virtual
  342. HRESULT
  343. set_ipAddress
  344. (
  345. const TCHAR * const ipAddress
  346. );
  347. private: // private members ----------------------------------------//
  348. bool m_enabled;
  349. TCHAR * m_ipAddress;
  350. TCHAR * m_ilsName;
  351. }; // End of class CILSContext.
  352. //--------------------------------------------------------------------------//
  353. // interface ICalltoContext. //
  354. //--------------------------------------------------------------------------//
  355. class ICalltoContext
  356. {
  357. protected: // protected constructors --------------------------------//
  358. ICalltoContext(){};
  359. public: // public destructor ------------------------------------//
  360. virtual
  361. ~ICalltoContext(){}
  362. public: // public methods ----------------------------------------//
  363. virtual
  364. HRESULT
  365. callto
  366. (
  367. const ICalltoProperties * const calltoProperties,
  368. INmCall** ppInternalCall
  369. ) = 0;
  370. virtual
  371. const IGatekeeperContext * const
  372. get_gatekeeperContext(void) const = 0;
  373. virtual
  374. const IGatewayContext * const
  375. get_gatewayContext(void) const = 0;
  376. virtual
  377. const IILSContext * const
  378. get_ilsContext(void) const = 0;
  379. }; // End of interface ICalltoContext.
  380. //--------------------------------------------------------------------------//
  381. // interface IMutableCalltoContext. //
  382. //--------------------------------------------------------------------------//
  383. class IMutableCalltoContext
  384. {
  385. protected: // protected constructors --------------------------------//
  386. IMutableCalltoContext(){};
  387. public: // public destructor ------------------------------------//
  388. virtual
  389. ~IMutableCalltoContext(){}
  390. public: // public methods ----------------------------------------//
  391. virtual
  392. IMutableUIContext * const
  393. get_mutableUIContext(void) const = 0;
  394. virtual
  395. IMutableGatekeeperContext * const
  396. get_mutableGatekeeperContext(void) const = 0;
  397. virtual
  398. IMutableGatewayContext * const
  399. get_mutableGatewayContext(void) const = 0;
  400. virtual
  401. IMutableILSContext * const
  402. get_mutableIlsContext(void) const = 0;
  403. }; // End of interface IMutableCalltoContext.
  404. //--------------------------------------------------------------------------//
  405. // class CCalltoContext. //
  406. //--------------------------------------------------------------------------//
  407. class CCalltoContext: public ICalltoContext,
  408. public IMutableCalltoContext,
  409. public CUIContext,
  410. public CGatekeeperContext,
  411. public CGatewayContext,
  412. public CILSContext
  413. {
  414. public: // public constructors ------------------------------------//
  415. CCalltoContext();
  416. public: // public destructor ------------------------------------//
  417. virtual
  418. ~CCalltoContext();
  419. public: // public methods (ICalltoContext) --------------------//
  420. virtual
  421. HRESULT
  422. callto
  423. (
  424. const ICalltoProperties * const calltoProperties,
  425. INmCall** ppInternalCall
  426. );
  427. virtual
  428. const IGatekeeperContext * const
  429. get_gatekeeperContext(void) const;
  430. virtual
  431. const IGatewayContext * const
  432. get_gatewayContext(void) const;
  433. virtual
  434. const IILSContext * const
  435. get_ilsContext(void) const;
  436. public: // public methods (IMutableCalltoContext) ----------------//
  437. virtual
  438. IMutableUIContext * const
  439. get_mutableUIContext(void) const;
  440. virtual
  441. IMutableGatekeeperContext * const
  442. get_mutableGatekeeperContext(void) const;
  443. virtual
  444. IMutableGatewayContext * const
  445. get_mutableGatewayContext(void) const;
  446. virtual
  447. IMutableILSContext * const
  448. get_mutableIlsContext(void) const;
  449. public: // public static methods ------------------------------------//
  450. static
  451. bool
  452. isPhoneNumber
  453. (
  454. const TCHAR * phone
  455. );
  456. static
  457. bool
  458. toE164
  459. (
  460. const TCHAR * phone,
  461. TCHAR * base10,
  462. int size
  463. );
  464. static
  465. bool
  466. isIPAddress
  467. (
  468. const TCHAR * const ipAddress
  469. );
  470. static
  471. HRESULT
  472. get_ipAddressFromName
  473. (
  474. const TCHAR * const name,
  475. TCHAR * buffer,
  476. int length
  477. );
  478. static
  479. HRESULT
  480. get_ipAddressFromILSEmail
  481. (
  482. const TCHAR * const ilsServer,
  483. const TCHAR * const ilsPort,
  484. const TCHAR * const email,
  485. TCHAR * const ipAddress,
  486. const int size
  487. );
  488. }; // End of class CCalltoContext.
  489. //--------------------------------------------------------------------------//
  490. #endif // !defined( calltoContext_h )