messagingapp/msgnotifications/msgnotifier/inc/msgnotifier.h
changeset 31 ebfee66fde93
child 47 5b14749788d7
child 70 a15d9966050f
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: Message notifier main class. 
       
    15  *  Handles calling notifications and inidcations.
       
    16  *
       
    17  */
       
    18 
       
    19 #ifndef MSGNOTIFIER_H
       
    20 #define MSGNOTIFIER_H
       
    21 
       
    22 // SYSTEM INCLUDES
       
    23 #include <QObject>
       
    24 #include <QString>
       
    25 #include <QQueue>
       
    26 #include "msginfodefs.h"
       
    27 
       
    28 // CLASS DECLARATION
       
    29 class MsgNotifierPrivate;
       
    30 class MsgSimNumDetector;
       
    31 
       
    32 /**
       
    33  * Stores the data required for notification.
       
    34  * Its used to pass information from
       
    35  * private class to qt - class.
       
    36  */
       
    37 class NotificationData
       
    38 {
       
    39 public:
       
    40     /**
       
    41      * constrcutor
       
    42      */
       
    43     NotificationData() :
       
    44         mConversationId(-1), mMsgType(-1)
       
    45     {
       
    46     }
       
    47     
       
    48     /**
       
    49      * Conversation id
       
    50      */
       
    51     int mConversationId;
       
    52 
       
    53     /**
       
    54      * Message type
       
    55      */
       
    56     int mMsgType;
       
    57 
       
    58     /**
       
    59      * Description
       
    60      */
       
    61     QString mDescription;
       
    62     
       
    63     /**
       
    64      * Display name
       
    65      */
       
    66     QString mDisplayName;
       
    67     
       
    68     /**
       
    69      * Contact Number
       
    70      */
       
    71     QString mContactNum;
       
    72  
       
    73     /**
       
    74      * MsvEntry Id
       
    75      */
       
    76    int msvEntryId;
       
    77     };
       
    78 
       
    79 
       
    80 class MsgNotifier: public QObject
       
    81 {
       
    82 Q_OBJECT
       
    83 
       
    84 public:
       
    85     /**
       
    86      * Constructor
       
    87      */
       
    88     MsgNotifier(QObject* parent = 0);
       
    89 
       
    90     /**
       
    91      * Destructor
       
    92      */
       
    93     ~MsgNotifier();
       
    94 
       
    95 public:
       
    96     /**
       
    97      * displayNewMessageNotification
       
    98      * Calls the notificaiton display frame work
       
    99      * for displaying the new message notification.
       
   100      */
       
   101     void displayNewMessageNotification(NotificationData& data);
       
   102 
       
   103     /**
       
   104      * updateUnreadIndications
       
   105      * Activate/Deactivate message indications based on unread message count.
       
   106      * if unreadCount is zero then deactivate else activate.
       
   107      * @param unreadCount unread count.
       
   108      */
       
   109     void updateUnreadIndications(int unreadCount);
       
   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     
       
   128 private:
       
   129 
       
   130     /**
       
   131      * Object of private implementation.
       
   132      * Owned.
       
   133      */
       
   134     MsgNotifierPrivate* d_ptr;
       
   135 
       
   136     /**
       
   137      * Sim settings handler
       
   138      */
       
   139     MsgSimNumDetector* mSimHandler;
       
   140 };
       
   141 
       
   142 #endif // MSGNOTIFIER_H
       
   143 //EOF