Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Source / cmDocumentationFormatter.h
blob843080fd021389859712b599f4fe297f0799a0be
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmDocumentationFormatter.h,v $
5 Language: C++
6 Date: $Date: 2008-10-10 15:23:35 $
7 Version: $Revision: 1.10 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef _cmDocumentationFormatter_h
18 #define _cmDocumentationFormatter_h
20 #include "cmStandardIncludes.h"
22 /** This is just a helper class to make it build with MSVC 6.0.
23 Actually the enums and internal classes could directly go into
24 cmDocumentation, but then MSVC6 complains in RequestedHelpItem that
25 cmDocumentation is an undefined type and so it doesn't know the enums.
26 Moving the enums to a class which is then already completely parsed helps
27 against this. */
28 class cmDocumentationEnums
30 public:
31 /** Types of help provided. */
32 enum Type
33 { None, Usage, Single, SingleModule, SingleProperty, SingleVariable,
34 List, ModuleList, PropertyList, VariableList,
35 Full, Properties, Variables, Modules, CustomModules, Commands,
36 CompatCommands, Copyright, Version, Policies, SinglePolicy };
38 /** Forms of documentation output. */
39 enum Form { TextForm, HTMLForm, ManForm, UsageForm, DocbookForm };
42 class cmDocumentationSection;
44 /** Base class for printing the documentation in the various supported
45 formats. */
46 class cmDocumentationFormatter
48 public:
49 cmDocumentationFormatter();
50 virtual ~cmDocumentationFormatter();
51 void PrintFormatted(std::ostream& os, const char* text);
53 virtual cmDocumentationEnums::Form GetForm() const = 0;
55 virtual void PrintHeader(const char* /*docname*/,
56 const char* /*appname*/,
57 std::ostream& /*os*/) {}
58 virtual void PrintFooter(std::ostream& /*os*/) {}
59 virtual void PrintSection(std::ostream& os,
60 const cmDocumentationSection& section,
61 const char* name) = 0;
62 virtual void PrintPreformatted(std::ostream& os, const char* text) = 0;
63 virtual void PrintParagraph(std::ostream& os, const char* text) = 0;
64 virtual void PrintIndex(std::ostream& ,
65 std::vector<const cmDocumentationSection *>&)
68 /** Compute a prefix for links into a section (#<prefix>_SOMETHING). */
69 std::string ComputeSectionLinkPrefix(std::string const& name);
72 #endif