kpresenter

KPrMSPresentationSetup.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) 2004 Brad Hards <bradh@frogmouth.net>
00004    Based heavily on webpresentation.h, which is:
00005      Copyright (C) 1998, 1999 Reginald Stadlbauer <reggie@kde.org>
00006 
00007    This library is free software; you can redistribute it and/or
00008    modify it under the terms of the GNU Library General Public
00009    License as published by the Free Software Foundation; either
00010    version 2 of the License, or (at your option) any later version.
00011 
00012    This library is distributed in the hope that it will be useful,
00013    but WITHOUT ANY WARRANTY; without even the implied warranty of
00014    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015    Library General Public License for more details.
00016 
00017    You should have received a copy of the GNU Library General Public License
00018    along with this library; see the file COPYING.LIB.  If not, write to
00019    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00020  * Boston, MA 02110-1301, USA.
00021 */
00022 
00023 #ifndef mspresentation_h
00024 #define mspresentation_h
00025 
00026 #include <kwizard.h>
00027 
00028 #include <qdialog.h>
00029 #include <qvaluelist.h>
00030 
00031 
00032 class KPrDocument;
00033 class KPrView;
00034 
00035 class KURLRequester;
00036 class KColorButton;
00037 class KListView;
00038 class KIntNumInput;
00039 class KLineEdit;
00040 class KComboBox;
00041 
00042 class QVBox;
00043 class QHBox;
00044 
00045 class QListViewItem;
00046 class QCloseEvent;
00047 class KProgress;
00048 class QLabel;
00049 class QGroupBox;
00050 class QVBoxLayout;
00051 
00052 class KPrMSPresentation
00053 {
00054 public:
00055 
00056     KPrMSPresentation( KPrDocument *_doc, KPrView *_view );
00057     KPrMSPresentation( const KPrMSPresentation &msPres );
00058 
00059     void setTitle( const QString &_title )
00060         { title = _title; }
00061     void setBackColour( const QColor &_backColour )
00062         { backColour = _backColour; }
00063     void setTextColour( const QColor &_textColour )
00064         { textColour = _textColour; }
00065     void setPath( const QString &_path )
00066         { path = _path; }
00067 
00068     QString getTitle() const { return title; }
00069     QColor getBackColour() const { return backColour; }
00070     QColor getTextColour() const { return textColour; }
00071     QString getPath() const { return path; }
00072 
00073     struct SlideInfo {
00074         int pageNumber; /* 0-based */
00075     };
00076     QValueList<SlideInfo> getSlideInfos() const { return slideInfos; }
00077 
00078     int initSteps() const { return 7; }
00079     int slidesSteps() { return slideInfos.count(); }
00080     int indexFileSteps() const { return 4 + slideInfos.count(); }
00081 
00082     void initCreation( KProgress *progressBar );
00083     void createSlidesPictures( KProgress *progressBar );
00084     void createIndexFile( KProgress *progressBar );
00085 
00086 protected:
00087     void init();
00088 
00089     KPrDocument *doc;
00090     KPrView *view;
00091 
00092     QString title;
00093     QValueList<SlideInfo> slideInfos;
00094     QColor backColour, textColour;
00095     QString path;
00096     QString slidePath; // directory relative to path, containing slides 
00097 
00098 };
00099 
00100 class KPrMSPresentationSetup : public QDialog
00101 {
00102     Q_OBJECT
00103 
00104 public:
00105     KPrMSPresentationSetup( KPrDocument *_doc, KPrView *_view );
00106     ~KPrMSPresentationSetup();
00107 
00108     static void createMSPresentation( KPrDocument *_doc, KPrView *_view );
00109 
00110 protected:
00111     KPrDocument *doc;
00112     KPrView *view;
00113     KPrMSPresentation msPres;
00114 
00115     KLineEdit *title;
00116     KColorButton *textColour, *backColour;
00117     QGroupBox *colourGroup;
00118     QVBoxLayout *mainLayout;
00119     KURLRequester *path;
00120 
00121 protected slots:
00122     void slotChoosePath(const QString &);
00123     virtual void finish();
00124     virtual void helpMe();
00125     void showColourGroup(bool on);
00126 };
00127 
00128 class KPrMSPresentationCreateDialog : public QDialog
00129 {
00130     Q_OBJECT
00131 
00132 public:
00133     KPrMSPresentationCreateDialog( KPrDocument *_doc, KPrView *_view, const KPrMSPresentation &_msPres );
00134     ~KPrMSPresentationCreateDialog();
00135 
00136     static void createMSPresentation( KPrDocument *_doc, KPrView *_view, const KPrMSPresentation &_msPres );
00137 
00138     void start();
00139 
00140     void initCreation();
00141     void createSlidesPictures();
00142     void createIndexFile();
00143 
00144 protected:
00145     void setupGUI();
00146     void resizeEvent( QResizeEvent *e );
00147 
00148     KPrView *view;
00149     KPrDocument *doc;
00150     KPrMSPresentation msPres;
00151 
00152     KProgress *progressBar;
00153     QLabel *step1, *step2, *step3;
00154     QPushButton *bDone;
00155     QVBox *back;
00156 
00157 };
00158 #endif
00159 
KDE Home | KDE Accessibility Home | Description of Access Keys