tdeioslave/imap4

mailaddress.h
1 #ifndef _MAILADDRESS_H
2 #define _MAILADDRESS_H
3 /**********************************************************************
4  *
5  * mailaddress.h - mail address handler
6  * Copyright (C) 2000 s.carstens@gmx.de
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
21  *
22  * Send comments and bug fixes to s.carstens@gmx.de
23  *
24  *********************************************************************/
25 
26 #include <tqptrlist.h>
27 #include <tqstring.h>
28 #include <tqcstring.h>
29 #include "rfcdecoder.h"
30 
31 class mailAddress
32 {
33 public:
34  mailAddress ();
35  ~mailAddress ();
36  mailAddress (char *aCStr);
37  mailAddress (const mailAddress &);
38  mailAddress & operator = (const mailAddress &);
39 
40  void setUser (const TQCString & aUser)
41  {
42  user = aUser;
43  }
44  const TQCString & getUser () const
45  {
46  return user;
47  }
48  void setHost (const TQCString & aHost)
49  {
50  host = aHost;
51  }
52  const TQCString & getHost () const
53  {
54  return host;
55  }
56 
57  void setFullName (const TQString & aFull);
58  const TQString getFullName () const;
59 
60  void setComment (const TQString & aComment);
61  void setCommentRaw (const TQCString &);
62  const TQString getComment () const;
63  const TQCString & getCommentRaw () const;
64 
65  int parseAddress (char *);
66  const TQCString getStr () const;
67  bool isEmpty () const;
68 
69  static TQString emailAddrAsAnchor (const mailAddress &, bool);
70  static TQString emailAddrAsAnchor (const TQPtrList < mailAddress > &, bool);
71 
72  void clear();
73 
74 private:
75  TQCString user;
76  TQCString host;
77  TQCString rawFullName;
78  TQCString rawComment;
79 };
80 
81 #endif