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