Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef APPLICATIONHELP_H
00029 #define APPLICATIONHELP_H
00030
00031 #include "QGpCoreToolsDLLExport.h"
00032 #include "Translations.h"
00033
00034 namespace QGpCoreTools {
00035
00036 class QGPCORETOOLS_EXPORT ApplicationHelp
00037 {
00038 TRANSLATIONS("ApplicationHelp")
00039 public:
00040 ApplicationHelp();
00041 ~ApplicationHelp();
00042
00043 void exec(const char * group=0);
00044
00045 void addGroup(QString title, QByteArray section);
00046 void addOption(QString option, QString comments);
00047 void setOptionSummary(QString optionSummary) {_optionSummary=optionSummary;}
00048 void setComments(QString comments) {_comments=comments;}
00049 void setSeeAlso(QString seeAlso) {_seeAlso=seeAlso;}
00050 void addExample(QString command, QString comments);
00051
00052 QList<QByteArray> sections();
00053 static void print(QString p, QString linePrefix=QString::null, int indent=0);
00054 static QString getLine(QString& text, int maxLength, bool * newLine =0);
00055 static QString encodeToHtml(QString str);
00056 static QString encodeToLatex(QString str);
00057 private:
00058 struct Option {
00059 QString option;
00060 QString comments;
00061 };
00062 struct OptionGroup {
00063 QList<Option> options;
00064 QString title;
00065 QByteArray section;
00066 };
00067 struct Example {
00068 QString command;
00069 QString comments;
00070 };
00071 QList<OptionGroup> _options;
00072 QList<Example> _examples;
00073 QString _optionSummary;
00074 QString _comments;
00075 QString _seeAlso;
00076 void print(const OptionGroup& g);
00077 void execHtml();
00078 void execLatex();
00079 static QString getCustomIndent(QString& text);
00080 };
00081
00082 }
00083
00084 #endif // APPLICATIONHELP_H