1 /* poppler-input-stream.h: glib interface to poppler
2  *
3  * Copyright (C) 2012 Carlos Garcia Campos <carlosgc@gnome.org>
4  * Copyright (C) 2019 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_INPUT_STREAM_H__
22 #define __POPPLER_INPUT_STREAM_H__
23 
24 #include <gio/gio.h>
25 #ifndef __GI_SCANNER__
26 #    include <Object.h>
27 #    include <Stream.h>
28 
29 class PopplerInputStream : public BaseSeekInputStream
30 {
31 public:
32     PopplerInputStream(GInputStream *inputStream, GCancellable *cancellableA, Goffset startA, bool limitedA, Goffset lengthA, Object &&dictA);
33     ~PopplerInputStream() override;
34     BaseStream *copy() override;
35     Stream *makeSubStream(Goffset start, bool limited, Goffset lengthA, Object &&dictA) override;
36 
37 private:
38     Goffset currentPos() const override;
39     void setCurrentPos(Goffset offset) override;
40     Goffset read(char *buffer, Goffset count) override;
41 
42     GInputStream *inputStream;
43     GCancellable *cancellable;
44 };
45 
46 #endif /* __GI_SCANNER__ */
47 
48 #endif /* __POPPLER_INPUT_STREAM_H__ */
49