filters

dialog.h

00001 /*
00002  * Copyright (c) 2002 Nicolas HADACEK (hadacek@kde.org)
00003  *
00004  * This program is free software; you can redistribute it and/or modify
00005  * it under the terms of the GNU General Public License as published by
00006  * the Free Software Foundation; either version 2 of the License, or
00007  * (at your option) any later version.
00008 
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013 
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018  */
00019 
00020 #ifndef DIALOG_H
00021 #define DIALOG_H
00022 
00023 #include <qvaluevector.h>
00024 #include <qpair.h>
00025 
00026 #include <kdialogbase.h>
00027 
00028 class QButtonGroup;
00029 class QRadioButton;
00030 class QCheckBox;
00031 class KLineEdit;
00032 
00033 
00034 //-----------------------------------------------------------------------------
00035 class SelectionRange
00036 {
00037 public:
00038     SelectionRange() {}
00039     SelectionRange(const QString &);
00040 
00041     uint nbPages() const;
00042 
00043 private:
00044     QValueVector<QPair<uint, uint> > _ranges;
00045 
00046     friend class SelectionRangeIterator;
00047 };
00048 
00049 class SelectionRangeIterator
00050 {
00051 public:
00052     SelectionRangeIterator(const SelectionRange &);
00053 
00054     int toFirst();
00055     int current() const { return _current; }
00056     int next();
00057     static int end() { return -1; }
00058 
00059 private:
00060     uint _index;
00061     int  _current;
00062     const QValueVector<QPair<uint, uint> > &_ranges;
00063 };
00064 
00065 //-----------------------------------------------------------------------------
00066 namespace PDFImport
00067 {
00068 
00069 class Options
00070 {
00071 public:
00072     Options() {}
00073 
00074 public:
00075     SelectionRange range;
00076     QString        ownerPassword, userPassword;
00077     bool           importImages, smart;
00078 };
00079 
00080 class Dialog : public KDialogBase
00081 {
00082 Q_OBJECT
00083 public:
00084     Dialog(uint nbPages, bool isEncrypted, QWidget *parent);
00085     ~Dialog();
00086 
00087     Options options() const;
00088 
00089 private slots:
00090     void rangeChanged(const QString &);
00091 
00092 private:
00093     uint          _nbPages;
00094     QRadioButton *_allButton, *_rangeButton;
00095     QButtonGroup *_group;
00096     KLineEdit    *_range, *_owner, *_user;
00097     QCheckBox    *_images, *_smart;
00098 };
00099 
00100 } // namespace
00101 
00102 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys