kpresenter
KPrBackDia.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef BACKDIA_H
00022 #define BACKDIA_H
00023
00024 #include <kdialogbase.h>
00025 #include <qframe.h>
00026 #include <qdatetime.h>
00027
00028 #include "global.h"
00029 #include "KPrBackground.h"
00030
00031 #include <KoBrush.h>
00032 #include <KoPicture.h>
00033
00034 class QLabel;
00035 class QComboBox;
00036 class KColorButton;
00037 class QSlider;
00038 class KPrBackGround;
00039 class QCheckBox;
00040 class QTabWidget;
00041 class KPrPage;
00042 class KURLRequester;
00043
00044
00045 class KPrBackPreview : public QFrame
00046 {
00047 Q_OBJECT
00048
00049 public:
00050 KPrBackPreview( QWidget *parent, KPrPage *page );
00051 virtual ~KPrBackPreview();
00052
00053 KPrBackGround *backGround() const {
00054 return back;
00055 }
00056
00057 protected:
00058 virtual void drawContents( QPainter *p );
00059
00060 private:
00061 KPrBackGround *back;
00062
00063 };
00064
00065 class KPrBackDialog : public KDialogBase
00066 {
00067 Q_OBJECT
00068
00069 public:
00070 KPrBackDialog( QWidget* parent, const char* name,
00071 BackType backType, const QColor &backColor1,
00072 const QColor &backColor2, BCType _bcType,
00073 const KoPicture &backPic,
00074 BackView backPicView, bool _unbalanced,
00075 int _xfactor, int _yfactor, KPrPage *_page );
00076
00077 KPrBackGround::Settings getBackGround() const;
00078 bool useMasterBackground() const;
00079
00080 protected:
00081 void showEvent( QShowEvent *e );
00082 QColor getBackColor1() const;
00083 QColor getBackColor2() const;
00084 BCType getBackColorType() const;
00085 BackType getBackType() const;
00086 KoPicture getBackPicture() const { return m_picture; }
00087 BackView getBackView() const;
00088 bool getBackUnbalanced() const;
00089 int getBackXFactor() const;
00090 int getBackYFactor() const;
00091 private:
00092 QLabel *picPreview;
00093 QCheckBox *unbalanced;
00094 QComboBox *cType, *backCombo, *picView;
00095 QLabel *picChooseLabel;
00096 KURLRequester *picChoose;
00097 KColorButton *color1Choose, *color2Choose;
00098 QSlider *xfactor, *yfactor;
00099 KPrBackPreview *preview;
00100 bool picChanged, lockUpdate;
00101 QLabel *labXFactor, *labYFactor;
00102 QTabWidget *tabWidget;
00103 QCheckBox *m_useMasterBackground;
00104
00105 bool oldUseMasterBackground;
00106 BackType oldBackType;
00107 QColor oldBackColor1;
00108 QColor oldBackColor2;
00109 BCType oldBcType;
00110 BackView oldBackPicView;
00111 bool oldUnbalanced;
00112 int oldXFactor;
00113 int oldYFactor;
00114
00115 KoPicture m_picture, m_oldpicture;
00116 KPrPage *m_page;
00117
00118 private slots:
00119 void aboutToSelectPic();
00120 void afterSelectPic( const QString & );
00121 void updateConfiguration();
00122
00123 void Ok() { emit backOk( this, false ); }
00124 void Apply() { emit backOk( this, false ); }
00125 void ApplyGlobal() { emit backOk( this, true ); }
00126
00127 void changeComboText(int _p);
00128 void slotReset();
00129
00130 signals:
00131 void backOk( KPrBackDialog*, bool );
00132
00133 };
00134 #endif //BACKDIA_H
|