libkdenetwork Library API Documentation

recentaddresses.h

00001 /*  -*- mode: C++; c-file-style: "gnu" -*-
00002  *
00003  *  Copyright (c) 2001-2003 Carsten Pfeiffer <pfeiffer@kde.org>
00004  *  Copyright (c) 2003 Zack Rusin <zack@kde.org>
00005  *
00006  *  KMail is free software; you can redistribute it and/or modify it
00007  *  under the terms of the GNU General Public License, version 2, as
00008  *  published by the Free Software Foundation.
00009  *
00010  *  KMail is distributed in the hope that it will be useful, but
00011  *  WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  *  General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018  *
00019  *  In addition, as a special exception, the copyright holders give
00020  *  permission to link the code of this program with any edition of
00021  *  the Qt library by Trolltech AS, Norway (or with modified versions
00022  *  of Qt that use the same license as Qt), and distribute linked
00023  *  combinations including the two.  You must obey the GNU General
00024  *  Public License in all respects for all of the code used other than
00025  *  Qt.  If you modify this file, you may extend this exception to
00026  *  your version of the file, but you are not obligated to do so.  If
00027  *  you do not wish to do so, delete this exception statement from
00028  *  your version.
00029  */
00030 #ifndef RECENTADDRESSES_H
00031 #define RECENTADDRESSES_H
00032 
00033 #include <qstringlist.h>
00034 #include <kabc/addressee.h>
00035 
00036 #include <kdialogbase.h>
00037 
00038 class KConfig;
00039 class KEditListBox;
00040 namespace KRecentAddress {
00041 
00042 class RecentAddressDialog : public KDialogBase
00043 {
00044  public:
00045   RecentAddressDialog( QWidget *parent, const char *name = 0 );
00046   void setAddresses( const QStringList &addrs );
00047   QStringList addresses() const;
00048  private:
00049     KEditListBox *mEditor;
00050 };
00051 
00059 class RecentAddresses
00060 {
00061 public:
00062     ~RecentAddresses();
00066     static RecentAddresses * self(KConfig *config = 0L);
00067 
00073     QStringList     addresses() const;
00074     const KABC::Addressee::List& kabcAddresses() const { return m_addresseeList; }
00075 
00081     void add( const QString& entry );
00082 
00087     void setMaxCount( int count );
00088 
00092     uint maxCount() const { return m_maxCount; }
00093 
00098     void load( KConfig * );
00099 
00104     void save( KConfig * );
00105 
00109     void clear();
00110 
00111 private:
00112     RecentAddresses(KConfig *config = 0L);
00113 
00114     KABC::Addressee::List m_addresseeList;
00115 
00116     void adjustSize();
00117 
00118     uint m_maxCount;
00119 
00120     static RecentAddresses *s_self;
00121 };
00122 
00123 }
00124 
00125 #endif // KMRECENTADDR_H
KDE Logo
This file is part of the documentation for libkdenetwork Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Mon Apr 4 04:44:06 2005 by doxygen 1.3.9.1 written by Dimitri van Heesch, © 1997-2003