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.

148 lines
3.9 KiB

  1. // ViewRow.h: interface for the CViewRow class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_VIEWROW_H__6BEB111C_C0F4_46DD_A28A_0BFEE31CA6EF__INCLUDED_)
  5. #define AFX_VIEWROW_H__6BEB111C_C0F4_46DD_A28A_0BFEE31CA6EF__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. //
  10. // List of ids for images in the image list used for icons in the list view
  11. //
  12. typedef enum
  13. {
  14. INVALID = -1,
  15. LIST_IMAGE_PARTIALLY_RECEIVED,
  16. LIST_IMAGE_NORMAL_MESSAGE,
  17. LIST_IMAGE_RECEIVING,
  18. LIST_IMAGE_ROUTING,
  19. LIST_IMAGE_ERROR,
  20. LIST_IMAGE_PAUSED,
  21. LIST_IMAGE_SENDING,
  22. LIST_IMAGE_SUCCESS,
  23. LIST_IMAGE_COVERPAGE
  24. } IconType;
  25. //
  26. // Items available for a view
  27. //
  28. typedef enum
  29. {
  30. //
  31. // common items
  32. //
  33. MSG_VIEW_ITEM_ICON,
  34. MSG_VIEW_ITEM_STATUS,
  35. MSG_VIEW_ITEM_SERVER,
  36. MSG_VIEW_ITEM_NUM_PAGES,
  37. MSG_VIEW_ITEM_CSID,
  38. MSG_VIEW_ITEM_TSID,
  39. MSG_VIEW_ITEM_SIZE,
  40. MSG_VIEW_ITEM_DEVICE,
  41. MSG_VIEW_ITEM_RETRIES,
  42. MSG_VIEW_ITEM_ID,
  43. MSG_VIEW_ITEM_BROADCAST_ID,
  44. MSG_VIEW_ITEM_CALLER_ID,
  45. MSG_VIEW_ITEM_ROUTING_INFO,
  46. MSG_VIEW_ITEM_DOC_NAME,
  47. MSG_VIEW_ITEM_SUBJECT,
  48. MSG_VIEW_ITEM_RECIPIENT_NAME,
  49. MSG_VIEW_ITEM_RECIPIENT_NUMBER,
  50. MSG_VIEW_ITEM_USER,
  51. MSG_VIEW_ITEM_PRIORITY,
  52. MSG_VIEW_ITEM_ORIG_TIME,
  53. MSG_VIEW_ITEM_SUBMIT_TIME,
  54. MSG_VIEW_ITEM_BILLING,
  55. MSG_VIEW_ITEM_TRANSMISSION_START_TIME,
  56. //
  57. // job specific
  58. //
  59. MSG_VIEW_ITEM_SEND_TIME,
  60. MSG_VIEW_ITEM_EXTENDED_STATUS,
  61. MSG_VIEW_ITEM_CURRENT_PAGE,
  62. //
  63. // message specific
  64. //
  65. MSG_VIEW_ITEM_SENDER_NAME,
  66. MSG_VIEW_ITEM_SENDER_NUMBER,
  67. MSG_VIEW_ITEM_TRANSMISSION_END_TIME,
  68. MSG_VIEW_ITEM_TRANSMISSION_DURATION,
  69. //
  70. // End of list (unused)
  71. //
  72. MSG_VIEW_ITEM_END
  73. } MsgViewItemType;
  74. class CViewRow
  75. {
  76. public:
  77. CViewRow() :
  78. m_pMsg(NULL),
  79. m_bAttached(FALSE),
  80. m_bStringsPreparedForDisplay(FALSE)
  81. {}
  82. virtual ~CViewRow() {}
  83. DWORD AttachToMsg(CFaxMsg *pMsg, BOOL PrepareStrings=TRUE);
  84. int CompareByItem (CViewRow &other, DWORD item);
  85. IconType GetIcon () const
  86. { ASSERT (m_bAttached); return m_Icon; }
  87. static DWORD InitStrings ();
  88. static DWORD GetItemTitle (DWORD, CString &);
  89. static int GetItemAlignment (DWORD item)
  90. { ASSERT (item >=0 && item < MSG_VIEW_ITEM_END); return m_Alignments[item]; }
  91. const CString &GetItemString (DWORD item) const
  92. {
  93. ASSERT (m_bAttached && item >=0 && item < MSG_VIEW_ITEM_END);
  94. ASSERT (MSG_VIEW_ITEM_ICON != item);
  95. ASSERT (m_bStringsPreparedForDisplay);
  96. return m_Strings[item];
  97. }
  98. static BOOL IsItemIcon (DWORD item)
  99. { return (MSG_VIEW_ITEM_ICON == item); }
  100. protected:
  101. CFaxMsg* m_pMsg;
  102. BOOL m_bAttached; // Are we attached to the job / message?
  103. IconType m_Icon; // Icon id of job / message
  104. BOOL m_bStringsPreparedForDisplay; // Is m_Strings valid?
  105. CString m_Strings[MSG_VIEW_ITEM_END]; // String representation of
  106. // item's data
  107. static CString m_cstrPriorities[FAX_PRIORITY_TYPE_HIGH+1];
  108. static CString m_cstrQueueStatus[NUM_JOB_STATUS];
  109. static CString m_cstrQueueExtendedStatus[JS_EX_CALL_ABORTED - JS_EX_DISCONNECTED + 1];
  110. static CString m_cstrMessageStatus[2];
  111. static int m_Alignments[MSG_VIEW_ITEM_END];
  112. static int m_TitleResources[MSG_VIEW_ITEM_END];
  113. DWORD DetachFromMsg();
  114. IconType CalcIcon(CFaxMsg *pMsg);
  115. private:
  116. IconType CalcJobIcon(CFaxMsg *pJob);
  117. IconType CalcMessageIcon(CFaxMsg *pMsg);
  118. DWORD InitStatusStr(CFaxMsg *pMsg);
  119. DWORD InitExtStatusStr(CFaxMsg *pMsg);
  120. };
  121. #endif // !defined(AFX_VIEWROW_H__6BEB111C_C0F4_46DD_A28A_0BFEE31CA6EF__INCLUDED_)