resourceldaptdeioconfig.h
00001 /* 00002 This file is part of libtdeabc. 00003 Copyright (c) 2002 - 2003 Tobias Koenig <tokoe@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation; either 00008 version 2 of the License, or (at your option) any later version. 00009 00010 This library is distributed in the hope that it will be useful, 00011 but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 Library General Public License for more details. 00014 00015 You should have received a copy of the GNU Library General Public License 00016 along with this library; see the file COPYING.LIB. If not, write to 00017 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 Boston, MA 02110-1301, USA. 00019 */ 00020 00021 #ifndef RESOURCELDAPCONFIG_H 00022 #define RESOURCELDAPCONFIG_H 00023 00024 #include <tqmap.h> 00025 #include <tqradiobutton.h> 00026 #include <tqcombobox.h> 00027 #include <tqdict.h> 00028 00029 #include <kdialogbase.h> 00030 #include <tderesources/configwidget.h> 00031 #include <tdeabc/ldif.h> 00032 #include <tdeabc/ldapconfigwidget.h> 00033 00034 00035 class TQCheckBox; 00036 class TQPushButton; 00037 class TQSpinBox; 00038 class TQString; 00039 00040 class KComboBox; 00041 class KLineEdit; 00042 00043 namespace TDEABC { 00044 00045 class KABC_EXPORT ResourceLDAPTDEIOConfig : public KRES::ConfigWidget 00046 { 00047 Q_OBJECT 00048 00049 public: 00050 ResourceLDAPTDEIOConfig( TQWidget* parent = 0, const char* name = 0 ); 00051 00052 public slots: 00053 void loadSettings( KRES::Resource* ); 00054 void saveSettings( KRES::Resource* ); 00055 00056 private slots: 00057 void editAttributes(); 00058 void editCache(); 00059 private: 00060 TQPushButton *mEditButton, *mCacheButton; 00061 LdapConfigWidget *cfg; 00062 TQCheckBox *mSubTree; 00063 TQMap<TQString, TQString> mAttributes; 00064 int mRDNPrefix, mCachePolicy; 00065 bool mAutoCache; 00066 TQString mCacheDst; 00067 }; 00068 00069 class AttributesDialog : public KDialogBase 00070 { 00071 Q_OBJECT 00072 00073 public: 00074 AttributesDialog( const TQMap<TQString, TQString> &attributes, int rdnprefix, 00075 TQWidget *parent, const char *name = 0 ); 00076 ~AttributesDialog(); 00077 00078 TQMap<TQString, TQString> attributes() const; 00079 int rdnprefix() const; 00080 00081 private slots: 00082 void mapChanged( int pos ); 00083 00084 private: 00085 enum { UserMap, KolabMap, NetscapeMap, EvolutionMap, OutlookMap }; 00086 00087 KComboBox *mMapCombo, *mRDNCombo; 00088 TQValueList< TQMap<TQString, TQString> > mMapList; 00089 TQMap<TQString, TQString> mDefaultMap; 00090 TQDict<KLineEdit> mLineEditDict; 00091 TQDict<TQString> mNameDict; 00092 }; 00093 00094 class OfflineDialog : public KDialogBase 00095 { 00096 Q_OBJECT 00097 00098 public: 00099 OfflineDialog( bool autoCache, int cachePolicy, const KURL &src, 00100 const TQString &dst, TQWidget *parent, const char *name = 0 ); 00101 ~OfflineDialog(); 00102 00103 int cachePolicy() const; 00104 bool autoCache() const; 00105 00106 private slots: 00107 void loadCache(); 00108 00109 private: 00110 KURL mSrc; 00111 TQString mDst; 00112 TQButtonGroup *mCacheGroup; 00113 TQCheckBox *mAutoCache; 00114 }; 00115 00116 } 00117 00118 #endif