// // Tizen Web Device API // Copyright (c) 2012 Samsung Electronics Co., Ltd. // // Licensed under the Apache License, Version 2.0 (the License); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // #include "MessageFolder.h" #include #include #include "MsgServiceHandleMgr.h" #include "IMessaging.h" extern "C" { #include #include } namespace DeviceAPI { namespace Messaging { MessageFolder::MessageFolder() { } MessageFolder::MessageFolder(email_mailbox_t m_mailboxes) { m_id = m_mailboxes.mailbox_id; m_parentid = -1; m_accountid = m_mailboxes.account_id; m_contentType = TYPE_EMAIL; m_name = m_mailboxes.alias; m_path = m_mailboxes.mailbox_name; m_type = getFolderType(m_mailboxes.mailbox_type); if(0 == m_mailboxes.local) { m_synchronizable = TRUE; }else { m_synchronizable = FALSE; } } MessageFolder::~MessageFolder() { } void MessageFolder::setName(std::string name) { m_name = name; } void MessageFolder::setSynchronizable(bool synchronizable) { m_synchronizable = synchronizable; } // getter unsigned long MessageFolder::getId() { return m_id; } unsigned long MessageFolder::getParentId() { return m_parentid; } unsigned long MessageFolder::getAccountId() { return m_accountid; } unsigned short MessageFolder::getContentType() { return m_contentType; } std::string MessageFolder::getName() { return m_name; } std::string MessageFolder::getPath() { return m_path; } unsigned short MessageFolder::getType() { return m_type; } bool MessageFolder::getSynchronizable() { return m_synchronizable; } int MessageFolder::getFolderType(email_mailbox_type_e folderType) { if(EMAIL_MAILBOX_TYPE_INBOX == folderType) { return FOLDER_INBOX; } else if(EMAIL_MAILBOX_TYPE_SENTBOX == folderType) { return FOLDER_SENTBOX; } else if(EMAIL_MAILBOX_TYPE_DRAFT == folderType) { return FOLDER_DRAFTS; } else if(EMAIL_MAILBOX_TYPE_OUTBOX == folderType) { return FOLDER_OUTBOX; } else if(EMAIL_MAILBOX_TYPE_ALL_EMAILS != folderType) { return FOLDER_NOTSTANDARD; } return FOLDER_NOTSTANDARD; } } }