• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.10.5 API Reference
  • KDE Home
  • Contact Us
 

kpimutils

  • kpimutils
email.h
Go to the documentation of this file.
1 /* -*- mode: C++; c-file-style: "gnu" -*-
2 
3  This file is part of the kpimutils library.
4  Copyright (c) 2004 Matt Douhan <matt@fruitsalad.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
32 #ifndef KPIMUTILS_EMAIL_H
33 #define KPIMUTILS_EMAIL_H
34 
35 #include <KDE/KUrl>
36 
37 #include <QtCore/QStringList>
38 #include <QtCore/QByteArray>
39 
40 #include "kpimutils_export.h"
41 
42 namespace KPIMUtils {
43 
63  enum EmailParseResult {
64  AddressOk,
65  AddressEmpty,
66  UnexpectedEnd,
67  UnbalancedParens,
68  MissingDomainPart,
69  UnclosedAngleAddr,
70  UnopenedAngleAddr,
71  TooManyAts,
72  UnexpectedComma,
73  TooFewAts,
74  MissingLocalPart,
75  UnbalancedQuote,
76  NoAddressSpec,
77  DisallowedChar,
78  InvalidDisplayName
79  };
80 
87  KPIMUTILS_EXPORT
88  QStringList splitAddressList( const QString &aStr );
89 
110  KPIMUTILS_EXPORT
111  EmailParseResult splitAddress( const QByteArray &address,
112  QByteArray &displayName,
113  QByteArray &addrSpec,
114  QByteArray &comment );
115 
139  KPIMUTILS_EXPORT
140  EmailParseResult splitAddress( const QString &address,
141  QString &displayName,
142  QString &addrSpec,
143  QString &comment );
144 
155  KPIMUTILS_EXPORT
156  EmailParseResult isValidAddress( const QString &aStr );
157 
168  KPIMUTILS_EXPORT
169  EmailParseResult isValidAddressList( const QString &aStr,
170  QString &badAddr );
171 
184  KPIMUTILS_EXPORT
185  QString emailParseResultToString( EmailParseResult errorCode );
186 
203  KPIMUTILS_EXPORT
204  bool isValidSimpleAddress( const QString &aStr );
205 
213  KPIMUTILS_EXPORT
214  QString simpleEmailAddressErrorMsg();
215 
230  KPIMUTILS_EXPORT
231  QByteArray extractEmailAddress( const QByteArray & address );
232 
244  KPIMUTILS_EXPORT
245  QString extractEmailAddress( const QString & address );
246 
255  KPIMUTILS_EXPORT
256  QByteArray firstEmailAddress( const QByteArray & addresses );
257 
269  KPIMUTILS_EXPORT
270  QString firstEmailAddress( const QString & addresses );
271 
290  KPIMUTILS_EXPORT
291  bool extractEmailAddressAndName( const QString &aStr, QString &mail,
292  QString &name );
293 
305  KPIMUTILS_EXPORT
306  bool compareEmail( const QString &email1, const QString &email2,
307  bool matchName );
308 
323  KPIMUTILS_EXPORT
324  QString normalizedAddress( const QString &displayName,
325  const QString &addrSpec,
326  const QString &comment = QString() );
327 
340  KPIMUTILS_EXPORT
341  QString fromIdn( const QString &addrSpec );
342 
349  KPIMUTILS_EXPORT
350  QString toIdn( const QString &addrSpec );
351 
358  KPIMUTILS_EXPORT
359  QString normalizeAddressesAndDecodeIdn( const QString &addresses );
360 
368  KPIMUTILS_EXPORT
369  QString normalizeAddressesAndEncodeIdn( const QString &str );
370 
381  KPIMUTILS_EXPORT
382  QString quoteNameIfNecessary( const QString &str );
383 
391  KPIMUTILS_EXPORT
392  KUrl encodeMailtoUrl( const QString &mailbox );
393 
400  KPIMUTILS_EXPORT
401  QString decodeMailtoUrl( const KUrl &mailtoUrl );
402 
403 } // namespace
404 
405 #endif
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:26:05 by doxygen 1.8.3.1 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.10.5 API Reference

Skip menu "kdepimlibs-4.10.5 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • 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