messagingapp/msgui/unifiedviewer/inc/univiewerfeeder.h
branchRCL_3
changeset 26 ebe688cedc25
equal deleted inserted replaced
25:fa1df4b99609 26:ebe688cedc25
       
     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: Feeder class for unified viewer. Fetches data from the
       
    15  *              message store for the given message store id.
       
    16  *
       
    17  */
       
    18 #ifndef UNIVIEWER_FEEDER_H
       
    19 #define UNIVIEWER_FEEDER_H
       
    20 
       
    21 #include <QObject>
       
    22 #include <QDateTime>
       
    23 
       
    24 #include "convergedmessage.h"
       
    25 #include "unidatamodelplugininterface.h"
       
    26 
       
    27 const qint32 KMtmSmsUidValue = 0x1000102C;
       
    28 
       
    29 class UniViewerFeederPrivate;
       
    30 /**
       
    31  * Feeder class for unified viewer. Fetches data from the
       
    32  * message store for the given message store id.
       
    33  */
       
    34 class UniViewerFeeder : public QObject
       
    35 {
       
    36 Q_OBJECT
       
    37 
       
    38 public:
       
    39     /**
       
    40      * Default Constructor.
       
    41      * @param msgId message id
       
    42      * @param parent parent object.
       
    43      */
       
    44     UniViewerFeeder(qint32 msgId, QObject *parent = 0);
       
    45 
       
    46     /**
       
    47      * Destructor.
       
    48      */
       
    49     ~UniViewerFeeder();
       
    50 
       
    51     /**
       
    52      * Updates  the content by fetching new details
       
    53      * @param msgId message id
       
    54      * @param msgType message type
       
    55      */
       
    56     void updateContent(qint32 msgId);
       
    57 
       
    58     /**
       
    59      * Emits msgBody signal with msgBody as argument.
       
    60      * Called from private class to emit signal.
       
    61      * @param  msgBody message body text.
       
    62      */
       
    63     void emitMsgBody(QString msgBody);
       
    64 
       
    65     /**
       
    66      * Fetches message details from the store.
       
    67      */
       
    68     void fetchDetails();
       
    69 
       
    70     /**
       
    71      * Returns the message type.
       
    72      * @return  message type.
       
    73      */
       
    74     qint32 msgType();
       
    75 
       
    76     /**
       
    77      * Returns the time stamp.
       
    78      * @return  time stamp of the message.
       
    79      */
       
    80     QDateTime timeStamp();
       
    81 
       
    82     /**
       
    83      * hasAttachments
       
    84      * @return true/false based on if message has attachments
       
    85      */
       
    86     bool hasAttachments();
       
    87 
       
    88     /**
       
    89      * attachmentList
       
    90      * @return list of current message's attachments, with size and mimetype info
       
    91      */
       
    92     UniMessageInfoList attachmentsList();
       
    93 
       
    94     /**
       
    95      * attachmentCount
       
    96      * @return number of attachments in the message
       
    97      */
       
    98     int attachmentCount();
       
    99 
       
   100     /**
       
   101      * objectsList
       
   102      * @return list of current message's objects, with size and mimetype info
       
   103      */
       
   104     UniMessageInfoList objectsList();
       
   105 
       
   106     /**
       
   107      * objectCount
       
   108      * @return count of media objects in SMIL presentation.
       
   109      * NOTE: Smil attachment is _not_ counted as object.
       
   110      */
       
   111     int objectCount();
       
   112 
       
   113     /**
       
   114      * slideCount
       
   115      * @return count of slides in SMIL presentation.
       
   116      */
       
   117     int slideCount();
       
   118 
       
   119     /**
       
   120      * slideContent
       
   121      * @return list of media objects in given slide
       
   122      */
       
   123     UniMessageInfoList slideContent(int slidenum);
       
   124 
       
   125     /**
       
   126      * toAddressList
       
   127      * @return list of to address list
       
   128      */
       
   129     ConvergedMessageAddressList toAddressList();
       
   130 
       
   131     /**
       
   132      * ccAddressList
       
   133      * @return list of cc address list
       
   134      */
       
   135     ConvergedMessageAddressList ccAddressList();
       
   136 
       
   137     /**
       
   138      * bccAddressList
       
   139      * @return list of Bcc address list
       
   140      */
       
   141     ConvergedMessageAddressList bccAddressList();
       
   142 
       
   143     /**
       
   144      * recipientCount
       
   145      * @return Total recipient count
       
   146      */
       
   147     int recipientCount();
       
   148 
       
   149     /**
       
   150      * messageSize
       
   151      * @return int 
       
   152      */
       
   153     int messageSize();
       
   154 
       
   155     /**
       
   156      * clearContent
       
   157      * @void
       
   158      */
       
   159     void clearContent();
       
   160 
       
   161     /**
       
   162      * get the from address and alias of a message
       
   163      * @param from address
       
   164      * @param alias
       
   165      * @void 
       
   166      */
       
   167     void fromAddressAndAlias(QString& from, QString& alias);
       
   168     
       
   169     /**
       
   170      * whether the message is incoming Or outgoing.
       
   171      * @return bool
       
   172      */
       
   173     bool isIncoming();
       
   174     
       
   175     /**
       
   176      * returns the priority of the message.
       
   177      * @return int
       
   178      */
       
   179     int priority();
       
   180     
       
   181     /**
       
   182      * gets the subject of the message
       
   183      * @return QString
       
   184      */
       
   185     QString subject();
       
   186 
       
   187     /**
       
   188      * if the send state of message is failed, then return true.
       
   189      * @return int The sending state 
       
   190      */
       
   191     int sendingState();
       
   192     
       
   193 signals:
       
   194     /**
       
   195      * Signal emitted after fetching message body.
       
   196      * @param msgBody Message body content.
       
   197      */
       
   198     void msgBody(QString msgBody);
       
   199 
       
   200 private:
       
   201 
       
   202     /**
       
   203      * Pointer to S60 class UniViewerFeederPrivate.
       
   204      * Own.
       
   205      */
       
   206     UniViewerFeederPrivate *d_ptr;
       
   207 
       
   208 };
       
   209 
       
   210 #endif // UNIVIEWER_FEEDER_H
       
   211 // EOF