kabc Library API Documentation

addresslineedit.h

00001 /* 00002 This file is part of libkabc. 00003 Copyright (c) 2002 Helge Deller <deller@gmx.de> 00004 2002 Lubos Lunak <llunak@suse.cz> 00005 00006 This library is free software; you can redistribute it and/or 00007 modify it under the terms of the GNU Library General Public 00008 License as published by the Free Software Foundation; either 00009 version 2 of the License, or (at your option) any later version. 00010 00011 This library is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 Library General Public License for more details. 00015 00016 You should have received a copy of the GNU Library General Public License 00017 along with this library; see the file COPYING.LIB. If not, write to 00018 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00019 Boston, MA 02111-1307, USA. 00020 */ 00021 00022 #ifndef KABC_ADDRESSLINEEDIT_H 00023 #define KABC_ADDRESSLINEEDIT_H 00024 // $Id: addresslineedit.h,v 1.6 2003/08/16 19:44:56 coolo Exp $ 00025 00026 #include <qobject.h> 00027 #include <qptrlist.h> 00028 #include <qtimer.h> 00029 00030 #include "klineedit.h" 00031 #include "kcompletion.h" 00032 00033 class KConfig; 00034 00035 namespace KABC { 00036 00037 class LdapSearch; 00038 00050 class AddressLineEdit : public KLineEdit 00051 { 00052 Q_OBJECT 00053 public: 00054 AddressLineEdit(QWidget* parent, bool useCompletion = true, 00055 const char *name = 0L); 00056 virtual ~AddressLineEdit(); 00057 00062 virtual void setFont( const QFont& ); 00063 00064 static KConfig *config(); 00065 00066 public slots: 00070 void cursorAtEnd(); 00074 void enableCompletion( bool enable ); 00075 00076 protected: 00081 virtual void loadAddresses(); 00082 void addAddress( const QString& ); 00083 virtual void keyPressEvent(QKeyEvent*); 00084 virtual void dropEvent(QDropEvent *e); 00085 virtual void paste(); 00086 virtual void insert(const QString &t); 00087 virtual void mouseReleaseEvent( QMouseEvent * e ); 00088 void doCompletion(bool ctrlT); 00089 00090 private slots: 00091 void slotCompletion() { doCompletion(false); } 00092 void slotPopupCompletion( const QString& ); 00093 void slotStartLDAPLookup(); 00094 void slotLDAPSearchData( const QStringList& ); 00095 void slotSetTextAsEdited( const QString &text ); 00096 00097 private: 00098 void init(); 00099 void startLoadingLDAPEntries(); 00100 void stopLDAPLookup(); 00101 QStringList addresses(); 00102 QStringList removeMailDupes( const QStringList& adrs ); 00103 00104 QString m_previousAddresses; 00105 bool m_useCompletion; 00106 bool m_completionInitialized; 00107 bool m_smartPaste; 00108 QString m_typedText; // unused 00109 00110 static bool s_addressesDirty; 00111 static KCompletion *s_completion; 00112 static QTimer *s_LDAPTimer; 00113 static LdapSearch *s_LDAPSearch; 00114 static QString *s_LDAPText; 00115 static AddressLineEdit *s_LDAPLineEdit; 00116 static KConfig *s_config; 00117 00118 private: 00119 class AddressLineEditPrivate* d; 00120 }; 00121 00122 } 00123 00124 #endif /* KABC_ADDRESSLINEEDIT_H */
KDE Logo
This file is part of the documentation for kabc Library Version 3.2.3.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Sat Jun 12 15:09:40 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003