| 1 |
/* |
| 2 |
* This file is part of the apvlv package |
| 3 |
* Copyright (C) <2010> <Alf> |
| 4 |
* |
| 5 |
* Contact: Alf <[email protected]> |
| 6 |
* |
| 7 |
* This program is free software; you can redistribute it and/or modify |
| 8 |
* it under the terms of the GNU General Public License as published by |
| 9 |
* the Free Software Foundation; either version 2 of the License, or |
| 10 |
* (at your option) any later version. |
| 11 |
* |
| 12 |
* This program is distributed in the hope that it will be useful, |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 |
* GNU General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU General Public License along |
| 18 |
* with this program; if not, write to the Free Software Foundation, Inc., |
| 19 |
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 20 |
* |
| 21 |
*/ |
| 22 |
/* @CPPFILE ApvlvLab.cc |
| 23 |
* |
| 24 |
* Author: Alf <[email protected]> |
| 25 |
*/ |
| 26 |
|
| 27 |
#include "ApvlvLab.h" |
| 28 |
#include "ApvlvUtil.h" |
| 29 |
#include "ApvlvWebViewWidget.h" |
| 30 |
|
| 31 |
namespace apvlv |
| 32 |
{ |
| 33 |
using namespace std; |
| 34 |
|
| 35 |
const string stylesheet_content = ".block_c {\n" |
| 36 |
" display: block;\n" |
| 37 |
" font-size: 2.5em;\n" |
| 38 |
" font-weight: normal;\n" |
| 39 |
" line-height: 33.6pt;\n" |
| 40 |
" text-align: center;\n" |
| 41 |
" text-indent: 0;\n" |
| 42 |
" margin: 17pt 0;\n" |
| 43 |
" padding: 0;\n" |
| 44 |
"}\n" |
| 45 |
".block_ {\n" |
| 46 |
" display: block;\n" |
| 47 |
" font-size: 1.5em;\n" |
| 48 |
" font-weight: normal;\n" |
| 49 |
" line-height: 33.6pt;\n" |
| 50 |
" text-align: justify;\n" |
| 51 |
" text-indent: 0;\n" |
| 52 |
" margin: 17pt 0;\n" |
| 53 |
" padding: 0;\n" |
| 54 |
"}\n" |
| 55 |
".block_1 {\n" |
| 56 |
" display: block;\n" |
| 57 |
" line-height: 1.2;\n" |
| 58 |
" text-align: justify;\n" |
| 59 |
" margin: 0 0 7pt;\n" |
| 60 |
" padding: 0;\n" |
| 61 |
"}\n"; |
| 62 |
const string title_template = "<?xml version='1.0' encoding='UTF-8'?>\n" |
| 63 |
"<html xmlns=\"http://www.w3.org/1999/xhtml\" " |
| 64 |
"lang=\"en\" xml:lang=\"en\">\n" |
| 65 |
" <head>\n" |
| 66 |
" <title></title>\n" |
| 67 |
" <link rel=\"stylesheet\" type=\"text/css\" " |
| 68 |
"href=\"stylesheet.css\"/>\n" |
| 69 |
" <meta http-equiv=\"Content-Type\" " |
| 70 |
"content=\"text/html; charset=utf-8\"/>\n" |
| 71 |
" </head>\n" |
| 72 |
" <body>\n" |
| 73 |
" <br />\n" |
| 74 |
" <br />\n" |
| 75 |
" <br />\n" |
| 76 |
" <br />\n" |
| 77 |
" %s\n" |
| 78 |
" </body>\n" |
| 79 |
"</html>\n"; |
| 80 |
const string section_template = "<?xml version='1.0' encoding='UTF-8'?>\n" |
| 81 |
"<html xmlns=\"http://www.w3.org/1999/xhtml\" " |
| 82 |
"lang=\"en\" xml:lang=\"en\">\n" |
| 83 |
" <head>\n" |
| 84 |
" <title></title>\n" |
| 85 |
" <link rel=\"stylesheet\" " |
| 86 |
"type=\"text/css\" href=\"stylesheet.css\"/>\n" |
| 87 |
" <meta http-equiv=\"Content-Type\" " |
| 88 |
"content=\"text/html; charset=utf-8\"/>\n" |
| 89 |
" </head>\n" |
| 90 |
" <body>\n" |
| 91 |
" %s\n" |
| 92 |
" </body>\n" |
| 93 |
"</html>\n"; |
| 94 |
bool |
| 95 |
ApvlvLab::load (const string &filename) |
| 96 |
{ |
| 97 |
return false; |
| 98 |
} |
| 99 |
|
| 100 |
ApvlvLab::~ApvlvLab () = default; |
| 101 |
|
| 102 |
bool |
| 103 |
ApvlvLab::pageRenderToWebView (int pn, double zm, int rot, WebView *webview) |
| 104 |
{ |
| 105 |
webview->setZoomFactor (zm); |
| 106 |
QUrl url = QString ("apvlv:///") + QString::number (pn); |
| 107 |
webview->load (url); |
| 108 |
return true; |
| 109 |
} |
| 110 |
|
| 111 |
} |
| 112 |
|
| 113 |
// Local Variables: |
| 114 |
// mode: c++ |
| 115 |
// End: |