cmWIXRichTextFormatWriter.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2012 Kitware, Inc.
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmWIXRichTextFormatWriter_h
  11. #define cmWIXRichTextFormatWriter_h
  12. #include "cmStandardIncludes.h"
  13. #include <cmsys/FStream.hxx>
  14. /** \class cmWIXRichtTextFormatWriter
  15. * \brief Helper class to generate Rich Text Format (RTF) documents
  16. * from plain text (e.g. for license and welcome text)
  17. */
  18. class cmWIXRichTextFormatWriter
  19. {
  20. public:
  21. cmWIXRichTextFormatWriter(std::string const& filename);
  22. ~cmWIXRichTextFormatWriter();
  23. void AddText(std::string const& text);
  24. private:
  25. void WriteHeader();
  26. void WriteFontTable();
  27. void WriteColorTable();
  28. void WriteGenerator();
  29. void WriteDocumentPrefix();
  30. void ControlWord(std::string const& keyword);
  31. void NewControlWord(std::string const& keyword);
  32. void StartGroup();
  33. void EndGroup();
  34. void EmitUnicodeCodepoint(int c);
  35. void EmitUnicodeSurrogate(int c);
  36. void EmitInvalidCodepoint(int c);
  37. cmsys::ofstream File;
  38. };
  39. #endif