addresslineedit.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef KABC_ADDRESSLINEEDIT_H
00023 #define KABC_ADDRESSLINEEDIT_H
00024
00025
00026 #include <qobject.h>
00027 #include <qptrlist.h>
00028 #include <qtimer.h>
00029
00030 #include "klineedit.h"
00031 #include "kcompletion.h"
00032
00033 namespace KABC {
00034
00035 class LdapSearch;
00036
00048 class AddressLineEdit : public KLineEdit
00049 {
00050 Q_OBJECT
00051 public:
00052 AddressLineEdit(QWidget* parent, bool useCompletion = true,
00053 const char *name = 0L);
00054 virtual ~AddressLineEdit();
00055
00060 virtual void setFont( const QFont& );
00061
00062 public slots:
00066 void cursorAtEnd();
00070 void enableCompletion( bool enable );
00071
00072 protected:
00077 virtual void loadAddresses();
00078 void addAddress( const QString& );
00079 virtual void keyPressEvent(QKeyEvent*);
00080 virtual void dropEvent(QDropEvent *e);
00081 virtual void paste();
00082 virtual void insert(const QString &t);
00083 virtual void mouseReleaseEvent( QMouseEvent * e );
00084 void doCompletion(bool ctrlT);
00085
00086 private slots:
00087 void slotCompletion() { doCompletion(false); }
00088 void slotPopupCompletion( const QString& );
00089 void slotStartLDAPLookup();
00090 void slotLDAPSearchData( const QStringList& );
00091 void slotSetTextAsEdited( const QString &text );
00092
00093 private:
00094 void init();
00095 void startLoadingLDAPEntries();
00096 void stopLDAPLookup();
00097 QStringList addresses();
00098 QStringList removeMailDupes( const QStringList& adrs );
00099
00100 QString m_previousAddresses;
00101 bool m_useCompletion;
00102 bool m_completionInitialized;
00103 bool m_smartPaste;
00104 QString m_typedText;
00105
00106 static bool s_addressesDirty;
00107 static KCompletion *s_completion;
00108 static QTimer *s_LDAPTimer;
00109 static LdapSearch *s_LDAPSearch;
00110 static QString *s_LDAPText;
00111 static AddressLineEdit *s_LDAPLineEdit;
00112 private:
00113 class AddressLineEditPrivate* d;
00114 };
00115
00116 }
00117
00118 #endif
This file is part of the documentation for kdelibs Version 3.1.4.