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.

200 lines
4.9 KiB

  1. /*++
  2. Copyright (c) 1998 Microsoft Corporation
  3. Module Name:
  4. FTMan
  5. File Name:
  6. FTManDef.h
  7. Abstract:
  8. Types and constants definitions for application FTMan
  9. Author:
  10. Cristian Teodorescu October 22 1998
  11. Notes:
  12. Revision History:
  13. --*/
  14. #if !defined(AFX_FTMANDEF_H_INCLUDED_)
  15. #define AFX_FTMANDEF_H_INCLUDED_
  16. #if _MSC_VER > 1000
  17. #pragma once
  18. #endif // _MSC_VER > 1000
  19. /////////////////////////////////////////////////////////////////////////////
  20. class CItemID;
  21. // Macros
  22. /*
  23. My exception handling macros
  24. */
  25. #define MY_TRY try{
  26. // Catch and do nothing
  27. #define MY_CATCH }catch(CException* e){ e->Delete(); }
  28. // Catch and throw the exception to the superior try-catch block
  29. #define MY_CATCH_AND_THROW }catch(CException* e){ throw; }
  30. // Catch and report the exception
  31. #define MY_CATCH_AND_REPORT }catch(CException* e){ e->ReportError(MB_ICONSTOP); e->Delete(); }
  32. // A catch macro to be used in dialog methods
  33. #define MY_CATCH_REPORT_AND_CANCEL }catch(CException* e){ e->ReportError(MB_ICONSTOP); e->Delete(); OnCancel(); }
  34. // A catch macro to be used in functions that return BOOL
  35. #define MY_CATCH_REPORT_AND_RETURN_FALSE }catch(CException* e){ e->ReportError(MB_ICONSTOP); e->Delete(); return FALSE; }
  36. // A catch macro to be used in functions that return handle or pointer
  37. #define MY_CATCH_REPORT_AND_RETURN_NULL }catch(CException* e){ e->ReportError(MB_ICONSTOP); e->Delete(); return NULL; }
  38. // Some macros above are used in set.h so I include set.h here after the macro definitions
  39. #include "Set.h"
  40. // Constants / Enums
  41. /*
  42. MainFrame timer's event id
  43. */
  44. #define ID_TIMER_EVENT 2103
  45. /*
  46. MainFrame timer's elapse ( in milliseconds )
  47. */
  48. #define TIMER_ELAPSE 3000
  49. /*
  50. Images index in all image lists
  51. */
  52. enum tagImageIndex
  53. {
  54. II_Root = 0,
  55. II_FTPartition,
  56. II_VolumeSet,
  57. II_StripeSet,
  58. II_MirrorSet,
  59. II_StripeSetWithParity,
  60. II_PhysicalPartition,
  61. II_FreeSpace,
  62. II_RootExpanded,
  63. // Exclamation marks on the images
  64. II_FTPartition_Warning,
  65. II_VolumeSet_Warning,
  66. II_StripeSet_Warning,
  67. II_MirrorSet_Warning,
  68. II_StripeSetWithParity_Warning,
  69. II_PhysicalPartition_Warning,
  70. // Red X's on the images
  71. II_FTPartition_Error,
  72. II_VolumeSet_Error,
  73. II_StripeSet_Error,
  74. II_MirrorSet_Error,
  75. II_StripeSetWithParity_Error,
  76. II_PhysicalPartition_Error,
  77. IMAGES_NUMBER
  78. };
  79. /*
  80. Types of refreshments performed on tree and list view items every TIME_ELAPSE milliseconds.
  81. Used by CTreeView::RefreshOnTimer
  82. */
  83. enum tagRefreshOnTimerFlags
  84. {
  85. ROTT_GotDriveLetterAndVolumeName= 0x01, // Volume's drive letter and volume name was found
  86. ROTT_EndInitialization = 0x02, // A stripe set with parity finished its initializing process
  87. ROTT_EndRegeneration = 0x04 // A mirror set or stripe set with parity finished the regeneration process
  88. };
  89. // Types
  90. /*
  91. Type ITEM_TYPE - Defines all possible types of items that may appear in the tree view
  92. and the list view
  93. */
  94. typedef enum tagItemType
  95. {
  96. IT_RootVolumes,
  97. IT_LogicalVolume,
  98. IT_PhysicalPartition,
  99. IT_RootFreeSpaces,
  100. IT_FreeSpace
  101. } ITEM_TYPE;
  102. /*
  103. Type PARTITION_TYPE - Defines all possible types of physical partitions
  104. */
  105. typedef enum tagPartitionType
  106. {
  107. PT_Primary, // Primary partition
  108. PT_InExtendedPartition // Partition inside an extended partition
  109. } PARTITION_TYPE;
  110. /*
  111. Type FREE_SPACE_TYPE - Defines all possible types of free spaces
  112. */
  113. typedef enum tagFreeSpaceType
  114. {
  115. FST_Primary, // Primary free space ( not in extended partitions )
  116. FST_InExtendedPartition, // Free space inside an extended partition whose table is not empty
  117. FST_EmptyExtendedPartition // Empty extended partition
  118. } FREE_SPACE_TYPE;
  119. /*
  120. Type LV_COLUMNS - Defines the indexes of columns in the list view
  121. */
  122. typedef enum tagLVColumns
  123. {
  124. LVC_Name = 0,
  125. LVC_Type,
  126. LVC_DiskNumber,
  127. LVC_Size,
  128. LVC_Offset,
  129. LVC_VolumeID,
  130. COLUMNS_NUMBER
  131. } LV_COLUMNS;
  132. /*
  133. Type LV_COLUMN_CONFIG - Defines the configuration of a list-view column
  134. */
  135. typedef struct tagLVColumnConfig
  136. {
  137. LV_COLUMNS iSubItem; // The index of the subitem
  138. DWORD dwTitleID; // The ID of the resource string to be title of this column
  139. int nFormat; // Alignment
  140. WORD wWidthPercent; // The percent of the list-view width to be used by this column
  141. } LV_COLUMN_CONFIG, *PLV_COLUMN_CONFIG;
  142. /*
  143. Type CULONGSet - A set of ULONG elements.
  144. */
  145. typedef CSet<ULONG, ULONG> CULONGSet;
  146. /*
  147. Type CItemIDSet - A set of CItemID elements
  148. */
  149. typedef CSet<CItemID, CItemID&> CItemIDSet;
  150. /*
  151. Type TREE_SNAPSHOT - Defines the current status of the tree-view. It is used when refreshing the tree
  152. */
  153. typedef struct tagTreeSnapshot
  154. {
  155. CItemIDSet setExpandedItems; // All expanded items
  156. CItemIDSet setSelectedItems; // All selected items ( should be only one )
  157. } TREE_SNAPSHOT, *PTREE_SNAPSHOT;
  158. /*
  159. Type LIST_SNAPSHOT - Defines the current status of the list-view. It is used when refreshing the list
  160. */
  161. typedef struct tagListSnapshot
  162. {
  163. CItemIDSet setSelectedItems; // All selected items
  164. } LIST_SNAPSHOT, *PLIST_SNAPSHOT;
  165. #endif // !defined(AFX_FTMANDEF_H_INCLUDED_)