kioslaves

mailaddress.h

Go to the documentation of this file.
00001 #ifndef _MAILADDRESS_H
00002 #define _MAILADDRESS_H
00003 /**********************************************************************
00004  *
00005  *   mailaddress.h - mail address handler
00006  *   Copyright (C) 2000 s.carstens@gmx.de
00007  *
00008  *   This program is free software; you can redistribute it and/or modify
00009  *   it under the terms of the GNU General Public License as published by
00010  *   the Free Software Foundation; either version 2 of the License, or
00011  *   (at your option) any later version.
00012  *
00013  *   This program is distributed in the hope that it will be useful,
00014  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  *   GNU General Public License for more details.
00017  *
00018  *   You should have received a copy of the GNU General Public License
00019  *   along with this program; if not, write to the Free Software
00020  *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00021  *
00022  *   Send comments and bug fixes to s.carstens@gmx.de
00023  *
00024  *********************************************************************/
00025 
00026 #include <qptrlist.h>
00027 #include <qstring.h>
00028 #include <qcstring.h>
00029 #include "rfcdecoder.h"
00030 
00031 class mailAddress
00032 {
00033 public:
00034   mailAddress ();
00035   ~mailAddress ();
00036   mailAddress (char *aCStr);
00037     mailAddress (const mailAddress &);
00038     mailAddress & operator = (const mailAddress &);
00039 
00040   void setUser (const QCString & aUser)
00041   {
00042     user = aUser;
00043   }
00044   const QCString & getUser () const
00045   {
00046     return user;
00047   }
00048   void setHost (const QCString & aHost)
00049   {
00050     host = aHost;
00051   }
00052   const QCString & getHost () const
00053   {
00054     return host;
00055   }
00056 
00057   void setFullName (const QString & aFull);
00058   const QString getFullName () const;
00059 
00060   void setComment (const QString & aComment);
00061   void setCommentRaw (const QCString &);
00062   const QString getComment () const;
00063   const QCString & getCommentRaw () const;
00064 
00065   int parseAddress (char *);
00066   const QCString getStr ();
00067   bool isEmpty () const;
00068 
00069   static QString emailAddrAsAnchor (const mailAddress &, bool);
00070   static QString emailAddrAsAnchor (const QPtrList < mailAddress > &, bool);
00071 
00072   void clear();
00073 
00074 private:
00075   QCString user;
00076   QCString host;
00077   QCString rawFullName;
00078   QCString rawComment;
00079 };
00080 
00081 #endif