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();
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     //QMap<QString, KABC::Addressee> m_contactMap;
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
KDE Logo
This file is part of the documentation for libkdepim Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Apr 4 06:42:18 2005 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003