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.

106 lines
4.1 KiB

  1. // =================================================================================
  2. // S T A T N E R Y . H
  3. // =================================================================================
  4. #ifndef __STATNERY_H
  5. #define __STATNERY
  6. // =================================================================================
  7. // Depends On
  8. // =================================================================================
  9. class CStatWiz;
  10. class ListEntry
  11. {
  12. friend class CStationery;
  13. private:
  14. ListEntry();
  15. ~ListEntry();
  16. ULONG AddRef(VOID);
  17. ULONG Release(VOID);
  18. HRESULT HrInit(LPWSTR pwszFile);
  19. ULONG m_cRef;
  20. LPWSTR m_pwszFile;
  21. ListEntry* m_pNext;
  22. };
  23. typedef ListEntry *LPLISTENTRY;
  24. class CStationery
  25. {
  26. private:
  27. ULONG m_cRef;
  28. LPLISTENTRY m_pFirst;
  29. CRITICAL_SECTION m_rCritSect;
  30. INT cEntries();
  31. LPLISTENTRY RemoveEntry(INT iIndex);
  32. HRESULT HrInsertEntry(LPLISTENTRY pEntry);
  33. public:
  34. CStationery();
  35. ~CStationery();
  36. ULONG AddRef(VOID);
  37. ULONG Release(VOID);
  38. HRESULT HrInsertEntry(LPWSTR pwszFile);
  39. HRESULT HrPromoteEntry(INT iIndex);
  40. HRESULT HrDeleteEntry(INT iIndex);
  41. HRESULT HrLoadStationeryList();
  42. VOID AddStationeryMenu(HMENU hmenu, int idFirst, int idMore);
  43. VOID GetStationeryMenu(HMENU *phmenu);
  44. HRESULT HrGetFileName(INT iIndex, LPWSTR wszBuf);
  45. LPLISTENTRY MoveToEntry(INT iIndex);
  46. HRESULT HrFindEntry(LPWSTR pwszFile, INT* pRet);
  47. BOOL fValidIndex(INT iIndex);
  48. void SaveStationeryList();
  49. HRESULT HrGetShowNames(LPWSTR pwszFile, LPWSTR pwszszBuf, int cchBuf, INT index);
  50. VOID ValidateList(BOOL fCheckExist);
  51. };
  52. typedef CStationery *LPSTATIONERY;
  53. // New Stationary Source types
  54. enum {
  55. NSS_DEFAULT = 0,
  56. NSS_MRU,
  57. NSS_MORE_DIALOG
  58. };
  59. // =================================================================================
  60. // Prototypes
  61. // =================================================================================
  62. void AddStationeryMenu(HMENU hmenu, int idPopup, int idFirst, int idMore);
  63. void GetStationeryMenu(HMENU *phmenu);
  64. HRESULT HrNewStationery(HWND hwnd, INT id, LPWSTR pwszFileName,
  65. BOOL fModal, BOOL fMail, FOLDERID folderID,
  66. BOOL fAddToMRU, DWORD dwSource, IUnknown *pUnkPump,
  67. IMimeMessage *pMsg);
  68. HRESULT HrMoreStationery(HWND hwnd, BOOL fModal, BOOL fMail, FOLDERID folderID, IUnknown *pUnkPump);
  69. HRESULT HrGetStationeryFileName(INT index, LPWSTR pwszFileName);
  70. HRESULT HrGetMoreStationeryFileName(HWND hwnd, LPWSTR pwszFileName);
  71. HRESULT HrGetStationeryPath(LPWSTR pwszPath);
  72. HRESULT HrAddToStationeryMRU(LPWSTR pwszFile);
  73. HRESULT HrRemoveFromStationeryMRU(LPWSTR pwszFile);
  74. VOID InsertStationeryDir(LPWSTR pwszPicture);
  75. BOOL GetStationeryFullName(LPWSTR pwszName);
  76. BOOL IsValidCreateFileName(LPWSTR pwszFile);
  77. LRESULT StationeryListBox_AddString(HWND hwndList, LPWSTR pwszFileName);
  78. LRESULT StationeryListBox_SelectString(HWND hwndList, LPWSTR pwszFileName);
  79. LRESULT StationeryComboBox_SelectString(HWND hwndCombo, LPWSTR pwszFileName);
  80. HRESULT HrLoadStationery(HWND hwndList, LPWSTR pwszStationery);
  81. HRESULT HrBrowseStationery(HWND hwndParent, HWND hwndList);
  82. HRESULT HrFillStationeryCombo(HWND hwndCombo, BOOL fBackGround, LPWSTR pwszPicture);
  83. LRESULT PictureComboBox_AddString(HWND hwndCombo, LPWSTR pwszPicture);
  84. HRESULT HrBrowsePicture(HWND hwndParent, HWND hwndCombo);
  85. HRESULT ShowPreview(HWND hwnd, LPWSTR pwszFile);
  86. HRESULT ShowPreview(HWND hwnd, CStatWiz* pApp, INT idsSample);
  87. HRESULT FillHtmlToFile(CStatWiz* pApp, HANDLE hFile, INT idsSample, BOOL fTemp);
  88. HRESULT StripStationeryDir(LPWSTR pwszPicture);
  89. HRESULT GetDefaultStationeryName(BOOL fMail, LPWSTR pwszName);
  90. HRESULT SetDefaultStationeryName(BOOL fMail, LPWSTR pwszName);
  91. #endif // __STATNERY_H