• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.8.3 API Reference
  • KDE Home
  • 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 <KDE/KUrl>
00036 
00037 #include <QtCore/QStringList>
00038 #include <QtCore/QByteArray>
00039 
00040 #include "kpimutils_export.h"
00041 
00042 namespace KPIMUtils {
00043 
00063   enum EmailParseResult {
00064     AddressOk,          
00065     AddressEmpty,       
00066     UnexpectedEnd,      
00067     UnbalancedParens,   
00068     MissingDomainPart,  
00069     UnclosedAngleAddr,  
00070     UnopenedAngleAddr,  
00071     TooManyAts,         
00072     UnexpectedComma,    
00073     TooFewAts,          
00074     MissingLocalPart,   
00075     UnbalancedQuote,    
00076     NoAddressSpec,
00077     DisallowedChar,     
00078     InvalidDisplayName  
00079   };
00080 
00087   KPIMUTILS_EXPORT
00088   QStringList splitAddressList( const QString &aStr );
00089 
00110   KPIMUTILS_EXPORT
00111   EmailParseResult splitAddress( const QByteArray &address,
00112                                  QByteArray &displayName,
00113                                  QByteArray &addrSpec,
00114                                  QByteArray &comment );
00115 
00139   KPIMUTILS_EXPORT
00140   EmailParseResult splitAddress( const QString &address,
00141                                  QString &displayName,
00142                                  QString &addrSpec,
00143                                  QString &comment );
00144 
00155   KPIMUTILS_EXPORT
00156   EmailParseResult isValidAddress( const QString &aStr );
00157 
00168   KPIMUTILS_EXPORT
00169   EmailParseResult isValidAddressList( const QString &aStr,
00170                                        QString &badAddr );
00171 
00184   KPIMUTILS_EXPORT
00185   QString emailParseResultToString( EmailParseResult errorCode );
00186 
00203   KPIMUTILS_EXPORT
00204   bool isValidSimpleAddress( const QString &aStr );
00205 
00213   KPIMUTILS_EXPORT
00214   QString simpleEmailAddressErrorMsg();
00215 
00230   KPIMUTILS_EXPORT
00231   QByteArray extractEmailAddress( const QByteArray & address );
00232 
00244   KPIMUTILS_EXPORT
00245   QString extractEmailAddress( const QString & address );
00246 
00255   KPIMUTILS_EXPORT
00256   QByteArray firstEmailAddress( const QByteArray & addresses );
00257 
00269   KPIMUTILS_EXPORT
00270   QString firstEmailAddress( const QString & addresses );
00271 
00290   KPIMUTILS_EXPORT
00291   bool extractEmailAddressAndName( const QString &aStr, QString &mail,
00292                                    QString &name );
00293 
00305   KPIMUTILS_EXPORT
00306   bool compareEmail( const QString &email1, const QString &email2,
00307                      bool matchName );
00308 
00323   KPIMUTILS_EXPORT
00324   QString normalizedAddress( const QString &displayName,
00325                              const QString &addrSpec,
00326                              const QString &comment );
00327 
00340   KPIMUTILS_EXPORT
00341   QString fromIdn( const QString &addrSpec );
00342 
00349   KPIMUTILS_EXPORT
00350   QString toIdn( const QString &addrSpec );
00351 
00358   KPIMUTILS_EXPORT
00359   QString normalizeAddressesAndDecodeIdn( const QString &addresses );
00360 
00368   KPIMUTILS_EXPORT
00369   QString normalizeAddressesAndEncodeIdn( const QString &str );
00370 
00381   KPIMUTILS_EXPORT
00382   QString quoteNameIfNecessary( const QString &str );
00383 
00391   KPIMUTILS_EXPORT
00392   KUrl encodeMailtoUrl( const QString &mailbox );
00393 
00400   KPIMUTILS_EXPORT
00401   QString decodeMailtoUrl( const KUrl &mailtoUrl );
00402 
00403 } // namespace
00404 
00405 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 7 2012 23:57:04 by doxygen 1.8.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kpimutils

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

kdepimlibs-4.8.3 API Reference

Skip menu "kdepimlibs-4.8.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal