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.

205 lines
5.0 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. faxext.h
  5. Abstract:
  6. Fax exchange client extension header file.
  7. Author:
  8. Wesley Witt (wesw) 13-Aug-1996
  9. --*/
  10. #ifndef _FAXEXT_H_
  11. #define _FAXEXT_H_
  12. #include <windows.h>
  13. #include <winspool.h>
  14. #include <mapiwin.h>
  15. #include <mapispi.h>
  16. #include <mapiutil.h>
  17. #include <mapicode.h>
  18. #include <mapival.h>
  19. #include <mapiwz.h>
  20. #include <mapix.h>
  21. #include <mapiutil.h>
  22. #include <mapiform.h>
  23. #include <mapiguid.h>
  24. #include <richedit.h>
  25. #include <shlobj.h>
  26. #include <shellapi.h>
  27. #include <commdlg.h>
  28. #include <exchext.h>
  29. #include <tapi.h>
  30. #include <tchar.h>
  31. #include <stdio.h>
  32. #include <winfax.h>
  33. #include "resource.h"
  34. #include "faxmapip.h"
  35. #include "faxreg.h"
  36. #include "faxutil.h"
  37. #define FAXUTIL_DEBUG
  38. #define FAXUTIL_MEM
  39. #define FAXUTIL_STRING
  40. #define FAXUTIL_SUITE
  41. #define FAXUTIL_REG
  42. #include <faxutil.h>
  43. #define FAX_DRIVER_NAME "Windows NT Fax Driver"
  44. #define LNK_FILENAME_EXT ".lnk"
  45. #define CP_FILENAME_EXT ".cov"
  46. #define MAX_FILENAME_EXT 4
  47. #define CPFLAG_LINK 0x0100
  48. LPVOID
  49. MapiMemAlloc(
  50. DWORD Size
  51. );
  52. VOID
  53. MapiMemFree(
  54. LPVOID ptr
  55. );
  56. INT_PTR CALLBACK
  57. ConfigDlgProc(
  58. HWND hDlg,
  59. UINT message,
  60. WPARAM wParam,
  61. LPARAM lParam
  62. );
  63. PVOID
  64. MyGetPrinter(
  65. LPSTR PrinterName,
  66. DWORD level
  67. );
  68. LPSTR
  69. GetServerName(
  70. LPSTR PrinterName
  71. );
  72. class MyExchExt;
  73. class MyExchExtCommands;
  74. class MyExchExtUserEvents;
  75. extern "C"
  76. {
  77. LPEXCHEXT CALLBACK ExchEntryPoint(void);
  78. }
  79. class MyExchExt : public IExchExt
  80. {
  81. public:
  82. MyExchExt ();
  83. STDMETHODIMP QueryInterface
  84. (REFIID riid,
  85. LPVOID * ppvObj);
  86. inline STDMETHODIMP_(ULONG) AddRef
  87. () { ++m_cRef; return m_cRef; };
  88. inline STDMETHODIMP_(ULONG) Release
  89. () { ULONG ulCount = --m_cRef;
  90. if (!ulCount) { delete this; }
  91. return ulCount;};
  92. STDMETHODIMP Install (LPEXCHEXTCALLBACK pmecb,
  93. ULONG mecontext, ULONG ulFlags);
  94. private:
  95. ULONG m_cRef;
  96. UINT m_context;
  97. MyExchExtUserEvents * m_pExchExtUserEvents;
  98. MyExchExtCommands * m_pExchExtCommands;
  99. };
  100. class MyExchExtCommands : public IExchExtCommands
  101. {
  102. public:
  103. MyExchExtCommands();
  104. ~MyExchExtCommands();
  105. STDMETHODIMP QueryInterface
  106. (REFIID riid,
  107. LPVOID * ppvObj);
  108. inline STDMETHODIMP_(ULONG) AddRef
  109. () { ++m_cRef; return m_cRef; };
  110. inline STDMETHODIMP_(ULONG) Release
  111. () { ULONG ulCount = --m_cRef;
  112. if (!ulCount) { delete this; }
  113. return ulCount;};
  114. STDMETHODIMP InstallCommands(LPEXCHEXTCALLBACK pmecb,
  115. HWND hwnd, HMENU hmenu,
  116. UINT FAR * cmdidBase, LPTBENTRY lptbeArray,
  117. UINT ctbe, ULONG ulFlags);
  118. STDMETHODIMP DoCommand(LPEXCHEXTCALLBACK pmecb, UINT mni);
  119. STDMETHODIMP_(VOID) InitMenu(LPEXCHEXTCALLBACK pmecb);
  120. STDMETHODIMP Help(LPEXCHEXTCALLBACK pmecb, UINT mni);
  121. STDMETHODIMP QueryHelpText(UINT mni, ULONG ulFlags, LPTSTR sz, UINT cch);
  122. STDMETHODIMP QueryButtonInfo(ULONG tbid, UINT itbb, LPTBBUTTON ptbb,
  123. LPTSTR lpsz, UINT cch, ULONG ulFlags);
  124. STDMETHODIMP ResetToolbar(ULONG tbid, ULONG ulFlags);
  125. inline VOID SetContext
  126. (ULONG eecontext) { m_context = eecontext; };
  127. inline UINT GetCmdID() { return m_cmdid; };
  128. inline HWND GetToolbarHWND() { return m_hwndToolbar; }
  129. private:
  130. ULONG m_cRef; //
  131. ULONG m_context; //
  132. UINT m_cmdid; // cmdid for menu extension command
  133. UINT m_itbb; // toolbar index
  134. HWND m_hwndToolbar; // toolbar window handle
  135. UINT m_itbm; //
  136. HWND m_hWnd; //
  137. FAXXP_CONFIG FaxConfig;
  138. };
  139. class MyExchExtUserEvents : public IExchExtUserEvents
  140. {
  141. public:
  142. MyExchExtUserEvents() { m_cRef = 0; m_context = 0;
  143. m_pExchExt = NULL; };
  144. STDMETHODIMP QueryInterface
  145. (REFIID riid,
  146. LPVOID * ppvObj);
  147. inline STDMETHODIMP_(ULONG) AddRef
  148. () { ++m_cRef; return m_cRef; };
  149. inline STDMETHODIMP_(ULONG) Release
  150. () { ULONG ulCount = --m_cRef;
  151. if (!ulCount) { delete this; }
  152. return ulCount;};
  153. STDMETHODIMP_(VOID) OnSelectionChange(LPEXCHEXTCALLBACK pmecb);
  154. STDMETHODIMP_(VOID) OnObjectChange(LPEXCHEXTCALLBACK pmecb);
  155. inline VOID SetContext
  156. (ULONG eecontext) { m_context = eecontext; };
  157. inline VOID SetIExchExt
  158. (MyExchExt * pExchExt) { m_pExchExt = pExchExt; };
  159. private:
  160. ULONG m_cRef;
  161. ULONG m_context;
  162. MyExchExt * m_pExchExt;
  163. };
  164. #endif // _FAXEXT_H_