kpresenter

KPrBackDia.h

00001 // -*- Mode: c++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 4; -*-
00002 /* This file is part of the KDE project
00003    Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
00004 
00005    This library is free software; you can redistribute it and/or
00006    modify it under the terms of the GNU Library General Public
00007    License as published by the Free Software Foundation; either
00008    version 2 of the License, or (at your option) any later version.
00009 
00010    This library is distributed in the hope that it will be useful,
00011    but WITHOUT ANY WARRANTY; without even the implied warranty of
00012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013    Library General Public License for more details.
00014 
00015    You should have received a copy of the GNU Library General Public License
00016    along with this library; see the file COPYING.LIB.  If not, write to
00017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00018  * Boston, MA 02110-1301, USA.
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 *m_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 
00117 private slots:
00118     void aboutToSelectPic();
00119     void afterSelectPic( const QString & );
00120     void updateConfiguration();
00121 
00122     void Ok() { emit backOk( this, false ); }
00123     void Apply() { emit backOk( this, false ); }
00124     void ApplyGlobal() { emit backOk( this, true ); }
00125 
00126     void changeComboText(int _p);
00127     void slotReset();
00128 
00129 signals:
00130     void backOk( KPrBackDialog*, bool );
00131 
00132 };
00133 #endif //BACKDIA_H
KDE Home | KDE Accessibility Home | Description of Access Keys