summaryrefslogtreecommitdiffstats
path: root/libkmime/kmime_mdn.h
blob: 30fa238a6c597dec82eda83a62db5dec82e1f7fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
/*  -*- c++ -*-
    kmime_mdn.h

    This file is part of KMime, the KDE internet mail/usenet news message library.
    Copyright (c) 2002 Marc Mutz <mutz@kde.org>

    KMime is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License, version 2, as
    published by the Free Software Foundation.

    KMime is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

    In addition, as a special exception, the copyright holders give
    permission to link the code of this library with any edition of
    the TQt library by Trolltech AS, Norway (or with modified versions
    of TQt that use the same license as TQt), and distribute linked
    combinations including the two.  You must obey the GNU General
    Public License in all respects for all of the code used other than
    TQt.  If you modify this file, you may extend this exception to
    your version of the file, but you are not obligated to do so.  If
    you do not wish to do so, delete this exception statement from
    your version.
*/

#ifndef __KMIME_MDN_H__
#define __KMIME_MDN_H__

#include <tqvaluelist.h>
#include <tqstring.h>

#include <tdepimmacros.h>

class TQCString;

namespace KMime {

  namespace MDN {

    /** The following disposition-types are defined:

	@li Displayed    The message has been displayed by the UA to someone
                         reading the recipient's mailbox.  There is
			 no guarantee that the content has been
			 read or understood.

	@li Dispatched   The message has been sent somewhere in some manner
                         (e.g., printed, faxed, forwarded) without
			 necessarily having been previously
			 displayed to the user.  The user may or
			 may not see the message later.

        @li Processed    The message has been processed in some manner (i.e.,
                         by some sort of rules or server) without
			 being displayed to the user.  The user may
			 or may not see the message later, or there
			 may not even be a human user associated
			 with the mailbox.

        @li Deleted      The message has been deleted.  The recipient may or
                         may not have seen the message.  The
			 recipient might "undelete" the message at
			 a later time and read the message.

        @li Denied       The recipient does not wish the sender to be informed
                         of the message's disposition.  A UA may
			 also siliently ignore message disposition
			 requests in this situation.

        @li Failed       A failure occurred that prevented the proper
                         generation of an MDN.  More information
                         about the cause of the failure may be
                         contained in a Failure field.  The
                         "failed" disposition type is not to be
			 used for the situation in which there is
			 is some problem in processing the message
			 other than interpreting the request for an
			 MDN.  The "processed" or other disposition
			 type with appropriate disposition
			 modifiers is to be used in such
			 situations.

       IOW: @p Displayed when - well -displayed
            @p Dispatched when forwarding unseen ( == new )
	    @p Processed (maybe) when piping unseen, but probably never used
	    @p Deleted when deleting unseen
	    @p Denied on user command
	    @p Failed on Disposition-Notification-Options containing
               unknown required options. ( == @em any required options )
	       @p Failed needs a description in the @p special parameter.
     **/
    enum DispositionType {
      Displayed, Read = Displayed,
      Deleted,
      Dispatched, Forwarded = Dispatched,
      Processed,
      Denied,
      Failed
    };
    /** The following disposition modifiers are defined:

       @li Error               An error of some sort occurred
                               that prevented successful
			       processing of the message.
			       Further information is contained
			       in an Error field.

       @li Warning             The message was successfully
                               processed but some sort of
			       exceptional condition occurred.
			       Further information is contained
			       in a Warning field.

       @li Superseded          The message has been
                               automatically rendered obsolete by
			       another message received.  The
			       recipient may still access and
			       read the message later.

       @li Expired             The message has reached its
                               expiration date and has been
			       automatically removed from the
			       recipient's mailbox.

       @li MailboxTerminated   The recipient's mailbox has been
                               terminated and all message in it
			       automatically removed.
     **/
    enum DispositionModifier {
      Error,
      Warning,
      Superseded,
      Expired,
      MailboxTerminated
    };
\
    /** The following disposition modes are defined:

     @li ManualAction    The disposition described by the disposition type
                         was a result of an explicit instruction by
			 the user rather than some sort of
			 automatically performed action.

     @li AutomaticAction The disposition described by the disposition
                         type was a result of an automatic action,
			 rather than an explicit instruction by the
			 user for this message.

     IOW: @p ManualAction for user-driven actions,
          @p AutomanticAction for filtering.
    **/
    enum ActionMode {
      ManualAction,
      AutomaticAction
    };

    /**
     @li SentManually      The user explicitly gave permission for this
                           particular MDN to be sent.

     @li SentAutomatically The MDN was sent because the MUA had
                           previously been configured to do so
			   automatically.

     IOW: @p SentManually for when we have asked the user
          @p SentAutomatically when we use the default specified by the user
     **/
    enum SendingMode {
      SentManually,
      SentAutomatically
    };

    /** Main function. Generates the content of the
        message/disposition-notification body part. */
    KDE_EXPORT extern TQCString dispositionNotificationBodyContent( const TQString & finalRecipient,
	       const TQCString & originalRecipient,
	       const TQCString & originalMsgID,
	       DispositionType disposition,
	       ActionMode actionMode,
	       SendingMode sendingMode,
	       const TQValueList<DispositionModifier> & dispositionModifers
				   =TQValueList<DispositionModifier>(),
	       const TQString & special=TQString() );

    KDE_EXPORT extern TQString descriptionFor( DispositionType d,
				   const TQValueList<DispositionModifier> & m
				   =TQValueList<DispositionModifier>() );

    enum ReturnContent { Nothing, All, HeadersOnly };


  } // namespace MDN

} // namespace KMime

#endif // __KMIME_MDN_H__