addresseelineedit.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef ADDRESSEELINEEDIT_H
00027 #define ADDRESSEELINEEDIT_H
00028
00029 #include <qobject.h>
00030 #include <qptrlist.h>
00031 #include <qtimer.h>
00032 #include <qvaluelist.h>
00033
00034 #include <kabc/addressee.h>
00035
00036 #include "clicklineedit.h"
00037 #include "kcompletion.h"
00038 #include <dcopobject.h>
00039
00040 class KConfig;
00041
00042 namespace KPIM {
00043 class LdapSearch;
00044 class LdapResult;
00045 typedef QValueList<LdapResult> LdapResultList;
00046 }
00047
00048 namespace KPIM {
00049
00050 class AddresseeLineEdit : public ClickLineEdit, public DCOPObject
00051 {
00052 K_DCOP
00053 Q_OBJECT
00054
00055 public:
00056 AddresseeLineEdit( QWidget* parent, bool useCompletion = true,
00057 const char *name = 0L);
00058 virtual ~AddresseeLineEdit();
00059
00060 virtual void setFont( const QFont& );
00061
00062 static KConfig *config();
00063
00064 public slots:
00065 void cursorAtEnd();
00066 void enableCompletion( bool enable );
00067
00068 protected slots:
00069 virtual void loadContacts();
00070 protected:
00071 void addContact( const KABC::Addressee&, int weight );
00072 virtual void keyPressEvent( QKeyEvent* );
00081 virtual void insert( const QString &text );
00083 virtual void paste();
00085 virtual void mouseReleaseEvent( QMouseEvent *e );
00087 virtual void dropEvent( QDropEvent *e );
00088 void doCompletion( bool ctrlT );
00089 virtual QPopupMenu *createPopupMenu();
00090
00091 k_dcop:
00092
00093 void slotIMAPCompletionOrderChanged();
00094
00095 private slots:
00096 void slotCompletion();
00097 void slotPopupCompletion( const QString& );
00098 void slotStartLDAPLookup();
00099 void slotLDAPSearchData( const KPIM::LdapResultList& );
00100 void slotEditCompletionOrder();
00101 void slotUserCancelled( const QString& );
00102
00103 private:
00104 void init();
00105 void startLoadingLDAPEntries();
00106 void stopLDAPLookup();
00107
00108 void setCompletedItems( const QStringList& items, bool autoSuggest );
00109 QString completionSearchText( QString& );
00110
00111 QString m_previousAddresses;
00112 QString m_searchString;
00113 bool m_useCompletion;
00114 bool m_completionInitialized;
00115 bool m_smartPaste;
00116 bool m_addressBookConnected;
00117
00118
00119
00120 static bool s_addressesDirty;
00121 static KCompletion *s_completion;
00122 static QTimer *s_LDAPTimer;
00123 static KPIM::LdapSearch *s_LDAPSearch;
00124 static QString *s_LDAPText;
00125 static AddresseeLineEdit *s_LDAPLineEdit;
00126 static KConfig *s_config;
00127
00128 class AddresseeLineEditPrivate;
00129 AddresseeLineEditPrivate *d;
00130 };
00131
00132 }
00133
00134 #endif
This file is part of the documentation for libkdepim Library Version 3.3.2.