inc/convergedmessageattachment.h
changeset 23 238255e8b033
equal deleted inserted replaced
5:4697dfb2d7ad 23:238255e8b033
       
     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  * Description: This class defines Converged message's attachment
       
    14  */
       
    15 
       
    16 #ifndef CONVERGEDMESSAGEATTACHMENT_H_
       
    17 #define CONVERGEDMESSAGEATTACHMENT_H_
       
    18 
       
    19 //SYSTEM INCLUDE
       
    20 #include <QString>
       
    21 #include <QList>
       
    22 #include "msgutilsapidefines.h"
       
    23 
       
    24 /**
       
    25  * ConvergedMessageAttachment
       
    26  * Definition of Converged message's attachment object
       
    27  */
       
    28 class MSG_UTILS_API_EXPORT ConvergedMessageAttachment
       
    29     {
       
    30 public:
       
    31     /**
       
    32      * AttachmentType
       
    33      * enumerations for converged message's attachement type
       
    34      */
       
    35     enum AttachmentType
       
    36         {
       
    37         EInline = 0,
       
    38         EAttachment,
       
    39         ESmil,
       
    40         EUnknown
       
    41         };
       
    42 
       
    43     /**
       
    44      * Constructor
       
    45      */
       
    46     ConvergedMessageAttachment(const QString& filepath = QString(),
       
    47                                const int attachmenttype = EUnknown);
       
    48 
       
    49     /**
       
    50      * Destructor
       
    51      */
       
    52     ~ConvergedMessageAttachment();
       
    53     
       
    54     /**
       
    55      * setFilePath
       
    56      * @param filepath
       
    57      */
       
    58     void setFilePath( const QString& filepath );
       
    59 
       
    60     /**
       
    61      * filePath
       
    62      * @return file path of the attachment
       
    63      */
       
    64      const QString& filePath() const;
       
    65      
       
    66      /**
       
    67       * setAttachmentType
       
    68       * @param attachmenttype
       
    69       */
       
    70      void setAttachmentType( const int attachmenttype );
       
    71 
       
    72     /**
       
    73      * type
       
    74      * @return attachment type
       
    75      */
       
    76      int attachmentType() const;
       
    77 
       
    78 	/**
       
    79 	* Serialize the data memebers into the stream.
       
    80 	* @param stream data stream to which data is serialized.
       
    81 	*/
       
    82 	void serialize(QDataStream &stream) const;
       
    83 
       
    84 	/**
       
    85 	* Deserialize the stream to data members.
       
    86 	* @param stream data stream from which data is deserialized.
       
    87 	*/
       
    88 	void deserialize(QDataStream &stream);
       
    89 
       
    90 	/**
       
    91 	* Overloaded == operator
       
    92 	* Compares two message attachments
       
    93 	* @param other another ConvergedMessageAttachment
       
    94 	* @return bool true or false if the attachments are same
       
    95 	*/
       
    96 	bool operator==(const ConvergedMessageAttachment &other) const;
       
    97 
       
    98 private:
       
    99     /**
       
   100      * mPath Path of the attachment
       
   101      */
       
   102     QString mPath;
       
   103 
       
   104     /**
       
   105      * mType Attachment type
       
   106      */
       
   107     int mType;
       
   108     };
       
   109 
       
   110 typedef QList<ConvergedMessageAttachment*> ConvergedMessageAttachmentList;
       
   111 
       
   112 #endif /* CONVERGEDMESSAGEATTACHMENT_H_ */