messagingapp/msgnotifications/msgnotifier/inc/msgnotifier.h
changeset 25 84d9eb65b26f
parent 23 238255e8b033
child 47 5b14749788d7
child 56 f42d9a78f435
equal deleted inserted replaced
23:238255e8b033 25:84d9eb65b26f
    21 
    21 
    22 // SYSTEM INCLUDES
    22 // SYSTEM INCLUDES
    23 #include <QObject>
    23 #include <QObject>
    24 #include <QString>
    24 #include <QString>
    25 #include <QQueue>
    25 #include <QQueue>
       
    26 #include "msginfodefs.h"
    26 
    27 
    27 // CLASS DECLARATION
    28 // CLASS DECLARATION
    28 class MsgNotifierPrivate;
    29 class MsgNotifierPrivate;
    29 class MsgSimNumDetector;
    30 class MsgSimNumDetector;
    30 
    31 
    32  * Stores the data required for notification.
    33  * Stores the data required for notification.
    33  * Its used to pass information from
    34  * Its used to pass information from
    34  * private class to qt - class.
    35  * private class to qt - class.
    35  */
    36  */
    36 class NotificationData
    37 class NotificationData
    37     {
    38 {
    38 public:
    39 public:
    39     /**
    40     /**
    40      * constrcutor
    41      * constrcutor
    41      */
    42      */
    42     NotificationData():
    43     NotificationData() :
    43     mConversationId(-1),mMsgType(-1)
    44         mConversationId(-1), mMsgType(-1)
    44         {};
    45     {
       
    46     }
       
    47     
    45     /**
    48     /**
    46      * Conversation id
    49      * Conversation id
    47      */
    50      */
    48     int mConversationId;
    51     int mConversationId;
    49     
    52 
    50     /**
    53     /**
    51      * Message type
    54      * Message type
    52      */
    55      */
    53     int mMsgType;
    56     int mMsgType;
    54     
    57 
    55     /**
    58     /**
    56      * Description
    59      * Description
    57      */
    60      */
    58     QString mDescription;
    61     QString mDescription;
    59     
    62     
    60     /**
    63     /**
    61      * First name
    64      * Display name
    62      */
    65      */
    63     QString mFirstName;
    66     QString mDisplayName;
    64     
       
    65     /**
       
    66      * Last name
       
    67      */
       
    68     QString mLastName;
       
    69     
    67     
    70     /**
    68     /**
    71      * Contact Number
    69      * Contact Number
    72      */
    70      */
    73     QString mContactNum;
    71     QString mContactNum;
    74  
    72  
       
    73     /**
       
    74      * MsvEntry Id
       
    75      */
       
    76    int msvEntryId;
    75     };
    77     };
    76 
    78 
    77 
    79 
    78 class MsgNotifier : public QObject
    80 class MsgNotifier: public QObject
    79     {
    81 {
    80     Q_OBJECT
    82 Q_OBJECT
    81 
    83 
    82 public:
    84 public:
    83     /**
    85     /**
    84      * Constructor
    86      * Constructor
    85      */
    87      */
    96      * Calls the notificaiton display frame work
    98      * Calls the notificaiton display frame work
    97      * for displaying the new message notification.
    99      * for displaying the new message notification.
    98      */
   100      */
    99     void displayNewMessageNotification(NotificationData& data);
   101     void displayNewMessageNotification(NotificationData& data);
   100 
   102 
   101 
       
   102     /**
   103     /**
   103      * updateIndications
   104      * updateUnreadIndications
   104      * Activate/Deactivate message indications based on unread message count.
   105      * Activate/Deactivate message indications based on unread message count.
   105      * if unreadCount is zero then deactivate else activate.
   106      * if unreadCount is zero then deactivate else activate.
   106      * @param unreadCount unread count.
   107      * @param unreadCount unread count.
   107      */
   108      */
   108     void updateIndications(int unreadCount);
   109     void updateUnreadIndications(int unreadCount);
   109 
   110 
       
   111     /**
       
   112      * updateOutboxIndications
       
   113      * Activate/Deactivate message indications based on outbox 
       
   114      * message count.
       
   115      * @param indicatorData The indicator data for displaying the indication.
       
   116      */
       
   117     void updateOutboxIndications(MsgInfo& indicatorData);
       
   118 
       
   119 private:
       
   120     
       
   121     /**
       
   122      * Get display-name of a contact from VCard.
       
   123      * @param filePath, VCard file-path
       
   124      * @return display-name
       
   125      */
       
   126     QString getVcardDisplayName(const QString& filePath);
       
   127     
   110 private:
   128 private:
   111 
   129 
   112     /**
   130     /**
   113      * Object of private implementation.
   131      * Object of private implementation.
   114      * Owned.
   132      * Owned.
   115      */
   133      */
   116     MsgNotifierPrivate* d_ptr;  
   134     MsgNotifierPrivate* d_ptr;
   117     
   135 
   118     /**
   136     /**
   119      * Sim settings handler
   137      * Sim settings handler
   120      */
   138      */
   121     MsgSimNumDetector* mSimHandler;
   139     MsgSimNumDetector* mSimHandler;
   122 };
   140 };
   123 
   141 
   124 #endif // MSGNOTIFIER_H
   142 #endif // MSGNOTIFIER_H
   125 
       
   126 //EOF
   143 //EOF