kabc
resourceldapkioconfig.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef KABC_RESOURCELDAPKIOCONFIG_H
00022 #define KABC_RESOURCELDAPKIOCONFIG_H
00023
00024 #include "kabc/kabc_export.h"
00025 #include "kresources/configwidget.h"
00026 #include "kldap/ldapconfigwidget.h"
00027 #include "kldap/ldif.h"
00028
00029 #include <kdialog.h>
00030
00031 #include <QtGui/QButtonGroup>
00032 #include <QtGui/QComboBox>
00033 #include <QtGui/QGroupBox>
00034 #include <QtCore/QHash>
00035 #include <QtCore/QMap>
00036
00037 class QCheckBox;
00038 class QPushButton;
00039 class QString;
00040
00041 class KComboBox;
00042 class KLineEdit;
00043
00044 namespace KABC {
00045
00046 class KABC_LDAPKIO_EXPORT ResourceLDAPKIOConfig : public KRES::ConfigWidget
00047 {
00048 Q_OBJECT
00049
00050 public:
00051 ResourceLDAPKIOConfig( QWidget *parent = 0 );
00052
00053 public Q_SLOTS:
00054 void loadSettings( KRES::Resource *resource );
00055 void saveSettings( KRES::Resource *resource );
00056
00057 private Q_SLOTS:
00058 void editAttributes();
00059 void editCache();
00060 private:
00061 QPushButton *mEditButton, *mCacheButton;
00062 KLDAP::LdapConfigWidget *mCfg;
00063 KLDAP::LdapConfigWidget *mSecurityCfg;
00064 QCheckBox *mSubTree;
00065 QMap<QString, QString> mAttributes;
00066 int mRDNPrefix, mCachePolicy;
00067 bool mAutoCache;
00068 QString mCacheDst;
00069 };
00070
00071 class AttributesDialog : public KDialog
00072 {
00073 Q_OBJECT
00074
00075 public:
00076 AttributesDialog( const QMap<QString, QString> &attributes, int rdnprefix,
00077 QWidget *parent );
00078 ~AttributesDialog();
00079
00080 QMap<QString, QString> attributes() const;
00081 int rdnprefix() const;
00082
00083 private Q_SLOTS:
00084 void mapChanged( int pos );
00085
00086 private:
00087 enum {
00088 UserMap,
00089 KolabMap,
00090 NetscapeMap,
00091 EvolutionMap,
00092 OutlookMap
00093 };
00094
00095 KComboBox *mMapCombo, *mRDNCombo;
00096 QList< QMap<QString, QString> > mMapList;
00097 QMap<QString, QString> mDefaultMap;
00098 QHash<QString, KLineEdit*> mLineEditDict;
00099 QHash<QString, QString> mNameDict;
00100 };
00101
00102 class OfflineDialog : public KDialog
00103 {
00104 Q_OBJECT
00105
00106 public:
00107 OfflineDialog( bool autoCache, int cachePolicy, const KUrl &src,
00108 const QString &dst, QWidget *parent );
00109 ~OfflineDialog();
00110
00111 int cachePolicy() const;
00112 bool autoCache() const;
00113
00114 private Q_SLOTS:
00115 void loadCache();
00116
00117 private:
00118 KUrl mSrc;
00119 QString mDst;
00120 QGroupBox *mCacheBox;
00121 QButtonGroup *mCacheGroup;
00122 QCheckBox *mAutoCache;
00123 };
00124
00125 }
00126
00127 #endif