filters

dialog.h
1/*
2 * Copyright (c) 2002 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 DIALOG_H
21#define DIALOG_H
22
23#include <tqvaluevector.h>
24#include <tqpair.h>
25
26#include <kdialogbase.h>
27
28class TQButtonGroup;
29class TQRadioButton;
30class TQCheckBox;
31class KLineEdit;
32
33
34//-----------------------------------------------------------------------------
35class SelectionRange
36{
37public:
38 SelectionRange() {}
39 SelectionRange(const TQString &);
40
41 uint nbPages() const;
42
43private:
44 TQValueVector<TQPair<uint, uint> > _ranges;
45
46 friend class SelectionRangeIterator;
47};
48
49class SelectionRangeIterator
50{
51public:
52 SelectionRangeIterator(const SelectionRange &);
53
54 int toFirst();
55 int current() const { return _current; }
56 int next();
57 static int end() { return -1; }
58
59private:
60 uint _index;
61 int _current;
62 const TQValueVector<TQPair<uint, uint> > &_ranges;
63};
64
65//-----------------------------------------------------------------------------
66namespace PDFImport
67{
68
69class Options
70{
71public:
72 Options() {}
73
74public:
75 SelectionRange range;
76 TQString ownerPassword, userPassword;
77 bool importImages, smart;
78};
79
80class Dialog : public KDialogBase
81{
82TQ_OBJECT
83
84public:
85 Dialog(uint nbPages, bool isEncrypted, TQWidget *parent);
86 ~Dialog();
87
88 Options options() const;
89
90private slots:
91 void rangeChanged(const TQString &);
92
93private:
94 uint _nbPages;
95 TQRadioButton *_allButton, *_rangeButton;
96 TQButtonGroup *_group;
97 KLineEdit *_range, *_owner, *_user;
98 TQCheckBox *_images, *_smart;
99};
100
101} // namespace
102
103#endif