messagingapp/msgutils/unidatamodel/unimmsdataplugin/inc/unimmsdataplugin.h
changeset 25 84d9eb65b26f
parent 23 238255e8b033
child 27 e4592d119491
child 37 518b245aa84c
child 79 2981cb3aa489
equal deleted inserted replaced
23:238255e8b033 25:84d9eb65b26f
     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: MMS data model plugin.
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef UNIMMSDATAPLUGIN_H_
       
    19 #define UNIMMSDATAPLUGIN_H_
       
    20 
       
    21 #include <QObject>
       
    22 #include "unidatamodelplugininterface.h"
       
    23 
       
    24 class UniMMSDataPluginPrivate;
       
    25 
       
    26 /**
       
    27  * MMS data model plugin.
       
    28  * Implements the processing of an MMS message in Message Store.
       
    29  */
       
    30 class UniMMSDataPlugin : public QObject, public UniDataModelPluginInterface
       
    31 {
       
    32 Q_OBJECT 
       
    33 Q_INTERFACES(UniDataModelPluginInterface)
       
    34 
       
    35 public:
       
    36     /**
       
    37      * Constructor
       
    38      */
       
    39     UniMMSDataPlugin(QObject* parent = 0);
       
    40 
       
    41     /**
       
    42      * Destructor
       
    43      */
       
    44     ~UniMMSDataPlugin();
       
    45     
       
    46     /**
       
    47      * Creates the new instance of the plugin
       
    48      * @return plugin instance
       
    49      */    
       
    50     QObject* createInstance();
       
    51 
       
    52     /**
       
    53      * Sets the id of the message whose details needs to be extacted.
       
    54      * @param TMsvId of the message.
       
    55      */
       
    56     int setMessageId(int messageId);
       
    57 
       
    58     /** Reset the datamodel
       
    59      * Resets the data model to be used again
       
    60      */
       
    61     void reset();
       
    62 
       
    63     /**
       
    64      * Get the body of the message
       
    65      * @param aBodyText , a QString to hold the message body
       
    66      */
       
    67     void body(QString& aBodyText);
       
    68 
       
    69     /**
       
    70      * Size of the message
       
    71      * @return message size
       
    72      */
       
    73     int messageSize();
       
    74 
       
    75     /**
       
    76      * List of the message To recipients 
       
    77      * @param  mAddressList, list of all addresses in the message
       
    78      */
       
    79     void toRecipientList(ConvergedMessageAddressList& mAddressList);
       
    80 
       
    81     /**
       
    82      * List of the message CC recipients 
       
    83      * @param  mAddressList, list of all addresses in the message
       
    84      */
       
    85     void ccRecipientList(ConvergedMessageAddressList& mAddressList);
       
    86 
       
    87     /**
       
    88      * List of the message  bCC recipients 
       
    89      * @param  mAddressList, list of all addresses in the message
       
    90      */
       
    91     void bccRecipientList(ConvergedMessageAddressList& mAddressList);
       
    92 
       
    93     /**
       
    94      * The from address of a message
       
    95      * @param messageAddress
       
    96      */
       
    97     void fromAddress(QString& messageAddress);
       
    98 
       
    99     /**
       
   100      * List of attachments in the message.
       
   101      * @return the attachment list for the message.
       
   102      */
       
   103     UniMessageInfoList attachmentList();
       
   104 
       
   105     /**
       
   106      * Type of the message (SMS/MMS etc..)
       
   107      * @return message type
       
   108      */
       
   109     QString messageType();
       
   110 
       
   111     /**
       
   112      * Priority of the message (low/medium/high)
       
   113      * @return MsgPriority.
       
   114      */
       
   115     MsgPriority messagePriority();
       
   116 
       
   117     /**
       
   118      * Number of attachments with the message
       
   119      * @return count of attachment
       
   120      */
       
   121     int attachmentCount();
       
   122 
       
   123     /**
       
   124      * To check if the message has attachments
       
   125      * @return true/false
       
   126      */
       
   127     bool hasAttachment();
       
   128 
       
   129     /**
       
   130      * Number of objects asociated with a MMS message
       
   131      * @return object count
       
   132      */
       
   133     int objectCount();
       
   134 
       
   135     /**
       
   136      * The MMS object list asociated with a MMS message
       
   137      * @return object list 
       
   138      */
       
   139     UniMessageInfoList objectList();
       
   140 
       
   141     /**
       
   142      * Number of slides asociated with a MMS message
       
   143      * @return slide count
       
   144      */
       
   145     int slideCount();
       
   146 
       
   147     /**
       
   148      * The content of a Slide in case of a MMS message
       
   149      * @param list of messageinfo objects.
       
   150      */
       
   151     UniMessageInfoList slideContent(int slidenum);
       
   152 
       
   153     /**
       
   154      * Time stamp of the message when it was created/recieved.
       
   155      * @param mesage time
       
   156      */
       
   157     QDateTime timeStamp();
       
   158     
       
   159     /**
       
   160      * @see UniDataModelPluginInterface
       
   161      */
       
   162     void addObject( int aslideNum,UniMessageInfo* aInfo );
       
   163 
       
   164     /**
       
   165      * @see UniDataModelPluginInterface
       
   166      */    
       
   167     void addTextObject(int aSlideNum,QString aText );
       
   168     
       
   169     /**
       
   170      * @see UniDataModelPluginInterface
       
   171      */
       
   172     void addSlide( int aSlideNum );
       
   173     
       
   174     /**
       
   175      * @see UniDataModelPluginInterface
       
   176      */
       
   177     void composeSmil(CMsvStore& aEditStore);
       
   178     
       
   179     /**
       
   180      * @see UniDataModelPluginInterface
       
   181      */
       
   182     void saveObjects();
       
   183     
       
   184     /**
       
   185      * @see UniDataModelPluginInterface
       
   186      */
       
   187     TMsvAttachmentId getSmilAttachmentByIndex();
       
   188 
       
   189     /**
       
   190      * @see UniDataModelPluginInterface
       
   191      */
       
   192     void restore(CBaseMtm& mtm);
       
   193 
       
   194     /**
       
   195      * @see UniDataModelPluginInterface 
       
   196      */
       
   197     void addAttachment( UniMessageInfo* aInfo );
       
   198     
       
   199     /**
       
   200      * @see UniDataModelPluginInterface 
       
   201      */
       
   202     void removeSlide(int aSlideNumber);
       
   203 	
       
   204 	/**
       
   205      * @see UniDataModelPluginInterface 
       
   206      */
       
   207 	QString subject();
       
   208 	
       
   209 	/**
       
   210      * @see UniDataModelPluginInterface 
       
   211      */	
       
   212     CMsvSession* session();
       
   213         
       
   214 private:
       
   215     UniMMSDataPluginPrivate* d_ptr;
       
   216 };
       
   217 
       
   218 #endif /* UNIMMSDATAPLUGIN_H_ */