MarkupTextBlock.h
Go to the documentation of this file.00001 //*** MarkupTextBlock.h *** 00002 00003 #ifndef __MarkupTextBlock_H__ 00004 #define __MarkupTextBlock_H__ 00005 00006 // Includes 00007 #include "Array.h" 00008 #include "StringId.h" 00009 00010 // Forward declares 00011 class Bitmap; 00012 00013 // TextPML 00014 class MarkupTextBlock 00015 { 00016 public: 00017 MarkupTextBlock(); 00018 00019 MarkupTextBlock( 00020 const char* pmlString 00021 ); 00022 00023 ~MarkupTextBlock(); 00024 00025 MarkupTextBlock( 00026 const MarkupTextBlock& textblock 00027 ); 00028 00029 const MarkupTextBlock& operator=( 00030 const MarkupTextBlock& textblock 00031 ); 00032 00033 void SetString( 00034 const char* pmlString 00035 ); 00036 00037 void AddString( 00038 const char* pmlString 00039 ); 00040 00041 const char* GetString() const; 00042 00043 void Render( 00044 Bitmap& target, 00045 int x1, 00046 int y1, 00047 int x2, 00048 int y2, 00049 StringId hoverOption, 00050 StringId hoverLink 00051 ); 00052 00053 StringId IsOverOption(int cursorX, int cursorY) const; 00054 StringId IsOverLink(int cursorX, int cursorY) const; 00055 00056 private: 00057 void ResetTokenStream(); 00058 const char* GetNextToken(); 00059 00060 00061 private: 00062 char* pmlString_; 00063 char* tokenBuffer_; 00064 bool currentTokenIsMarkupCode_; 00065 int currentTokenPosition_; 00066 int tokenStreamSize_; 00067 00068 struct InteractiveRegion 00069 { 00070 int x1; 00071 int y1; 00072 int x2; 00073 int y2; 00074 StringId id; 00075 }; 00076 Array<InteractiveRegion> links_; 00077 Array<InteractiveRegion> options_; 00078 }; 00079 00080 00081 #endif /* __MarkupTextBlock_H__ */
Reproduction/republishing of any material on this site without permission is strictly prohibited.
