messagingapp/msgui/unifiedviewer/inc/univiewerfeeder.h
changeset 31 ebfee66fde93
child 34 84197e66a4bd
equal deleted inserted replaced
30:6a20128ce557 31:ebfee66fde93
       
     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 
       
   130     ConvergedMessageAddressList toAddressList();
       
   131 
       
   132     /**
       
   133      * ccAddressList
       
   134      * @return list of cc address list
       
   135      */
       
   136 
       
   137     ConvergedMessageAddressList ccAddressList();
       
   138 
       
   139     /**
       
   140      * messageSize
       
   141      * @return int 
       
   142      */
       
   143     int messageSize();
       
   144 
       
   145     /**
       
   146      * clearContent
       
   147      * @void
       
   148      */
       
   149     void clearContent();
       
   150 
       
   151     /**
       
   152      * get the from address and alias of a message
       
   153      * @param from address
       
   154      * @param alias
       
   155      * @void 
       
   156      */
       
   157     void fromAddressAndAlias(QString& from, QString& alias);
       
   158     
       
   159     /**
       
   160      * whether the message is incoming Or outgoing.
       
   161      * @return bool
       
   162      */
       
   163     bool isIncoming();
       
   164     
       
   165     /**
       
   166      * returns the priority of the message.
       
   167      * @return int
       
   168      */
       
   169     int priority();
       
   170     
       
   171     /**
       
   172      * gets the subject of the message
       
   173      * @return QString
       
   174      */
       
   175     QString subject();
       
   176 
       
   177     /**
       
   178      * if the send state of message is failed, then return true.
       
   179      * @return int The sending state 
       
   180      */
       
   181     int sendingState();
       
   182     
       
   183 signals:
       
   184     /**
       
   185      * Signal emitted after fetching message body.
       
   186      * @param msgBody Message body content.
       
   187      */
       
   188     void msgBody(QString msgBody);
       
   189 
       
   190 private:
       
   191 
       
   192     /**
       
   193      * Pointer to S60 class UniViewerFeederPrivate.
       
   194      * Own.
       
   195      */
       
   196     UniViewerFeederPrivate *d_ptr;
       
   197 
       
   198 };
       
   199 
       
   200 #endif // UNIVIEWER_FEEDER_H
       
   201 // EOF