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.

96 lines
4.9 KiB

  1. #ifndef _CINFOTYPE
  2. #define _CINFOTYPE
  3. #include "sitemap.h"
  4. // system.h is included so generally that it is not explicitly included even though it is required.
  5. class CHmData;
  6. class CSubSets;
  7. class CInfoType {
  8. private:
  9. // used by the copy consturctors
  10. void CopyCat(const INFOTYPE_TABLES * Src_itTables);
  11. void CopyTable( const INFOTYPE_TABLES *Src_itTables);
  12. public:
  13. CInfoType(void);
  14. ~CInfoType();
  15. // Copy Constructor
  16. // *********************
  17. const CInfoType& operator=(const CInfoType& ITSrc); // copy constructor
  18. const CInfoType& operator=(const CSiteMap& ITSrc);
  19. #ifdef HHCTRL
  20. void CopyTo( CHmData * const phmData);
  21. #endif
  22. #if 0 // enable for subset filtering
  23. BOOL IsEntryInCurTypeList(SITEMAP_ENTRY* pSiteMapEntry, CSubSets *pSSs) const;
  24. SITE_ENTRY_URL* AreTheseInfoTypesDefined(SITEMAP_ENTRY* pSiteMapEntry, CSubSets *pSSs) const;
  25. #else
  26. BOOL IsEntryInCurTypeList(SITEMAP_ENTRY* pSiteMapEntry) const;
  27. SITE_ENTRY_URL* AreTheseInfoTypesDefined(SITEMAP_ENTRY* pSiteMapEntry, UINT types, int offset) const;
  28. #endif
  29. SITE_ENTRY_URL* NextUrlEntry(SITE_ENTRY_URL* pUrl) const { return (SITE_ENTRY_URL*) ((PBYTE) pUrl + m_cUrlEntry); }
  30. void ReSizeIT(int Size=0);
  31. int GetInfoType(PCSTR pszTypeName) const ;//{ return GetITIndex(pszTypeName); }
  32. PCSTR GetInfoTypeDescription(int pos) const { return m_itTables.m_ptblInfoTypeDescriptions->GetPointer(pos); }
  33. PCSTR GetInfoTypeName(int pos) const { return m_itTables.m_ptblInfoTypes->GetPointer(pos); }
  34. int GetITIndex(PCSTR pszString) const { return m_itTables.m_ptblInfoTypes->IsStringInTable( pszString ); }
  35. int HowManyInfoTypes(void) const { return m_itTables.m_ptblInfoTypes ? m_itTables.m_ptblInfoTypes->CountStrings() : 0; }
  36. int InfoTypeSize(void) const { return m_itTables.m_cITSize * sizeof(INFOTYPE); }
  37. BOOL IsDeleted( const int pos) const {return ( *(GetInfoTypeName(pos))==' ' )?TRUE:FALSE;}
  38. BOOL AnyInfoTypes(const INFOTYPE *pIT) const;
  39. BOOL IsInACategory( int type ) const;
  40. // Exclusive Information Type methods
  41. int GetFirstExclusive(int=-1, INFOTYPE=1) const;
  42. int GetNextExclusive(void) const;
  43. int GetLastExclusive(void) const;
  44. void AddExclusiveIT(int const type) {AddIT(type, m_itTables.m_pExclusive); }
  45. void DeleteExclusiveIT(int const type ) {DeleteIT(type, m_itTables.m_pExclusive); }
  46. BOOL IsExclusive(int const type) const {return m_itTables.m_pExclusive?*(m_itTables.m_pExclusive+(type/32)) & (1<<(type%32)):0;}
  47. // Hidden Information Type methods
  48. int GetFirstHidden(int=-1, INFOTYPE=1) const;
  49. int GetNextHidden(void) const;
  50. int GetLastHidden(void) const;
  51. void AddHiddenIT( int const type ) {AddIT(type, m_itTables.m_pHidden); }
  52. void DeleteHiddenIT( int const type ) {DeleteIT(type, m_itTables.m_pHidden); }
  53. BOOL IsHidden(int const type) const {return m_itTables.m_pHidden?*(m_itTables.m_pHidden+(type/32)) & (1<<(type%32)):0;}
  54. // Category Methods
  55. int GetFirstCategoryType(int pos) const ;
  56. int GetNextITinCategory( void ) const ;
  57. int GetLastCategoryType(int pos) const ;
  58. void AddITtoCategory(int pos, int type);
  59. void DeleteITfromCat(int pos, int type);
  60. int GetCatPosition(PCSTR psz) const {return m_itTables.m_ptblCategories->IsStringInTable(psz); }
  61. int HowManyCategories(void) const {return m_itTables.m_ptblCategories ? m_itTables.m_ptblCategories->CountStrings() : 0; }
  62. PCSTR GetCategoryString(int pos) const { return m_itTables.m_ptblCategories->GetPointer(pos); }
  63. PCSTR GetCategoryDescription(int pos) const {return m_itTables.m_ptblCatDescription?m_itTables.m_ptblCatDescription->GetPointer(pos):0; }
  64. BOOL IsITinCategory( int pos, int type) const {return m_itTables.m_aCategories[pos].pInfoType?*(m_itTables.m_aCategories[pos].pInfoType+(type/32)) & (1<<(type%32)):0;}
  65. BOOL IsCatDeleted( const int pos ) const {return ( *(GetCategoryString(pos))==' ' )?TRUE:FALSE;}
  66. // CInfotype members
  67. // ***********************
  68. BOOL m_fTypeCopy; // TRUE if following tables are pointers that must not be freed
  69. INFOTYPE_TABLES m_itTables;
  70. INFOTYPE* m_pInfoTypes; // user-specified Information Types
  71. INFOTYPE* m_pTypicalInfoTypes; // "typical" information types
  72. int m_cUrlEntry; // sizeof(SITE_ENTRY_URL) + sizeof(URL) for each additional 32 Information Types
  73. int m_cInfoTypeOffsets; // number of additional offsets to check
  74. private:
  75. BOOL m_fInitialized; // TRUE if IT and categorys read from disk.
  76. };
  77. #endif // _CINFOTYPE