kpresenter

KPrBackDia.h
1/* This file is part of the KDE project
2 Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
3
4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This library 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 GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef BACKDIA_H
21#define BACKDIA_H
22
23#include <kdialogbase.h>
24#include <tqframe.h>
25#include <tqdatetime.h>
26
27#include "global.h"
28#include "KPrBackground.h"
29
30#include <KoBrush.h>
31#include <KoPicture.h>
32
33class TQLabel;
34class TQComboBox;
35class KColorButton;
36class TQSlider;
37class KPrBackGround;
38class TQCheckBox;
39class TQTabWidget;
40class KPrPage;
41class KURLRequester;
42
43
44class KPrBackPreview : public TQFrame
45{
46 TQ_OBJECT
47
48
49public:
50 KPrBackPreview( TQWidget *parent, KPrPage *page );
51 virtual ~KPrBackPreview();
52
53 KPrBackGround *backGround() const {
54 return back;
55 }
56
57protected:
58 virtual void drawContents( TQPainter *p );
59
60private:
61 KPrBackGround *back;
62
63};
64
65class KPrBackDialog : public KDialogBase
66{
67 TQ_OBJECT
68
69
70public:
71 KPrBackDialog( TQWidget* parent, const char* name,
72 BackType backType, const TQColor &backColor1,
73 const TQColor &backColor2, BCType _bcType,
74 const KoPicture &backPic,
75 BackView backPicView, bool _unbalanced,
76 int _xfactor, int _yfactor, KPrPage *_page );
77
78 KPrBackGround::Settings getBackGround() const;
79 bool useMasterBackground() const;
80
81protected:
82 void showEvent( TQShowEvent *e );
83 TQColor getBackColor1() const;
84 TQColor getBackColor2() const;
85 BCType getBackColorType() const;
86 BackType getBackType() const;
87 KoPicture getBackPicture() const { return m_picture; }
88 BackView getBackView() const;
89 bool getBackUnbalanced() const;
90 int getBackXFactor() const;
91 int getBackYFactor() const;
92private:
93 TQLabel *picPreview;
94 TQCheckBox *unbalanced;
95 TQComboBox *cType, *backCombo, *picView;
96 TQLabel *picChooseLabel;
97 KURLRequester *picChoose;
98 KColorButton *color1Choose, *color2Choose;
99 TQSlider *xfactor, *yfactor;
100 KPrBackPreview *preview;
101 bool picChanged, lockUpdate;
102 TQLabel *labXFactor, *labYFactor;
103 TQTabWidget *tabWidget;
104 TQCheckBox *m_useMasterBackground;
105
106 bool oldUseMasterBackground;
107 BackType oldBackType;
108 TQColor oldBackColor1;
109 TQColor oldBackColor2;
110 BCType oldBcType;
111 BackView oldBackPicView;
112 bool oldUnbalanced;
113 int oldXFactor;
114 int oldYFactor;
115
116 KoPicture m_picture, m_oldpicture;
117 KPrPage *m_page;
118
119private slots:
120 void aboutToSelectPic();
121 void afterSelectPic( const TQString & );
122 void updateConfiguration();
123
124 void Ok() { emit backOk( this, false ); }
125 void Apply() { emit backOk( this, false ); }
126 void ApplyGlobal() { emit backOk( this, true ); }
127
128 void changeComboText(int _p);
129 void slotReset();
130
131signals:
132 void backOk( KPrBackDialog*, bool );
133
134};
135#endif //BACKDIA_H