email_plat/nmail_client_api/nmapicommon.h
changeset 74 6c59112cfd31
parent 69 4e54af54a4a1
child 76 38bf5461e270
equal deleted inserted replaced
69:4e54af54a4a1 74:6c59112cfd31
     1 /*
       
     2  * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef NMAPICOMMON_H_
       
    19 #define NMAPICOMMON_H_
       
    20 
       
    21 #include <QMetaType>
       
    22 
       
    23 namespace EmailClientApi
       
    24 {
       
    25     /*!
       
    26        Enum to describe mailbox events
       
    27      */
       
    28     enum NmApiMailboxEvent
       
    29     {
       
    30         MailboxCreated, MailboxDeleted
       
    31     };
       
    32 
       
    33     /*!
       
    34         Email to message priority
       
    35      */
       
    36     enum NmApiMessagePriority
       
    37     {
       
    38         NmApiMessagePriorityLow,
       
    39         NmApiMessagePriorityNormal,
       
    40         NmApiMessagePriorityHigh
       
    41     };
       
    42 
       
    43     /*!
       
    44         Enum to message flags
       
    45      */
       
    46     enum NmApiMessageFlag 
       
    47     {
       
    48         NmApiMessageFlagRead = 1,
       
    49         NmApiMessageFlagReadLocally = 2,
       
    50         NmApiMessageFlagLow = 4,
       
    51         NmApiMessageFlagImportant = 8,
       
    52         NmApiMessageFlagFollowUpComplete = 16,
       
    53         NmApiMessageFlagFollowUp = 32,
       
    54         NmApiMessageFlagAttachments = 64,
       
    55         NmApiMessageFlagMultiple = 128,
       
    56         NmApiMessageFlagCalendarMsg = 256,
       
    57         NmApiMessageFlagAnswered = 512,
       
    58         NmApiMessageFlagForwarded = 1024,
       
    59         NmApiMessageFlagOnlyToMe = 2048,
       
    60         NmApiMessageFlagRemoteDeleted = 4096,
       
    61         NmApiMessageFlagHasMsgSender = 8192
       
    62     };
       
    63     Q_DECLARE_FLAGS(NmApiMessageFlags, NmApiMessageFlag)
       
    64     Q_DECLARE_OPERATORS_FOR_FLAGS(NmApiMessageFlags)
       
    65 
       
    66     /*!
       
    67        Enum to describe message events.
       
    68      */
       
    69     enum NmApiMessageEvent 
       
    70     {
       
    71         MessageCreated,
       
    72         MessageDeleted,
       
    73         MessageChanged
       
    74     };
       
    75     
       
    76     /*!
       
    77        Enum to describe type of email folder 
       
    78      */
       
    79     enum NmApiEmailFolderType
       
    80     {
       
    81         Inbox, Drafts, Outbox, Sent, Deleted, EOther
       
    82     };
       
    83 
       
    84     /*!
       
    85         Email list sorting options
       
    86      */
       
    87     enum NmApiMailSortField
       
    88         {
       
    89         MailDontCare,            // user accepts any sort order
       
    90         MailSortByDate,          // sorting is done by date
       
    91         MailSortBySender,        // sorting is done by sender
       
    92         MailSortByRecipient,     // sorting is done by recipients
       
    93         MailSortBySubject,       // sorting is done by subject
       
    94         MailSortByPriority,      // sorting is done by priority
       
    95         MailSortByFlagStatus,    // follow up and completed   
       
    96         MailSortByUnread,        // sorting is based on unread
       
    97         MailSortBySize,          // sorting is done by size
       
    98         MailSortByAttachment     // sorting is based on if message has attachments
       
    99         };
       
   100 
       
   101     /*!
       
   102         Email list sort order
       
   103      */
       
   104     enum NmApiMailSortOrder
       
   105         {
       
   106         MailDescending,
       
   107         MailAscending    
       
   108         };
       
   109 
       
   110     
       
   111     /*!
       
   112        Enum to describe error types
       
   113      */
       
   114     enum NmApiError
       
   115     {
       
   116         GeneralError = -1, NotSupportedError
       
   117     };
       
   118     
       
   119     /*!
       
   120         Sort criteria definion Class for searching email messages
       
   121      */
       
   122     class NmApiMailSortCriteria 
       
   123         {
       
   124         public:
       
   125             NmApiMailSortField iField;
       
   126             NmApiMailSortOrder iOrder;
       
   127         };
       
   128     
       
   129     /*!
       
   130         NmApi error codes
       
   131     */
       
   132     const int NmApiNoError = 0;
       
   133     const int NmApiNotFoundError = -1;
       
   134     const int NmApiGeneralError = -2;
       
   135     const int NmApiCancelError = -3;
       
   136     
       
   137     /*!
       
   138         NmApi predefined constants for ContentTypes
       
   139     */
       
   140     const QString NmApiContentTypeMultipartMixed = "multipart/mixed";
       
   141     const QString NmApiContentTypeMultipartAlternative = "multipart/alternative";
       
   142     const QString NmApiContentTypeMultipartDigest = "multipart/digest";
       
   143     const QString NmApiContentTypeMultipartParallel = "multipart/parallel";
       
   144     const QString NmApiContentTypeMultipartRelated =  "multipart/related";
       
   145     const QString NmApiContentTypeTextPlain = "text/plain";
       
   146     const QString NmApiContentTypeTextHtml = "text/html";
       
   147     const QString NmApiContentTypeTypeMessage = "message/rfc822";
       
   148     const QString NmApiContentTypeParamName = " name=";
       
   149     const QString NmApiContentTypeParamCharset = " charset=";
       
   150 }
       
   151 Q_DECLARE_METATYPE (EmailClientApi::NmApiMailboxEvent)
       
   152 Q_DECLARE_METATYPE(EmailClientApi::NmApiMessageEvent)
       
   153 Q_DECLARE_METATYPE (EmailClientApi::NmApiEmailFolderType)
       
   154 Q_DECLARE_METATYPE (EmailClientApi::NmApiError)
       
   155 
       
   156 #endif /* NMAPICOMMON_H_ */