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 #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 // Connected to the DCOP signal 00093 void slotIMAPCompletionOrderChanged(); 00094 00095 private slots: 00096 void slotCompletion() { doCompletion(false); } 00097 void slotPopupCompletion( const QString& ); 00098 void slotStartLDAPLookup(); 00099 void slotLDAPSearchData( const KPIM::LdapResultList& ); 00100 void slotEditCompletionOrder(); 00101 00102 private: 00103 void init(); 00104 void startLoadingLDAPEntries(); 00105 void stopLDAPLookup(); 00106 00107 void setCompletedItems( const QStringList& items, bool autoSuggest ); 00108 00109 QString m_previousAddresses; 00110 bool m_useCompletion; 00111 bool m_completionInitialized; 00112 bool m_smartPaste; 00113 00114 //QMap<QString, KABC::Addressee> m_contactMap; 00115 00116 static bool s_addressesDirty; 00117 static KCompletion *s_completion; 00118 static QTimer *s_LDAPTimer; 00119 static KPIM::LdapSearch *s_LDAPSearch; 00120 static QString *s_LDAPText; 00121 static AddresseeLineEdit *s_LDAPLineEdit; 00122 static KConfig *s_config; 00123 00124 class AddresseeLineEditPrivate; 00125 AddresseeLineEditPrivate *d; 00126 }; 00127 00128 } 00129 00130 #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 Oct 1 15:18:54 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003