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 *cfg;
00063 QCheckBox *mSubTree;
00064 QMap<QString, QString> mAttributes;
00065 int mRDNPrefix, mCachePolicy;
00066 bool mAutoCache;
00067 QString mCacheDst;
00068 };
00069
00070 class AttributesDialog : public KDialog
00071 {
00072 Q_OBJECT
00073
00074 public:
00075 AttributesDialog( const QMap<QString, QString> &attributes, int rdnprefix,
00076 QWidget *parent );
00077 ~AttributesDialog();
00078
00079 QMap<QString, QString> attributes() const;
00080 int rdnprefix() const;
00081
00082 private Q_SLOTS:
00083 void mapChanged( int pos );
00084
00085 private:
00086 enum {
00087 UserMap,
00088 KolabMap,
00089 NetscapeMap,
00090 EvolutionMap,
00091 OutlookMap
00092 };
00093
00094 KComboBox *mMapCombo, *mRDNCombo;
00095 QList< QMap<QString, QString> > mMapList;
00096 QMap<QString, QString> mDefaultMap;
00097 QHash<QString, KLineEdit*> mLineEditDict;
00098 QHash<QString, QString> mNameDict;
00099 };
00100
00101 class OfflineDialog : public KDialog
00102 {
00103 Q_OBJECT
00104
00105 public:
00106 OfflineDialog( bool autoCache, int cachePolicy, const KUrl &src,
00107 const QString &dst, QWidget *parent );
00108 ~OfflineDialog();
00109
00110 int cachePolicy() const;
00111 bool autoCache() const;
00112
00113 private Q_SLOTS:
00114 void loadCache();
00115
00116 private:
00117 KUrl mSrc;
00118 QString mDst;
00119 QGroupBox *mCacheBox;
00120 QButtonGroup *mCacheGroup;
00121 QCheckBox *mAutoCache;
00122 };
00123
00124 }
00125
00126 #endif