Debian Codegraph @

src/file/ApvlvPopplerPdf.h

raw
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 ApvlvPdf.h
23 *
24 * Author: Alf <[email protected]>
25 */
26
27 #ifndef _APVLV_POPPLERPDF_H_
28 #define _APVLV_POPPLERPDF_H_
29
30 #include <qt6/poppler-qt6.h>
31
32 #include "ApvlvFile.h"
33
34 namespace apvlv
35 {
36
37 class ApvlvPopplerPDF : public File
38 {
39 FILE_TYPE_DECLARATION (ApvlvPopplerPDF);
40
41 public:
42 bool load (const std::string &filename) override;
43
44 ~ApvlvPopplerPDF () override = default;
45
46 SizeF pageSizeF (int page, int rot) override;
47
48 int sum () override;
49
50 bool pageIsOnlyImage (int pn) override;
51
52 bool pageRenderToImage (int pn, double zm, int rot, QImage *img) override;
53
54 std::unique_ptr<WordListRectangle> pageSearch (int pn,
55 const char *s) override;
56
57 private:
58 bool generateIndex ();
59 void generateChildrenIndex (FileIndex &root_index,
60 const QVector<Poppler::OutlineItem> &outlines);
61
62 std::unique_ptr<Poppler::Document> mDoc;
63 };
64 }
65 #endif
66
67 /* Local Variables: */
68 /* mode: c++ */
69 /* End: */