messagingapp/msgutils/unidatautils/unidatamodelplugins/unismsdataplugin/inc/unismsdataplugin.h
changeset 25 84d9eb65b26f
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: SMS data model plugin.
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef UNISMSDATAPLUGIN_H_
       
    19 #define UNISMSDATAPLUGIN_H_
       
    20 
       
    21 
       
    22 #include <QObject>
       
    23 #include "unidatamodelplugininterface.h"
       
    24 
       
    25 /**
       
    26  * SMS data model plugin.
       
    27  * Implements the processing of a SMS message in Message Store.
       
    28  */
       
    29 
       
    30 class UniSMSDataPluginPrivate;
       
    31 
       
    32 class UniSMSDataPlugin : public QObject, public UniDataModelPluginInterface
       
    33 {
       
    34     Q_OBJECT
       
    35     Q_INTERFACES(UniDataModelPluginInterface)
       
    36 
       
    37 public:
       
    38     /**
       
    39      * constructor
       
    40      */
       
    41     UniSMSDataPlugin(QObject* parent = 0);
       
    42 
       
    43     /**
       
    44      * Destructor
       
    45      */
       
    46     ~UniSMSDataPlugin();
       
    47     
       
    48     /**
       
    49      * Creates the new instance of the plugin
       
    50      * @return plugin instance
       
    51      */    
       
    52     QObject* createInstance();
       
    53 
       
    54 
       
    55     /**
       
    56      *  Reset the datamodel
       
    57      */
       
    58     void reset();
       
    59 
       
    60     /**
       
    61      * sets the message id for which details needs to be fetched
       
    62      * @param message id
       
    63      */
       
    64     int setMessageId(int mId);
       
    65 
       
    66     /**
       
    67      * Get the body of the message
       
    68      * @param aBodyText, for message body
       
    69      */
       
    70     void body(QString& aBodyText);
       
    71 
       
    72     /**
       
    73      * size of the message
       
    74      * @return size
       
    75      */
       
    76     int messageSize();
       
    77 
       
    78     /**
       
    79      * List of the message TO recipients
       
    80      * @param list of the recipients
       
    81      */
       
    82     void toRecipientList(ConvergedMessageAddressList& mAddressList);
       
    83     /**
       
    84      * List of the message cc recipients
       
    85      * @param list of the recipients
       
    86      */
       
    87     void ccRecipientList(ConvergedMessageAddressList& mAddressList);
       
    88 
       
    89     /**
       
    90      * List of the message bCC recipients
       
    91      * @param list of the recipients
       
    92      */
       
    93     void bccRecipientList(ConvergedMessageAddressList& mAddressList);
       
    94 
       
    95     /**
       
    96      * Address from which the message was received
       
    97      * @param messageAddress
       
    98      */
       
    99     void fromAddress(QString& messageAddress);
       
   100 
       
   101     /**
       
   102      * No. of attachments with the message
       
   103      * @return attachment count 
       
   104      */
       
   105     int attachmentCount();
       
   106 
       
   107     /**
       
   108      *  To check if the message has attachments
       
   109      *  @return true if attachment is present
       
   110      */
       
   111     bool hasAttachment();
       
   112 
       
   113     /**
       
   114      * list of attachments for a message 
       
   115      * @return attachemnt list
       
   116      */
       
   117     UniMessageInfoList attachmentList();
       
   118 
       
   119     /**
       
   120      *  Message type (SMS/MMS etc..)
       
   121      *  @return type of message 
       
   122      */
       
   123     QString messageType();
       
   124 
       
   125     /**
       
   126      * Priority of the message (high/low/medium)
       
   127      */
       
   128     MsgPriority messagePriority();
       
   129 
       
   130     /**
       
   131      * Number of objects asociated with a MMS message
       
   132      * @return count of objects
       
   133      */
       
   134     int objectCount();
       
   135 
       
   136     /**
       
   137      * The MMS object list
       
   138      * @return object list 
       
   139      */
       
   140     UniMessageInfoList objectList();
       
   141 
       
   142     /**
       
   143      * Number of slides associated with a MMS message
       
   144      * @return count of slides
       
   145      */
       
   146     int slideCount();
       
   147 
       
   148     /**
       
   149      * The MMS slide content 
       
   150      * @return slide list
       
   151      */
       
   152     UniMessageInfoList slideContent(int slidenum);
       
   153 
       
   154     /**
       
   155      * Time stamp of the message
       
   156      * @return time stamp of the created/received message
       
   157      */
       
   158     QDateTime timeStamp();
       
   159 
       
   160     /**
       
   161      * @see UniDataModelPluginInterface
       
   162      */
       
   163     void restore(CBaseMtm& mtm);
       
   164 
       
   165     /**
       
   166      * @see UniDataModelPluginInterface
       
   167      */
       
   168     QString subject();
       
   169     
       
   170 	  /**
       
   171      * @see UniDataModelPluginInterface
       
   172      */
       
   173     CMsvSession* session();
       
   174 	
       
   175 
       
   176 private:
       
   177     UniSMSDataPluginPrivate* d_ptr;
       
   178 };
       
   179 
       
   180 #endif