1 /* Copyright (C) 2006 - 2014 Jan Kundrát <jkt@flaska.net> 2 3 This file is part of the Trojita Qt IMAP e-mail client, 4 http://trojita.flaska.net/ 5 6 This program is free software; you can redistribute it and/or 7 modify it under the terms of the GNU General Public License as 8 published by the Free Software Foundation; either version 2 of 9 the License or (at your option) version 3 or any later version 10 accepted by the membership of KDE e.V. (or its successor approved 11 by the membership of KDE e.V.), which shall act as a proxy 12 defined in Section 14 of version 3 of the license. 13 14 This program is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 GNU General Public License for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with this program. If not, see <http://www.gnu.org/licenses/>. 21 */ 22 23 #ifndef IMAP_MODEL_ITEMROLES_H 24 #define IMAP_MODEL_ITEMROLES_H 25 26 #include <Qt> 27 28 namespace Imap { 29 namespace Mailbox { 30 31 /** @short Custom item data roles for IMAP */ 32 enum { 33 /** @short A "random" offset */ 34 RoleBase = Qt::UserRole + 666, 35 36 /** @short Is the item already fetched? */ 37 RoleIsFetched, 38 /** @short The item is not available -- perhaps we're offline and it isn't cached */ 39 RoleIsUnavailable, 40 41 /** @short Name of the mailbox */ 42 RoleMailboxName, 43 /** @short Short name of the mailbox */ 44 RoleShortMailboxName, 45 /** @short Separator for mailboxes at the current level */ 46 RoleMailboxSeparator, 47 /** @short Total number of messages in a mailbox */ 48 RoleTotalMessageCount, 49 /** @short Number of unread messages in a mailbox */ 50 RoleUnreadMessageCount, 51 /** @short Number of recent messages in a mailbox */ 52 RoleRecentMessageCount, 53 /** @short The mailbox in question is the INBOX */ 54 RoleMailboxIsINBOX, 55 /** @short The mailbox can be selected */ 56 RoleMailboxIsSelectable, 57 /** @short The mailbox has child mailboxes */ 58 RoleMailboxHasChildMailboxes, 59 /** @short Information about whether the number of messages in the mailbox has already been loaded */ 60 RoleMailboxNumbersFetched, 61 /** @short Is anything still loading for this mailbox? */ 62 RoleMailboxItemsAreLoading, 63 /** @short Current UIDVALIDITY of a mailbox */ 64 RoleMailboxUidValidity, 65 /** @short Is the mailbox subscribed? 66 67 If the server doesn't support RFC5258, this can return wrong answer. 68 */ 69 RoleMailboxIsSubscribed, 70 71 /** @short UID of the message */ 72 RoleMessageUid, 73 /** @short Subject of the message */ 74 RoleMessageSubject, 75 /** @short The From addresses */ 76 RoleMessageFrom, 77 /** @short The To addresses */ 78 RoleMessageTo, 79 /** @short The Cc addresses */ 80 RoleMessageCc, 81 /** @short The Bcc: addresses */ 82 RoleMessageBcc, 83 /** @short The Sender: header */ 84 RoleMessageSender, 85 /** @short The Reply-To: header */ 86 RoleMessageReplyTo, 87 /** @short The Message-Id: header */ 88 RoleMessageMessageId, 89 /** @short The In-Reply-To: header */ 90 RoleMessageInReplyTo, 91 /** @short The message timestamp as determined from IMAP's ENVELOPE, ie. from the RFC2822 headers */ 92 RoleMessageDate, 93 /** @short Timestamp of when the message was delivered to the mailbox (ie. IMAP's INTERNALDATE) */ 94 RoleMessageInternalDate, 95 /** @short Size of the message */ 96 RoleMessageSize, 97 /** @short Status of the \\Seen flag */ 98 RoleMessageIsMarkedRead, 99 /** @short Was unread when mailbox opened, or has been marked unread. This flag is transient and is recalculated 100 * when switching mailboxes. */ 101 RoleMessageWasUnread, 102 /** @short Status of the \\Deleted flag */ 103 RoleMessageIsMarkedDeleted, 104 /** @short Was the message forwarded? */ 105 RoleMessageIsMarkedForwarded, 106 /** @short Was the message replied to? */ 107 RoleMessageIsMarkedReplied, 108 /** @short Is the message marked as a recent one? */ 109 RoleMessageIsMarkedRecent, 110 /** @short Is the message markes as flagged? */ 111 RoleMessageIsMarkedFlagged, 112 /** @short Is the message markes as junk? */ 113 RoleMessageIsMarkedJunk, 114 /** @short Is the message markes as notjunk? */ 115 RoleMessageIsMarkedNotJunk, 116 /** @short IMAP flags of a message */ 117 RoleMessageFlags, 118 /** @short Is the current item a root of thread with unread messages */ 119 RoleThreadRootWithUnreadMessages, 120 /** @short Fuzzy date of a particular message; useful for rough navigation */ 121 RoleMessageFuzzyDate, 122 /** @short List of message IDs from the message's References header */ 123 RoleMessageHeaderReferences, 124 /** @short The List-Post header from RFC 2369 */ 125 RoleMessageHeaderListPost, 126 /** @short Is the List-Post set to a special value of "NO"? */ 127 RoleMessageHeaderListPostNo, 128 /** @short A full message envelope */ 129 RoleMessageEnvelope, 130 /** @short Is this a mail with at least one attachment? 131 132 The returned value might be a bit fuzzy. 133 */ 134 RoleMessageHasAttachments, 135 136 /** @short Contents of a message part */ 137 RolePartData, 138 /** @short Unicode text, i.e. RolePartData already decoded */ 139 RolePartUnicodeText, 140 /** @short MIME type of a message part */ 141 RolePartMimeType, 142 /** @short Charset of a message part */ 143 RolePartCharset, 144 /** @short The format= parameter of the message part's Content-Type */ 145 RolePartContentFormat, 146 /** @short The delsp= parameter of the message part's Content-Type */ 147 RolePartContentDelSp, 148 /** @short Encoding of a message part */ 149 RolePartEncoding, 150 /** @short The body-fld-id field from BODYSTRUCTURE */ 151 RolePartBodyFldId, 152 /** @short The Content-Disposition of a message part */ 153 RolePartBodyDisposition, 154 /** @short The file name for a message part */ 155 RolePartFileName, 156 /** @short The size of this part, as determined from BODYSTRUCTURE */ 157 RolePartOctets, 158 /** @short Access to the partId() function */ 159 RolePartId, 160 /** @short Access to the partToPath() function */ 161 RolePartPathToPart, 162 /** @short CID of the main part of a multipart/related message */ 163 RolePartMultipartRelatedMainCid, 164 /** @short Is this a top-level multipart, i.e. a multipart/... and a child of a message/rfc822? See isTopLevelMultipart. */ 165 RolePartIsTopLevelMultipart, 166 /** @short Return the body-fld-param from BODUSTRUCTURE, which usually contains some optional MIME parameters about this part */ 167 RolePartBodyFldParam, 168 169 /** @short Fetch a part from the cache if it's available, but do not request it from the server */ 170 RolePartForceFetchFromCache, 171 /** @short Pointer to the internal buffer */ 172 RolePartBufferPtr, 173 174 /** @short QModelIndex of the message a part is associated to */ 175 RolePartMessageIndex, 176 177 178 /** @short Is the format of this particular multipart/signed supported for signature verification? 179 180 A multipart/signed could use some unrecognized or unsupported algorithm, in which case we won't even try 181 to verify the signature. If this is role returns true, it means that there will be just one child item 182 and that that child's validity will be checked by the crypto operation. This role does not imply anything 183 about the validity of the actual signature, though. 184 */ 185 RolePartSignatureVerifySupported, 186 /** @short Is the format of this particular multipart/encrypted supported and recognized? 187 188 See RolePartSignatureVerifySupported, this is an equivalent. 189 */ 190 RolePartDecryptionSupported, 191 /** @short Is there any point in waiting longer? 192 193 If true, this means that the crypto code is either waiting for data from the network, or that there is 194 a crypto operation in progress. 195 */ 196 RolePartCryptoNotFinishedYet, 197 /** @short Was there a failure in some cryptography operation which affected the ability to show the message? 198 199 "Failure" means that something went wrong. Maybe some system component failed, or the message arrived too damaged to 200 be decrypted. This state has nothing to do with, say, a message whose signature failed to verify. 201 */ 202 RolePartCryptoDecryptionFailed, 203 /** @short Short message about the status/result of a crypto operation 204 205 This is suitable for an immediate presentation to the user. The text should be short enough to not distract 206 the user too much, but also descriptive enough to make sense on its own, without having to consult the longer, 207 more detailed status message. 208 */ 209 RolePartCryptoTLDR, 210 /** @short Longer information about the status/result of a crypto operation 211 212 This can be shown to the user when they ask for more details. It could possibly be a very long text, including some cryptic 213 output from gpg's stderr, for example. 214 */ 215 RolePartCryptoDetailedMessage, 216 /** @short Icon name for showing the result of a crypto operation */ 217 RolePartCryptoStatusIconName, 218 /** @short Is this a valid signature subject to all checks, whatever they are? */ 219 RolePartSignatureValidTrusted, 220 /** @short Is this a technically valid signature without taking the trust level and other policies into account? */ 221 RolePartSignatureValidDisregardingTrust, 222 /** @short Who made the signature */ 223 RolePartSignatureSignerName, 224 /** @short When was the signature made */ 225 RolePartSignatureSignDate, 226 227 228 /** @short True if the item in the tasks list is actually a ParserState 229 230 This role is *not* used or implemented by the IMAP models, but only by the TaskPresentationModel. 231 */ 232 RoleTaskIsParserState, 233 /** @short True if the task shall be visible in the user-facing list of current activities 234 235 This role is *not* used or implemented by the IMAP models, but only by the TaskPresentationModel and VisibleTasksModel. 236 */ 237 RoleTaskIsVisible, 238 /** @short A short explanaiton of the task -- what is it doing? */ 239 RoleTaskCompactName, 240 241 /** @short Content-Disposition (inline or attachment) of an attachment within MessageComposer 242 243 The enum value is converted to int. 244 */ 245 RoleAttachmentContentDispositionMode, 246 247 /** @short The very last role */ 248 RoleInvalidLastOne 249 }; 250 251 } 252 } 253 254 #endif // IMAP_MODEL_ITEMROLES_H 255