1 /* 2 * Copyright 2010 Haiku Inc. All rights reserved. 3 * Distributed under the terms of the MIT License. 4 * 5 * Authors: 6 * Jonas Sundström, jonas@kirilla.com 7 */ 8 9 10 #include "MessageStatus.h" 11 12 MessageStatus()13MessageStatus::MessageStatus() 14 : 15 fStatus(MAIL_WRITING) 16 { 17 18 } 19 20 ~MessageStatus()21MessageStatus::~MessageStatus() 22 { 23 24 } 25 26 27 void SetStatus(messageStatus status)28MessageStatus::SetStatus(messageStatus status) 29 { 30 fStatus = status; 31 } 32 33 34 messageStatus Status()35MessageStatus::Status() 36 { 37 return fStatus; 38 } 39 40 41 bool Reading()42MessageStatus::Reading() 43 { 44 return fStatus == MAIL_READING; 45 } 46 47 48 bool Writing()49MessageStatus::Writing() 50 { 51 return fStatus == MAIL_WRITING; 52 } 53 54 55 bool WritingDraft()56MessageStatus::WritingDraft() 57 { 58 return fStatus == MAIL_WRITING_DRAFT; 59 } 60 61 62 bool Replying()63MessageStatus::Replying() 64 { 65 return fStatus == MAIL_REPLYING; 66 } 67 68 69 bool Forwarding()70MessageStatus::Forwarding() 71 { 72 return fStatus == MAIL_FORWARDING; 73 } 74 75 76 bool Outgoing()77MessageStatus::Outgoing() 78 { 79 return (fStatus == MAIL_WRITING 80 || fStatus == MAIL_WRITING_DRAFT 81 || fStatus == MAIL_REPLYING 82 || fStatus == MAIL_FORWARDING); 83 } 84 85 86 bool MailIsOnDisk()87MessageStatus::MailIsOnDisk() 88 { 89 return (fStatus == MAIL_READING 90 || fStatus == MAIL_WRITING_DRAFT 91 || fStatus == MAIL_REPLYING 92 || fStatus == MAIL_FORWARDING); 93 } 94 95