source: wkhtmltox/trunk/fuentes/src/shared/commondocparts.cc @ 51

Last change on this file since 51 was 51, checked in by mabarracus, 4 years ago

wip

File size: 3.6 KB
Line 
1// -*- mode: c++; tab-width: 4; indent-tabs-mode: t; eval: (progn (c-set-style "stroustrup") (c-set-offset 'innamespace 0)); -*-
2// vi:set ts=4 sts=4 sw=4 noet :
3//
4// Copyright 2010, 2011 wkhtmltopdf authors
5//
6// This file is part of wkhtmltopdf.
7//
8// wkhtmltopdf is free software: you can redistribute it and/or modify
9// it under the terms of the GNU Lesser General Public License as published by
10// the Free Software Foundation, either version 3 of the License, or
11// (at your option) any later version.
12//
13// wkhtmltopdf is distributed in the hope that it will be useful,
14// but WITHOUT ANY WARRANTY; without even the implied warranty of
15// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16// GNU General Public License for more details.
17//
18// You should have received a copy of the GNU Lesser General Public License
19// along with wkhtmltopdf.  If not, see <http://www.gnu.org/licenses/>.
20
21#include "commandlineparserbase.hh"
22#include "outputter.hh"
23#include <QFile>
24
25/*!
26  Output the name and version of the program, and also whether we are using a patched qt
27  \param o The outputter to output to
28*/
29void CommandLineParserBase::outputName(Outputter * o) const {
30        o->beginSection("Name");
31        o->paragraph(appName()+" "+appVersion());
32        o->endSection();
33}
34
35/*!
36  Output copyright stuff
37  \param o The outputter to output to
38*/
39void CommandLineParserBase::outputLicense(Outputter * o) const {
40        o->beginSection("License");
41        o->paragraph("Copyright (c) 2010-2014 wkhtmltopdf authors");
42        QFile file(":/LICENSE");
43        file.open(QIODevice::ReadOnly | QIODevice::Text);
44        QTextStream stream(&file);
45        o->verbatim(stream.readAll());
46        o->endSection();
47}
48
49/*!
50  Output list of authors
51  \param o The outputter to output to
52*/
53void CommandLineParserBase::outputAuthors(Outputter * o) const {
54        o->beginSection("Authors");
55        QFile file(":/AUTHORS");
56        file.open(QIODevice::ReadOnly | QIODevice::Text);
57        QTextStream stream(&file);
58        o->verbatim(stream.readAll());
59        o->endSection();
60}
61
62/*!
63  Output information on the problems with the static version
64  \param o The outputter to output to
65*/
66void CommandLineParserBase::outputStaticProblems(Outputter * o) const {
67        o->beginSection("Static version");
68        o->beginParagraph();
69        o->text("On the wkhtmltopdf website you can download a static version of wkhtmltopdf ");
70        o->link("http://wkhtmltopdf.org/downloads.html");
71        o->text(". This static binary will work on most systems and comes with a build in patched QT.");
72        o->endParagraph();
73
74        o->beginParagraph();
75        o->text("Unfortunately the static binary is not particularly static, on Linux it depends "
76                        "on both glibc and openssl, furthermore you will need to have an xserver installed "
77                        "but not necessary running. You will need to have different fonts install including "
78                        "xfonts-scalable (Type1), and msttcorefonts.");
79        o->endParagraph();
80        o->endSection();
81}
82
83/*!
84  Output documentation about the proxy settings
85  \param o The outputter to output to
86*/
87void CommandLineParserBase::outputProxyDoc(Outputter * o) const {
88        o->beginSection("Specifying A Proxy");
89        o->paragraph(
90                "By default proxy information will be read from the environment"
91                " variables: proxy, all_proxy and http_proxy, proxy options can"
92                " also by specified with the -p switch");
93        o->verbatim(
94                "<type> := \"http://\" | \"socks5://\"\n"
95                "<serif> := <username> (\":\" <password>)? \"@\"\n"
96                "<proxy> := \"None\" | <type>? <string>? <host> (\":\" <port>)?\n");
97        o->paragraph("Here are some examples (In case you are unfamiliar with the BNF):");
98        o->verbatim("http://user:password@myproxyserver:8080\n"
99                                "socks5://myproxyserver\n"
100                                "None\n");
101        o->endSection();
102}
Note: See TracBrowser for help on using the repository browser.