addresseehelper.h
00001 /* 00002 This file is part of the KDE libraries 00003 Copyright (C) 2003 Carsten Pfeiffer <pfeiffer@kde.org> 00004 00005 This library is free software; you can redistribute it and/or 00006 modify it under the terms of the GNU Library General Public 00007 License as published by the Free Software Foundation, version 2. 00008 00009 This library is distributed in the hope that it will be useful, 00010 but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 Library General Public License for more details. 00013 00014 You should have received a copy of the GNU Library General Public License 00015 along with this library; see the file COPYING.LIB. If not, write to 00016 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 Boston, MA 02110-1301, USA. 00018 */ 00019 00020 #ifndef KABC_ADDRESSEEHELPER_H 00021 #define KABC_ADDRESSEEHELPER_H 00022 00023 #include "kabc_export.h" 00024 00025 #include <QtCore/QObject> 00026 #include <QtCore/QStringList> 00027 #include <QtCore/QSet> 00028 00029 namespace KABC { 00030 00054 class KABC_EXPORT AddresseeHelper : public QObject 00055 { 00056 Q_OBJECT 00057 00058 public: 00064 static AddresseeHelper *self(); 00065 00073 bool containsTitle( const QString &title ) const; 00074 00082 bool containsPrefix( const QString &prefix ) const; 00083 00091 bool containsSuffix( const QString &suffix ) const; 00092 00100 bool tradeAsFamilyName() const; 00101 00102 public Q_SLOTS: 00106 void initSettings(); 00107 00108 private: 00109 AddresseeHelper(); 00110 00111 static void addToSet( const QStringList &list, QSet<QString> &container ); 00112 QSet<QString> mTitles; 00113 QSet<QString> mPrefixes; 00114 QSet<QString> mSuffixes; 00115 bool mTradeAsFamilyName; 00116 00117 static AddresseeHelper *s_self; 00118 }; 00119 00120 } 00121 00122 #endif