1 | /* poppler-cached-file-loader.h: glib interface to poppler |
2 | * |
3 | * Copyright (C) 2012 Carlos Garcia Campos <carlosgc@gnome.org> |
4 | * Copyright (C) 2022 Albert Astals Cid <aacid@kde.org> |
5 | * |
6 | * This program is free software; you can redistribute it and/or modify |
7 | * it under the terms of the GNU General Public License as published by |
8 | * the Free Software Foundation; either version 2, or (at your option) |
9 | * any later version. |
10 | * |
11 | * This program is distributed in the hope that it will be useful, |
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | * GNU General Public License for more details. |
15 | * |
16 | * You should have received a copy of the GNU General Public License |
17 | * along with this program; if not, write to the Free Software |
18 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. |
19 | */ |
20 | |
21 | #ifndef __POPPLER_CACHED_FILE_LOADER_H__ |
22 | #define __POPPLER_CACHED_FILE_LOADER_H__ |
23 | |
24 | #include <gio/gio.h> |
25 | #ifndef __GI_SCANNER__ |
26 | # include <CachedFile.h> |
27 | |
28 | class PopplerCachedFileLoader : public CachedFileLoader |
29 | { |
30 | public: |
31 | PopplerCachedFileLoader(GInputStream *inputStreamA, GCancellable *cancellableA, goffset lengthA = -1); |
32 | ~PopplerCachedFileLoader() override; |
33 | size_t init(CachedFile *cachedFile) override; |
34 | int load(const std::vector<ByteRange> &ranges, CachedFileWriter *writer) override; |
35 | |
36 | private: |
37 | GInputStream *inputStream; |
38 | GCancellable *cancellable; |
39 | goffset length; |
40 | CachedFile *cachedFile; |
41 | }; |
42 | |
43 | #endif /* __GI_SCANNER__ */ |
44 | |
45 | #endif /* __POPPLER_CACHED_FILE_LOADER_H__ */ |
46 | |