certmanager/lib Library API Documentation

cryptoconfigmodule_p.h

00001 /*
00002     cryptoconfigmodule_p.h
00003 
00004     This file is part of libkleopatra
00005     Copyright (c) 2004,2005 Klarälvdalens Datakonsult AB
00006 
00007     Libkleopatra is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU General Public License,
00009     version 2, as published by the Free Software Foundation.
00010 
00011     Libkleopatra 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     General Public License for more details.
00015 
00016     You should have received a copy of the GNU General Public License
00017     along with this program; if not, write to the Free Software
00018     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00019 
00020     In addition, as a special exception, the copyright holders give
00021     permission to link the code of this program with any edition of
00022     the Qt library by Trolltech AS, Norway (or with modified versions
00023     of Qt that use the same license as Qt), and distribute linked
00024     combinations including the two.  You must obey the GNU General
00025     Public License in all respects for all of the code used other than
00026     Qt.  If you modify this file, you may extend this exception to
00027     your version of the file, but you are not obligated to do so.  If
00028     you do not wish to do so, delete this exception statement from
00029     your version.
00030 */
00031 
00032 #ifndef CRYPTOCONFIGMODULE_P_H
00033 #define CRYPTOCONFIGMODULE_P_H
00034 
00035 #include <qtabwidget.h>
00036 #include <qhbox.h>
00037 #include <qcheckbox.h>
00038 #include <kurl.h>
00039 
00040 class KLineEdit;
00041 class KIntNumInput;
00042 class KURLRequester;
00043 class QPushButton;
00044 class QGridLayout;
00045 
00046 namespace Kleo {
00047 
00048   class CryptoConfig;
00049   class CryptoConfigComponent;
00050   class CryptoConfigGroup;
00051   class CryptoConfigEntry;
00052   class CryptoConfigComponentGUI;
00053   class CryptoConfigGroupGUI;
00054   class CryptoConfigEntryGUI;
00055 
00059   class CryptoConfigComponentGUI : public QWidget {
00060     Q_OBJECT
00061 
00062   public:
00063     CryptoConfigComponentGUI( CryptoConfigModule* module, Kleo::CryptoConfigComponent* component,
00064                               QWidget* parent, const char* name = 0 );
00065 
00066     bool save();
00067     void load();
00068     void defaults();
00069 
00070   private:
00071     Kleo::CryptoConfigComponent* mComponent;
00072     QValueList<CryptoConfigGroupGUI *> mGroupGUIs;
00073   };
00074 
00078   class CryptoConfigGroupGUI : public QObject {
00079     Q_OBJECT
00080 
00081   public:
00082     CryptoConfigGroupGUI( CryptoConfigModule* module, Kleo::CryptoConfigGroup* group,
00083                           QGridLayout * layout, QWidget* parent, const char* name = 0 );
00084 
00085     bool save();
00086     void load();
00087     void defaults();
00088 
00089   private:
00090     Kleo::CryptoConfigGroup* mGroup;
00091     QValueList<CryptoConfigEntryGUI *> mEntryGUIs;
00092   };
00093 
00098   class CryptoConfigEntryGUIFactory {
00099   public:
00100     static CryptoConfigEntryGUI* createEntryGUI(
00101       CryptoConfigModule* module,
00102       Kleo::CryptoConfigEntry* entry, const QString& entryName,
00103       QGridLayout * layout, QWidget* widget, const char* name = 0 );
00104   };
00105 
00109   class CryptoConfigEntryGUI : public QObject {
00110     Q_OBJECT
00111   public:
00112     CryptoConfigEntryGUI( CryptoConfigModule* module,
00113                           Kleo::CryptoConfigEntry* entry,
00114                           const QString& entryName,
00115                           const char* name = 0 );
00116     virtual ~CryptoConfigEntryGUI() {}
00117 
00118     void load() { doLoad(); mChanged = false; }
00119     void save() { Q_ASSERT( mChanged ); doSave(); mChanged = false; }
00120     void resetToDefault();
00121 
00122     QString description() const;
00123     bool isChanged() const { return mChanged; }
00124 
00125   signals:
00126     void changed();
00127 
00128   protected slots:
00129     void slotChanged() {
00130       mChanged = true;
00131       emit changed();
00132     }
00133 
00134   protected:
00135     virtual void doSave() = 0;
00136     virtual void doLoad() = 0;
00137 
00138     Kleo::CryptoConfigEntry* mEntry;
00139     QString mName;
00140     bool mChanged;
00141   };
00142 
00146   class CryptoConfigEntryLineEdit : public CryptoConfigEntryGUI {
00147     Q_OBJECT
00148 
00149   public:
00150     CryptoConfigEntryLineEdit( CryptoConfigModule* module,
00151                                Kleo::CryptoConfigEntry* entry,
00152                                const QString& entryName,
00153                                QGridLayout * layout,
00154                                QWidget* parent, const char* name = 0 );
00155 
00156     virtual void doSave();
00157     virtual void doLoad();
00158   private:
00159     KLineEdit* mLineEdit;
00160   };
00161 
00165   class CryptoConfigEntryPath : public CryptoConfigEntryGUI {
00166     Q_OBJECT
00167 
00168   public:
00169     CryptoConfigEntryPath( CryptoConfigModule* module,
00170                            Kleo::CryptoConfigEntry* entry,
00171                            const QString& entryName,
00172                            QGridLayout * layout,
00173                            QWidget* parent, const char* name = 0 );
00174 
00175     virtual void doSave();
00176     virtual void doLoad();
00177   private:
00178     KURLRequester* mUrlRequester;
00179   };
00180 
00184   class CryptoConfigEntryDirPath : public CryptoConfigEntryGUI {
00185     Q_OBJECT
00186 
00187   public:
00188     CryptoConfigEntryDirPath( CryptoConfigModule* module,
00189                               Kleo::CryptoConfigEntry* entry,
00190                               const QString& entryName,
00191                               QGridLayout * layout,
00192                               QWidget* parent, const char* name = 0 );
00193 
00194     virtual void doSave();
00195     virtual void doLoad();
00196   private:
00197     KURLRequester* mUrlRequester;
00198   };
00199 
00203   class CryptoConfigEntryURL : public CryptoConfigEntryGUI {
00204     Q_OBJECT
00205 
00206   public:
00207     CryptoConfigEntryURL( CryptoConfigModule* module,
00208                           Kleo::CryptoConfigEntry* entry,
00209                           const QString& entryName,
00210                           QGridLayout * layout,
00211                           QWidget* parent, const char* name = 0 );
00212 
00213     virtual void doSave();
00214     virtual void doLoad();
00215   private:
00216     KURLRequester * mUrlRequester;
00217   };
00218 
00222   class CryptoConfigEntrySpinBox : public CryptoConfigEntryGUI {
00223     Q_OBJECT
00224 
00225   public:
00226     CryptoConfigEntrySpinBox( CryptoConfigModule* module,
00227                               Kleo::CryptoConfigEntry* entry,
00228                               const QString& entryName,
00229                               QGridLayout * layout,
00230                               QWidget* parent, const char* name = 0 );
00231     virtual void doSave();
00232     virtual void doLoad();
00233   private:
00234     enum { Int, UInt, ListOfNone } mKind;
00235     KIntNumInput* mNumInput;
00236   };
00237 
00241   class CryptoConfigEntryCheckBox : public CryptoConfigEntryGUI {
00242     Q_OBJECT
00243 
00244   public:
00245     CryptoConfigEntryCheckBox( CryptoConfigModule* module,
00246                                Kleo::CryptoConfigEntry* entry,
00247                                const QString& entryName,
00248                                QGridLayout * layout,
00249                                QWidget* parent, const char* name = 0 );
00250     virtual void doSave();
00251     virtual void doLoad();
00252   private:
00253     QCheckBox* mCheckBox;
00254   };
00255 
00259   class CryptoConfigEntryLDAPURL : public CryptoConfigEntryGUI {
00260     Q_OBJECT
00261 
00262   public:
00263     CryptoConfigEntryLDAPURL( CryptoConfigModule* module,
00264                               Kleo::CryptoConfigEntry* entry,
00265                               const QString& entryName,
00266                               QGridLayout * layout,
00267                               QWidget* parent, const char* name = 0 );
00268     virtual void doSave();
00269     virtual void doLoad();
00270   private slots:
00271     void slotOpenDialog();
00272   private:
00273     void setURLList( const KURL::List& urlList );
00274     QLabel* mLabel;
00275     QPushButton* mPushButton;
00276     KURL::List mURLList;
00277   };
00278 }
00279 
00280 #endif // CRYPTOCONFIGMODULE_P_H
KDE Logo
This file is part of the documentation for certmanager/lib Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jan 31 15:53:09 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003