emailservices/nmailbase/inc/nmmessage.h
branchRCL_3
changeset 24 d189ee25cf9d
equal deleted inserted replaced
23:dcf0eedfc1a3 24:d189ee25cf9d
       
     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 NMMESSAGE_H_
       
    19 #define NMMESSAGE_H_
       
    20 
       
    21 #include <QString>
       
    22 #include <QDateTime>
       
    23 #include "nmbasedef.h"
       
    24 #include "nmcommon.h"
       
    25 #include "nmmessagepart.h"
       
    26 #include "nmmessageenvelope.h"
       
    27 
       
    28 class CFSMailMessage;
       
    29 
       
    30 class NMBASE_EXPORT NmMessagePrivate : public QSharedData
       
    31 {
       
    32 public:
       
    33     NmMessagePrivate();
       
    34     virtual ~NmMessagePrivate();
       
    35 public:
       
    36     NmMessageEnvelope mEnvelope;
       
    37 };
       
    38 
       
    39 class NMBASE_EXPORT NmMessage : public NmMessagePart
       
    40 {
       
    41 public:
       
    42     NmMessage();
       
    43     NmMessage(const NmId &messageId);
       
    44     NmMessage(const NmId &messageId, const NmId &folderId);
       
    45     NmMessage(const NmId &messageId, const NmId &folderId, const NmId &mailboxId);
       
    46     NmMessage(const NmMessageEnvelope &envelope);
       
    47 
       
    48     NmMessage(const NmMessage &message);
       
    49     virtual ~NmMessage();
       
    50     NmMessage(const NmMessagePart& message);
       
    51 
       
    52     const NmMessagePart *plainTextBodyPart() const;
       
    53     NmMessagePart *plainTextBodyPart();
       
    54     const NmMessagePart *htmlBodyPart() const;
       
    55     NmMessagePart *htmlBodyPart();
       
    56 
       
    57     NmMessageEnvelope &envelope();
       
    58     const NmMessageEnvelope &envelope() const;
       
    59 
       
    60     void attachmentList(QList<NmMessagePart*> &parts) const;
       
    61     
       
    62 private:
       
    63     // prohibited
       
    64     NmMessage &operator=(const NmMessage &message);
       
    65     
       
    66     // for CFSMailMessage
       
    67     NmMessage(const NmMessageEnvelope &envelope,
       
    68             QExplicitlySharedDataPointer<NmMessagePartPrivate> nmPrivateMessagePart);
       
    69     
       
    70     friend class CFSMailMessage;
       
    71 
       
    72 private:
       
    73     QExplicitlySharedDataPointer<NmMessagePrivate> d;
       
    74 
       
    75 };
       
    76 
       
    77 #endif /* NMMESSAGE_H_ */
       
    78 
       
    79 
       
    80 
       
    81