filters

data.h
1/*
2 * Copyright (c) 2002-2003 Nicolas HADACEK (hadacek@kde.org)
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 */
19
20#ifndef DATA_H
21#define DATA_H
22
23#include <math.h>
24
25#include <tqdom.h>
26#include <tqvaluevector.h>
27
28#include <KoPageLayout.h>
29
30#include "misc.h"
31
32class KoFilterChain;
33
34
35namespace PDFImport
36{
37class Options;
38
39class Data
40{
41public:
42 Data(KoFilterChain *, const DRect &pageRect, KoPageLayout,
43 const Options &);
44
45 TQDomElement createElement(const TQString &name)
46 { return _document.createElement(name); }
47 void createParagraph(const TQString &text, ParagraphType type,
48 const TQValueVector<TQDomElement> &layouts,
49 const TQValueVector<TQDomElement> &formats);
50
51 KoFilterChain *chain() const { return _chain; }
52 const Options &options() const { return _options; }
53 TQDomDocument document() const { return _document; }
54 const DRect &pageRect() const { return _pageRect; }
55 uint imageIndex() const { return _imageIndex; }
56 uint textIndex() const { return _textIndex; }
57 TQDomElement bookmarks() const { return _bookmarks; }
58 TQDomElement pictures() const { return _pictures; }
59
60 TQDomElement pictureFrameset(const DRect &);
61
62 void initPage(const TQValueVector<DRect> &,
63 const TQValueList<TQDomElement> &pictures);
64 void endDump();
65
66public:
67 uint pageIndex;
68
69private:
70 enum FramesetType { Text, Picture };
71 TQDomElement createFrameset(FramesetType, const TQString &name);
72 TQDomElement createFrame(FramesetType, const DRect &,
73 bool forceMainFrameset);
74
75private:
76 KoFilterChain *_chain;
77 TQDomDocument _document;
78 uint _imageIndex, _textIndex;
79 TQDomElement _mainElement, _framesets, _pictures, _bookmarks, _paper;
80 TQValueVector<TQDomElement> _textFramesets;
81 DRect _pageRect, _marginRect;
82 const Options &_options;
83};
84
85} // namespace
86
87#endif