00001 #ifndef __CFontEnumerator__ 00002 #define __CFontEnumerator__ 00003 00004 #include "CFontReference.hpp" 00005 #include <Collections/TCountedPointerArray.hpp> 00006 #include <Basics/CString.hpp> 00007 00008 // =========================================================================== 00009 00010 using Exponent::GUI::Fonts::CFontReference; 00011 using Exponent::Collections::TCountedPointerArray; 00012 using Exponent::Basics::CString; 00013 00014 // =========================================================================== 00015 00016 namespace Exponent 00017 { 00018 namespace GUI 00019 { 00020 namespace Fonts 00021 { 00039 class CFontEnumerator 00040 { 00041 public: 00042 00046 CFontEnumerator(); 00047 00051 virtual ~CFontEnumerator(); 00052 00053 // =========================================================================== 00054 00059 TCountedPointerArray<CFontReference> *getMutableFontArray() const { return m_fontArray; } 00060 00065 const TCountedPointerArray<CFontReference> *getFontArray() const { return m_fontArray; } 00066 00072 bool fontExists(const CString &fontName); 00073 00074 // =========================================================================== 00075 00076 protected: 00077 00078 // =========================================================================== 00079 00083 void findFonts(); 00084 00085 // =========================================================================== 00086 00087 #ifdef WIN32 00088 00095 virtual long handleEnumerationEvent(ENUMLOGFONTEX *logFontEx, NEWTEXTMETRICEX *metric, int fontType); 00096 00105 static long CALLBACK enumerateProcess(ENUMLOGFONTEX *logFontEx, NEWTEXTMETRICEX *metric, int fontType, LPARAM lParam); 00106 #endif 00107 00108 // =========================================================================== 00109 00110 TCountedPointerArray<CFontReference> *m_fontArray; 00112 }; 00113 } 00114 } 00115 } 00116 #endif // End of CFontEnumerator.hpp