libkdepim

kconfigwizard.h
00001 /*
00002     This file is part of libkdepim.
00003 
00004     Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
00005 
00006     This library is free software; you can redistribute it and/or
00007     modify it under the terms of the GNU Library General Public
00008     License as published by the Free Software Foundation; either
00009     version 2 of the License, or (at your option) any later version.
00010 
00011     This library is distributed in the hope that it will be useful,
00012     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014     Library General Public License for more details.
00015 
00016     You should have received a copy of the GNU Library General Public License
00017     along with this library; see the file COPYING.LIB.  If not, write to
00018     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019     Boston, MA 02110-1301, USA.
00020 */
00021 #ifndef KCONFIGWIZARD_H
00022 #define KCONFIGWIZARD_H
00023 
00024 #include <kconfigpropagator.h>
00025 #include <kdepimmacros.h>
00026 #include <kdialogbase.h>
00027 
00028 class TQListView;
00029 
00033 class KDE_EXPORT KConfigWizard : public KDialogBase
00034 {
00035     Q_OBJECT
00036   TQ_OBJECT
00037   public:
00041     KConfigWizard( TQWidget *parent = 0, char *name = 0, bool modal = false );
00046     KConfigWizard( KConfigPropagator *propagator, TQWidget *parent = 0,
00047                    char *name = 0, bool modal = false );
00051     virtual ~KConfigWizard();
00052 
00056     void setPropagator( KConfigPropagator * );
00060     KConfigPropagator *propagator() { return mPropagator; }
00061 
00065     TQFrame *createWizardPage( const TQString &title );
00066 
00071     virtual void usrReadConfig() = 0;
00072 
00078     virtual void usrWriteConfig() = 0;
00079 
00084     virtual TQString validate() { return TQString(); }
00085 
00086   protected slots:
00087     void readConfig();
00088 
00089     void slotOk();
00090 
00091     void slotAboutToShowPage( TQWidget *page );
00092 
00093   protected:
00094     void init();
00095 
00096     void setupRulesPage();
00097     void updateRules();
00098     void setupChangesPage();
00099     void updateChanges();
00100 
00101   private:
00102     KConfigPropagator *mPropagator;
00103 
00104     TQListView *mRuleView;
00105     TQListView *mChangeView;
00106 
00107     TQWidget *mChangesPage;
00108 };
00109 
00110 #endif