Adding MessageStatus class, meant to replace booleans passed around.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35835 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
f427f6af3f
commit
5975d86a38
@ -24,6 +24,7 @@ Application Mail :
|
||||
MailPopUpMenu.cpp
|
||||
MailSupport.cpp
|
||||
MailWindow.cpp
|
||||
MessageStatus.cpp
|
||||
Prefs.cpp
|
||||
QueryMenu.cpp
|
||||
Signature.cpp
|
||||
|
85
src/apps/mail/MessageStatus.cpp
Normal file
85
src/apps/mail/MessageStatus.cpp
Normal file
@ -0,0 +1,85 @@
|
||||
#include "MessageStatus.h"
|
||||
|
||||
|
||||
MessageStatus::MessageStatus()
|
||||
:
|
||||
fStatus(MAIL_WRITING)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
MessageStatus::~MessageStatus()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
MessageStatus::SetStatus(messageStatus status)
|
||||
{
|
||||
fStatus = status;
|
||||
}
|
||||
|
||||
|
||||
messageStatus
|
||||
MessageStatus::Status()
|
||||
{
|
||||
return fStatus;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
MessageStatus::Reading()
|
||||
{
|
||||
return fStatus == MAIL_READING;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
MessageStatus::Writing()
|
||||
{
|
||||
return fStatus == MAIL_WRITING;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
MessageStatus::WritingDraft()
|
||||
{
|
||||
return fStatus == MAIL_WRITING_DRAFT;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
MessageStatus::Replying()
|
||||
{
|
||||
return fStatus == MAIL_REPLYING;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
MessageStatus::Forwarding()
|
||||
{
|
||||
return fStatus == MAIL_FORWARDING;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
MessageStatus::Outgoing()
|
||||
{
|
||||
return (fStatus == MAIL_WRITING
|
||||
|| fStatus == MAIL_WRITING_DRAFT
|
||||
|| fStatus == MAIL_REPLYING
|
||||
|| fStatus == MAIL_FORWARDING);
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
MessageStatus::MailIsOnDisk()
|
||||
{
|
||||
return (fStatus == MAIL_READING
|
||||
|| fStatus == MAIL_WRITING_DRAFT
|
||||
|| fStatus == MAIL_REPLYING
|
||||
|| fStatus == MAIL_FORWARDING);
|
||||
}
|
||||
|
41
src/apps/mail/MessageStatus.h
Normal file
41
src/apps/mail/MessageStatus.h
Normal file
@ -0,0 +1,41 @@
|
||||
#ifndef _MESSAGE_STATUS_H
|
||||
#define _MESSAGE_STATUS_H
|
||||
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
|
||||
enum messageStatus {
|
||||
MAIL_READING = 0,
|
||||
MAIL_WRITING,
|
||||
MAIL_WRITING_DRAFT,
|
||||
MAIL_REPLYING,
|
||||
MAIL_FORWARDING
|
||||
};
|
||||
|
||||
|
||||
class MessageStatus {
|
||||
public:
|
||||
MessageStatus();
|
||||
~MessageStatus();
|
||||
|
||||
void SetStatus(messageStatus status);
|
||||
messageStatus Status();
|
||||
|
||||
bool Reading();
|
||||
bool Writing();
|
||||
bool WritingDraft();
|
||||
bool Replying();
|
||||
bool Forwarding();
|
||||
|
||||
bool Outgoing();
|
||||
|
||||
bool MailIsOnDisk();
|
||||
|
||||
private:
|
||||
messageStatus fStatus;
|
||||
};
|
||||
|
||||
|
||||
#endif // _MESSAGE_STATUS_H
|
||||
|
Loading…
Reference in New Issue
Block a user