CSimpleTextParser.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*******************************************************************
  2. *
  3. * File: CSimpleTextParser.h
  4. *
  5. * Author: Peter van Sebille (peter@yipton.net)
  6. *
  7. * (c) Copyright 2002, Peter van Sebille
  8. * All Rights Reserved
  9. *
  10. *******************************************************************/
  11. #ifndef __CSIMPLE_TEXT_PARSER_H
  12. #define __CSIMPLE_TEXT_PARSER_H
  13. #include <e32def.h>
  14. #include <txtrich.h> // CRichText
  15. #include <eikrted.h> // CEikRichTextEditor
  16. class CSimpleTextFormatParser : public CBase
  17. {
  18. public:
  19. static CSimpleTextFormatParser* NewLC();
  20. void ParseL(const TDesC& aPSTText, CRichText& aRichText);
  21. protected:
  22. CSimpleTextFormatParser(){}
  23. ~CSimpleTextFormatParser();
  24. void ConstructL();
  25. void ParseTagL(const TDesC& aTag);
  26. TRgb ForegroundColor();
  27. void SetBold(TBool aEnable=ETrue);
  28. void SetItalic(TBool aEnable=ETrue);
  29. void SetUnderLine(TBool aEnable=ETrue);
  30. void SetFontHeight(TInt aHeight);
  31. void SetFontName(const TDesC& aName);
  32. void SetHiddenText(TBool aEnable=ETrue);
  33. void SetForegroundColor(const TRgb& aColor);
  34. void NewParagraph();
  35. void SetAlignment(CParaFormat::TAlignment aAlignment);
  36. void SetBackgroundColor(const TRgb& aColor);
  37. void AppendTextL(const TDesC& aText);
  38. TInt TextPos();
  39. TInt ParaPos();
  40. CRichText* iRichText;
  41. TCharFormat iCharFormat;
  42. TCharFormatMask iCharMask;
  43. CParaFormat* iParaFormat;
  44. TParaFormatMask iParaMask;
  45. TInt iCurrentPara;
  46. TRgb iPrevFgColor;
  47. };
  48. #endif /* __CSIMPLE_TEXT_PARSER_H */