libkdepim Library API Documentation

addresseelineedit.h

00001 /* 00002 This file is part of libkdepim. 00003 Copyright (c) 2002 Helge Deller <deller@gmx.de> 00004 2002 Lubos Lunak <llunak@suse.cz> 00005 2001,2003 Carsten Pfeiffer <pfeiffer@kde.org> 00006 2001 Waldo Bastian <bastian@kde.org> 00007 2004 Daniel Molkentin <danimo@klaralvdalens-datakonsult.se> 00008 2004 Karl-Heinz Zimmer <khz@klaralvdalens-datakonsult.se> 00009 00010 This library is free software; you can redistribute it and/or 00011 modify it under the terms of the GNU Library General Public 00012 License as published by the Free Software Foundation; either 00013 version 2 of the License, or (at your option) any later version. 00014 00015 This library is distributed in the hope that it will be useful, 00016 but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 Library General Public License for more details. 00019 00020 You should have received a copy of the GNU Library General Public License 00021 along with this library; see the file COPYING.LIB. If not, write to 00022 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00023 Boston, MA 02111-1307, USA. 00024 */ 00025 00026 #ifndef ADDRESSEELINEEDIT_H 00027 #define ADDRESSEELINEEDIT_H 00028 00029 #include <qobject.h> 00030 #include <qptrlist.h> 00031 #include <qtimer.h> 00032 00033 #include <kabc/addressee.h> 00034 00035 #include "clicklineedit.h" 00036 #include "kcompletion.h" 00037 00038 class KConfig; 00039 template<typename T> class QValueList; 00040 00041 namespace KPIM { 00042 class LdapSearch; 00043 class LdapResult; 00044 typedef QValueList<LdapResult> LdapResultList; 00045 } 00046 00047 namespace KPIM { 00048 00049 class AddresseeLineEdit : public ClickLineEdit 00050 { 00051 Q_OBJECT 00052 00053 public: 00054 AddresseeLineEdit( QWidget* parent, bool useCompletion = true, 00055 const char *name = 0L); 00056 virtual ~AddresseeLineEdit(); 00057 00058 virtual void setFont( const QFont& ); 00059 00060 static KConfig *config(); 00061 00062 public slots: 00063 void cursorAtEnd(); 00064 void enableCompletion( bool enable ); 00065 00066 protected slots: 00067 virtual void loadContacts(); 00068 protected: 00069 void addContact( const KABC::Addressee&, int weight ); 00070 virtual void keyPressEvent( QKeyEvent* ); 00079 virtual void insert( const QString &text ); 00081 virtual void paste(); 00083 virtual void mouseReleaseEvent( QMouseEvent *e ); 00085 virtual void dropEvent( QDropEvent *e ); 00086 void doCompletion( bool ctrlT ); 00087 virtual QPopupMenu *createPopupMenu(); 00088 00089 private slots: 00090 void slotCompletion() { doCompletion(false); } 00091 void slotPopupCompletion( const QString& ); 00092 void slotStartLDAPLookup(); 00093 void slotLDAPSearchData( const KPIM::LdapResultList& ); 00094 void slotEditCompletionOrder(); 00095 00096 private: 00097 void init(); 00098 void startLoadingLDAPEntries(); 00099 void stopLDAPLookup(); 00100 00101 void setCompletedItems( const QStringList& items, bool autoSuggest ); 00102 00103 QString m_previousAddresses; 00104 bool m_useCompletion; 00105 bool m_completionInitialized; 00106 bool m_smartPaste; 00107 00108 //QMap<QString, KABC::Addressee> m_contactMap; 00109 00110 static bool s_addressesDirty; 00111 static KCompletion *s_completion; 00112 static QTimer *s_LDAPTimer; 00113 static KPIM::LdapSearch *s_LDAPSearch; 00114 static QString *s_LDAPText; 00115 static AddresseeLineEdit *s_LDAPLineEdit; 00116 static KConfig *s_config; 00117 00118 class AddresseeLineEditPrivate; 00119 AddresseeLineEditPrivate *d; 00120 }; 00121 00122 } 00123 00124 #endif
KDE Logo
This file is part of the documentation for libkdepim Library Version 3.3.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Fri Aug 27 12:50:22 2004 by doxygen 1.3.8 written by Dimitri van Heesch, © 1997-2003