kpresenter

KPrMSPresentationSetup.h
1/* This file is part of the KDE project
2 Copyright (C) 2004 Brad Hards <bradh@frogmouth.net>
3 Based heavily on webpresentation.h, which is:
4 Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later version.
10
11 This library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Library General Public License for more details.
15
16 You should have received a copy of the GNU Library General Public License
17 along with this library; see the file COPYING.LIB. If not, write to
18 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
20*/
21
22#ifndef mspresentation_h
23#define mspresentation_h
24
25#include <kwizard.h>
26
27#include <tqdialog.h>
28#include <tqvaluelist.h>
29
30
31class KPrDocument;
32class KPrView;
33
34class KURLRequester;
35class KColorButton;
36class TDEListView;
37class KIntNumInput;
38class KLineEdit;
39class KComboBox;
40
41class TQVBox;
42class TQHBox;
43
44class TQListViewItem;
45class TQCloseEvent;
46class KProgress;
47class TQLabel;
48class TQGroupBox;
49class TQVBoxLayout;
50
51class KPrMSPresentation
52{
53public:
54
55 KPrMSPresentation( KPrDocument *_doc, KPrView *_view );
56 KPrMSPresentation( const KPrMSPresentation &msPres );
57
58 void setTitle( const TQString &_title )
59 { title = _title; }
60 void setBackColour( const TQColor &_backColour )
61 { backColour = _backColour; }
62 void setTextColour( const TQColor &_textColour )
63 { textColour = _textColour; }
64 void setPath( const TQString &_path )
65 { path = _path; }
66
67 TQString getTitle() const { return title; }
68 TQColor getBackColour() const { return backColour; }
69 TQColor getTextColour() const { return textColour; }
70 TQString getPath() const { return path; }
71
72 struct SlideInfo {
73 int pageNumber; /* 0-based */
74 };
75 TQValueList<SlideInfo> getSlideInfos() const { return slideInfos; }
76
77 int initSteps() const { return 7; }
78 int slidesSteps() { return slideInfos.count(); }
79 int indexFileSteps() const { return 4 + slideInfos.count(); }
80
81 void initCreation( KProgress *progressBar );
82 void createSlidesPictures( KProgress *progressBar );
83 void createIndexFile( KProgress *progressBar );
84
85protected:
86 void init();
87
88 KPrDocument *doc;
89 KPrView *view;
90
91 TQString title;
92 TQValueList<SlideInfo> slideInfos;
93 TQColor backColour, textColour;
94 TQString path;
95 TQString slidePath; // directory relative to path, containing slides
96
97};
98
99class KPrMSPresentationSetup : public TQDialog
100{
101 TQ_OBJECT
102
103
104public:
105 KPrMSPresentationSetup( KPrDocument *_doc, KPrView *_view );
106 ~KPrMSPresentationSetup();
107
108 static void createMSPresentation( KPrDocument *_doc, KPrView *_view );
109
110protected:
111 KPrDocument *doc;
112 KPrView *view;
113 KPrMSPresentation msPres;
114
115 KLineEdit *title;
116 KColorButton *textColour, *backColour;
117 TQGroupBox *colourGroup;
118 TQVBoxLayout *mainLayout;
119 KURLRequester *path;
120
121protected slots:
122 void slotChoosePath(const TQString &);
123 virtual void finish();
124 virtual void helpMe();
125 void showColourGroup(bool on);
126};
127
128class KPrMSPresentationCreateDialog : public TQDialog
129{
130 TQ_OBJECT
131
132
133public:
134 KPrMSPresentationCreateDialog( KPrDocument *_doc, KPrView *_view, const KPrMSPresentation &_msPres );
135 ~KPrMSPresentationCreateDialog();
136
137 static void createMSPresentation( KPrDocument *_doc, KPrView *_view, const KPrMSPresentation &_msPres );
138
139 void start();
140
141 void initCreation();
142 void createSlidesPictures();
143 void createIndexFile();
144
145protected:
146 void setupGUI();
147 void resizeEvent( TQResizeEvent *e );
148
149 KPrView *view;
150 KPrDocument *doc;
151 KPrMSPresentation msPres;
152
153 KProgress *progressBar;
154 TQLabel *step1, *step2, *step3;
155 TQPushButton *bDone;
156 TQVBox *back;
157
158};
159#endif
160