HeaderTemplate.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. ** Command & Conquer Generals(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. ////////////////////////////////////////////////////////////////////////////////
  19. // //
  20. // (c) 2001-2003 Electronic Arts Inc. //
  21. // //
  22. ////////////////////////////////////////////////////////////////////////////////
  23. // FILE: HeaderTemplate.h /////////////////////////////////////////////////
  24. //-----------------------------------------------------------------------------
  25. //
  26. // Electronic Arts Pacific.
  27. //
  28. // Confidential Information
  29. // Copyright (C) 2002 - All Rights Reserved
  30. //
  31. //-----------------------------------------------------------------------------
  32. //
  33. // created: Aug 2002
  34. //
  35. // Filename: HeaderTemplate.h
  36. //
  37. // author: Chris Huybregts
  38. //
  39. // purpose:
  40. //
  41. //-----------------------------------------------------------------------------
  42. ///////////////////////////////////////////////////////////////////////////////
  43. #pragma once
  44. #ifndef __HEADER_TEMPLATE_H_
  45. #define __HEADER_TEMPLATE_H_
  46. //-----------------------------------------------------------------------------
  47. // SYSTEM INCLUDES ////////////////////////////////////////////////////////////
  48. //-----------------------------------------------------------------------------
  49. #include "Common/STLTypedefs.h"
  50. //-----------------------------------------------------------------------------
  51. // USER INCLUDES //////////////////////////////////////////////////////////////
  52. //-----------------------------------------------------------------------------
  53. #include "Common/AsciiString.h"
  54. //-----------------------------------------------------------------------------
  55. // FORWARD REFERENCES /////////////////////////////////////////////////////////
  56. //-----------------------------------------------------------------------------
  57. class GameFont;
  58. struct FieldParse;
  59. class INI;
  60. //-----------------------------------------------------------------------------
  61. // TYPE DEFINES ///////////////////////////////////////////////////////////////
  62. //-----------------------------------------------------------------------------
  63. class HeaderTemplate
  64. {
  65. public:
  66. HeaderTemplate( void );
  67. ~HeaderTemplate( void );
  68. GameFont *m_font;
  69. AsciiString m_name;
  70. AsciiString m_fontName;
  71. Int m_point;
  72. Bool m_bold;
  73. };
  74. class HeaderTemplateManager
  75. {
  76. public:
  77. HeaderTemplateManager( void );
  78. ~HeaderTemplateManager( void );
  79. void init( void );
  80. const FieldParse *getFieldParse( void ) const { return m_headerFieldParseTable; } ///< Return the field parse info
  81. static const FieldParse m_headerFieldParseTable[];
  82. HeaderTemplate *findHeaderTemplate( AsciiString name );
  83. HeaderTemplate *newHeaderTemplate( AsciiString name );
  84. GameFont *getFontFromTemplate( AsciiString name );
  85. HeaderTemplate *getFirstHeader( void );
  86. HeaderTemplate *getNextHeader( HeaderTemplate *ht );
  87. void headerNotifyResolutionChange(void);
  88. private:
  89. void populateGameFonts( void );
  90. typedef std::list< HeaderTemplate* > HeaderTemplateList;
  91. typedef HeaderTemplateList::iterator HeaderTemplateListIt;
  92. HeaderTemplateList m_headerTemplateList;
  93. };
  94. //-----------------------------------------------------------------------------
  95. // INLINING ///////////////////////////////////////////////////////////////////
  96. //-----------------------------------------------------------------------------
  97. //-----------------------------------------------------------------------------
  98. // EXTERNALS //////////////////////////////////////////////////////////////////
  99. //-----------------------------------------------------------------------------
  100. extern HeaderTemplateManager *TheHeaderTemplateManager;
  101. #endif // __HEADER_TEMPLATE_H_