Fix typo in license headers
[oweals/cde.git] / cde / programs / dtmail / include / DtMail / DtMailValues.hh
1 /*
2  *+SNOTICE
3  *
4  *      $TOG: DtMailValues.hh /main/7 1997/09/03 17:27:15 mgreess $
5  *
6  *      RESTRICTED CONFIDENTIAL INFORMATION:
7  *      
8  *      The information in this document is subject to special
9  *      restrictions in a confidential disclosure agreementbertween
10  *      HP, IBM, Sun, USL, SCO and Univel.  Do not distribute this
11  *      document outside HP, IBM, Sun, USL, SCO, or Univel wihtout
12  *      Sun's specific written approval.  This documment and all copies
13  *      and derivative works thereof must be returned or destroyed at
14  *      Sun's request.
15  *
16  *      Copyright 1993 Sun Microsystems, Inc.  All rights reserved.
17  *
18  *+ENOTICE
19  */
20
21 #ifndef _DTMAILVALUE_HH
22 #define _DTMAILVALUE_HH
23
24 #include <DtMail/DtVirtArray.hh>
25
26 // Dates consist of a date, and an offset from GMT.
27 //
28 #include <time.h>
29
30 struct DtMailValueDate : public DtCPlusPlusAllocator {
31     time_t      dtm_date;
32     time_t      dtm_tz_offset_secs;
33 };
34
35 // An address consists of 3 components. The addressee is the string that
36 // is used by the transport to deliver the mail to the user. The person
37 // is the string that represents this person in the real world (e.g. Bob Patterson).
38 // The namespace is used to identify which address space the name belongs to.
39 // This can be set to DtMailAddressDefault to specify the library should figure
40 // out the appropriate name space.
41 //
42
43 #define DtMailAddressDefault    "Dt:Mail:Address:Default"
44
45 struct DtMailValueAddress : public DtCPlusPlusAllocator {
46     char        *dtm_address;
47     char        *dtm_person;
48     char        *dtm_namespace;
49
50     DtMailValueAddress(void);
51     DtMailValueAddress(const DtMailValueAddress &);
52     DtMailValueAddress(const char * address,
53                        const char * person,
54                        const char * nameSpace);
55
56     DtMailValueAddress(const char * address, const int addr_len,
57                        const char * person, const int per_len,
58                        const char * nameSpace);
59     ~DtMailValueAddress(void);
60 };
61
62 class DtMailAddressSeq : public DtVirtArray<DtMailValueAddress *> {
63   public:
64     DtMailAddressSeq(int size = 8);
65     ~DtMailAddressSeq(void);
66 };
67
68 class DtMailValue : public DtCPlusPlusAllocator {
69   public:
70     DtMailValue(const char * value);
71     virtual ~DtMailValue(void);
72
73     virtual operator const char *(void);
74
75     virtual const char * operator= (const char *);
76
77     virtual DtMailValueDate toDate(void);
78 #ifdef DEAD_WOOD
79     virtual void fromDate(const DtMailValueDate &);
80 #endif /* DEAD_WOOD */
81
82     virtual DtMailAddressSeq * toAddress(void);
83 #ifdef DEAD_WOOD
84     virtual void fromAddress(const DtMailAddressSeq & list);
85 #endif /* DEAD_WOOD */
86
87     // This method gives the raw format used to store the value.
88     //
89     virtual const char * raw(void);
90
91   protected:
92     char *      _value;
93 };
94
95 class DtMailValueSeq : public DtVirtArray<DtMailValue *> {
96   public:
97     DtMailValueSeq(int size = 8);
98     ~DtMailValueSeq(void);
99
100     void clear(void);
101 };
102
103 #endif