droptionview.h
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 #ifndef DROPTIONVIEW_H
00021 #define DROPTIONVIEW_H
00022 
00023 #include <qwidget.h>
00024 #include <qgroupbox.h>
00025 #include <qstringlist.h>
00026 
00027 class QLineEdit;
00028 class QSlider;
00029 class QLabel;
00030 class KListBox;
00031 class QListBoxItem;
00032 class QVButtonGroup;
00033 class QWidgetStack;
00034 class QListViewItem;
00035 class DrBase;
00036 class DriverItem;
00037 
00038 class OptionBaseView : public QWidget
00039 {
00040     Q_OBJECT
00041 public:
00042     OptionBaseView(QWidget *parent = 0, const char *name = 0);
00043     virtual void setOption(DrBase*);
00044     virtual void setValue(const QString&);
00045 
00046 signals:
00047     void valueChanged(const QString&);
00048 
00049 protected:
00050     bool    blockSS;
00051 };
00052 
00053 class OptionNumericView : public OptionBaseView
00054 {
00055     Q_OBJECT
00056 public:
00057     OptionNumericView(QWidget *parent = 0, const char *name = 0);
00058     void setOption(DrBase *opt);
00059     void setValue(const QString& val);
00060 
00061 protected slots:
00062     void slotSliderChanged(int);
00063     void slotEditChanged(const QString&);
00064 
00065 private:
00066     QLineEdit   *m_edit;
00067     QSlider     *m_slider;
00068     QLabel      *m_minval, *m_maxval;
00069     bool        m_integer;
00070 };
00071 
00072 class OptionStringView : public OptionBaseView
00073 {
00074 public:
00075     OptionStringView(QWidget *parent = 0, const char *name = 0);
00076     void setOption(DrBase *opt);
00077     void setValue(const QString& val);
00078 
00079 private:
00080     QLineEdit   *m_edit;
00081 };
00082 
00083 class OptionListView : public OptionBaseView
00084 {
00085     Q_OBJECT
00086 public:
00087     OptionListView(QWidget *parent = 0, const char *name = 0);
00088     void setOption(DrBase *opt);
00089     void setValue(const QString& val);
00090 
00091 protected slots:
00092     void slotSelectionChanged();
00093 
00094 private:
00095     KListBox    *m_list;
00096     QStringList m_choices;
00097 };
00098 
00099 class OptionBooleanView : public OptionBaseView
00100 {
00101     Q_OBJECT
00102 public:
00103     OptionBooleanView(QWidget *parent = 0, const char *name = 0);
00104     void setOption(DrBase *opt);
00105     void setValue(const QString& val);
00106 
00107 protected slots:
00108     void slotSelected(int);
00109 
00110 private:
00111     QVButtonGroup   *m_group;
00112     QStringList m_choices;
00113 };
00114 
00115 class DrOptionView : public QGroupBox
00116 {
00117     Q_OBJECT
00118 public:
00119     DrOptionView(QWidget *parent = 0, const char *name = 0);
00120     QSize sizeHint() const;
00121     void setAllowFixed(bool on)     { m_allowfixed = on; }
00122 
00123 signals:
00124     void changed();
00125 
00126 public slots:
00127     void slotValueChanged(const QString&);
00128     void slotItemSelected(QListViewItem*);
00129 
00130 private:
00131     QWidgetStack    *m_stack;
00132     DriverItem  *m_item;
00133     bool        m_block;
00134     bool        m_allowfixed;
00135 };
00136 
00137 #endif
 
This file is part of the documentation for kdeprint Library Version 3.2.0.