• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

kpimutils

email.h

Go to the documentation of this file.
00001 /*  -*- mode: C++; c-file-style: "gnu" -*-
00002 
00003   This file is part of the kpimutils library.
00004   Copyright (c) 2004 Matt Douhan <matt@fruitsalad.org>
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., 51 Franklin Street, Fifth Floor,
00019   Boston, MA 02110-1301, USA.
00020 */
00032 #ifndef KPIMUTILS_EMAIL_H
00033 #define KPIMUTILS_EMAIL_H
00034 
00035 #include <QtCore/QStringList>
00036 #include <QtCore/QByteArray>
00037 
00038 #include "kpimutils_export.h"
00039 
00040 namespace KPIMUtils {
00041 
00061   enum EmailParseResult {
00062     AddressOk,          
00063     AddressEmpty,       
00064     UnexpectedEnd,      
00065     UnbalancedParens,   
00066     MissingDomainPart,  
00067     UnclosedAngleAddr,  
00068     UnopenedAngleAddr,  
00069     TooManyAts,         
00070     UnexpectedComma,    
00071     TooFewAts,          
00072     MissingLocalPart,   
00073     UnbalancedQuote,    
00074     NoAddressSpec,
00075     DisallowedChar,     
00076     InvalidDisplayName  
00077   };
00078 
00085   KPIMUTILS_EXPORT
00086   QStringList splitAddressList( const QString &aStr );
00087 
00108   KPIMUTILS_EXPORT
00109   EmailParseResult splitAddress( const QByteArray &address,
00110                                  QByteArray &displayName,
00111                                  QByteArray &addrSpec,
00112                                  QByteArray &comment );
00113 
00137   KPIMUTILS_EXPORT
00138   EmailParseResult splitAddress( const QString &address,
00139                                  QString &displayName,
00140                                  QString &addrSpec,
00141                                  QString &comment );
00142 
00153   KPIMUTILS_EXPORT
00154   EmailParseResult isValidAddress( const QString &aStr );
00155 
00166   KPIMUTILS_EXPORT
00167   EmailParseResult isValidAddressList( const QString &aStr,
00168                                        QString &badAddr );
00169 
00182   KPIMUTILS_EXPORT
00183   QString emailParseResultToString( EmailParseResult errorCode );
00184 
00201   KPIMUTILS_EXPORT
00202   bool isValidSimpleAddress( const QString &aStr );
00203 
00211   KPIMUTILS_EXPORT
00212   QString simpleEmailAddressErrorMsg();
00213 
00228   KPIMUTILS_EXPORT
00229   QByteArray extractEmailAddress( const QByteArray & address );
00230 
00242   KPIMUTILS_EXPORT
00243   QString extractEmailAddress( const QString & address );
00244 
00253   KPIMUTILS_EXPORT
00254   QByteArray firstEmailAddress( const QByteArray & addresses );
00255 
00267   KPIMUTILS_EXPORT
00268   QString firstEmailAddress( const QString & addresses );
00269 
00288   KPIMUTILS_EXPORT
00289   bool extractEmailAddressAndName( const QString &aStr, QString &mail,
00290                                    QString &name );
00291 
00303   KPIMUTILS_EXPORT
00304   bool compareEmail( const QString &email1, const QString &email2,
00305                      bool matchName );
00306 
00321   KPIMUTILS_EXPORT
00322   QString normalizedAddress( const QString &displayName,
00323                              const QString &addrSpec,
00324                              const QString &comment );
00325 
00338   KPIMUTILS_EXPORT
00339   QString fromIdn( const QString &addrSpec );
00340 
00347   KPIMUTILS_EXPORT
00348   QString toIdn( const QString &addrSpec );
00349 
00356   KPIMUTILS_EXPORT
00357   QString normalizeAddressesAndDecodeIdn( const QString &addresses );
00358 
00366   KPIMUTILS_EXPORT
00367   QString normalizeAddressesAndEncodeIdn( const QString &str );
00368 
00379   KPIMUTILS_EXPORT
00380   QString quoteNameIfNecessary( const QString &str );
00381 
00382 } // namespace
00383 
00384 #endif

kpimutils

Skip menu "kpimutils"
  • Main Page
  • Modules
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  • kabc
  • kblog
  • kcal
  • kimap
  • kioslave
  •   imap4
  •   mbox
  • kldap
  • kmime
  • kpimidentities
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.5.6
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal