emailservices/nmclientapi/src/nmapimessagebody.cpp
branchRCL_3
changeset 63 d189ee25cf9d
equal deleted inserted replaced
61:dcf0eedfc1a3 63: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 #include "nmapiheaders.h"
       
    19 
       
    20 
       
    21 namespace EmailClientApi
       
    22 {
       
    23 
       
    24 /*!
       
    25    constructor for NmApiMessageBody
       
    26  */
       
    27 NmApiMessageBody::NmApiMessageBody()
       
    28 {
       
    29     NM_FUNCTION;
       
    30     
       
    31     d = new NmApiMessageBodyPrivate();
       
    32 }
       
    33 
       
    34 /*!
       
    35    copying constructor for NmApiMessageBody
       
    36  */
       
    37 NmApiMessageBody::NmApiMessageBody(const NmApiMessageBody &apiMessageBody) : d(apiMessageBody.d)
       
    38 {
       
    39     NM_FUNCTION;
       
    40 }
       
    41 
       
    42 /*!
       
    43    assignment operator for nmapimessagebody
       
    44  */
       
    45 NmApiMessageBody& NmApiMessageBody::operator=(const NmApiMessageBody &apiMessageBody)
       
    46 {
       
    47     NM_FUNCTION;
       
    48     
       
    49 	if (this != &apiMessageBody) 
       
    50 	{
       
    51 		d = apiMessageBody.d;
       
    52 	}
       
    53 	return *this;
       
    54 }
       
    55 
       
    56 /*!
       
    57    Compare data from \a apiMessageBody
       
    58  */    
       
    59 bool NmApiMessageBody::operator==(const NmApiMessageBody &apiMessageBody)
       
    60 {
       
    61     NM_FUNCTION;
       
    62     
       
    63     bool retVal = false;
       
    64     if (this->d == apiMessageBody.d)
       
    65     {
       
    66         retVal = true;
       
    67     }
       
    68     return retVal;
       
    69 }
       
    70 
       
    71 /*!
       
    72    Destructor for NmApiMessageBody
       
    73  */
       
    74 NmApiMessageBody::~NmApiMessageBody()
       
    75 {
       
    76     NM_FUNCTION;
       
    77 }
       
    78 /*!
       
    79    getter for total size of message body in bytes
       
    80  */
       
    81 quint64 NmApiMessageBody::totalSize() const
       
    82 {
       
    83     NM_FUNCTION;
       
    84     
       
    85     return d->totalSize;
       
    86 }
       
    87 
       
    88 /*!
       
    89    getter for bytes available in local mailbox store
       
    90  */
       
    91 quint64 NmApiMessageBody::fetchedSize() const
       
    92 {
       
    93     NM_FUNCTION;
       
    94     
       
    95     return d->fetchedSize;
       
    96 }
       
    97 
       
    98 /*!
       
    99    getter for fetched content
       
   100  */
       
   101 QString NmApiMessageBody::content() const
       
   102 {
       
   103     NM_FUNCTION;
       
   104     
       
   105     return d->content;
       
   106 }
       
   107 
       
   108 /*!
       
   109    setter for total size of message body in bytes
       
   110  */
       
   111 void NmApiMessageBody::setTotalSize(quint64 size)
       
   112 {
       
   113     NM_FUNCTION;
       
   114     
       
   115     d->totalSize = size;
       
   116 }
       
   117 
       
   118 /*!
       
   119    setter for bytes available on local mailbox store
       
   120  */
       
   121 void NmApiMessageBody::setFetchedSize(quint64 size)
       
   122 {
       
   123     NM_FUNCTION;
       
   124     
       
   125     d->fetchedSize = size;
       
   126 }
       
   127 
       
   128 /*!
       
   129    setter for content
       
   130  */
       
   131 void NmApiMessageBody::setContent(const QString& content)
       
   132 {
       
   133     NM_FUNCTION;
       
   134     
       
   135     d->content = content;
       
   136 }
       
   137 }
       
   138