messagingapp/msgnotifications/msgnotifier/inc/msgnotifier.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Fri, 11 Jun 2010 13:35:48 +0300
changeset 34 84197e66a4bd
parent 31 ebfee66fde93
child 47 5b14749788d7
child 70 a15d9966050f
permissions -rw-r--r--
Revision: 201021 Kit: 2010123

/*
 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
 * which accompanies this distribution, and is available
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
 *
 * Initial Contributors:
 * Nokia Corporation - initial contribution.
 *
 * Contributors:
 *
 * Description: Message notifier main class. 
 *  Handles calling notifications and inidcations.
 *
 */

#ifndef MSGNOTIFIER_H
#define MSGNOTIFIER_H

// SYSTEM INCLUDES
#include <QObject>
#include <QString>
#include <QQueue>
#include "msginfodefs.h"

// CLASS DECLARATION
class MsgNotifierPrivate;
class MsgSimNumDetector;

/**
 * Stores the data required for notification.
 * Its used to pass information from
 * private class to qt - class.
 */
class NotificationData
{
public:
    /**
     * constrcutor
     */
    NotificationData() :
        mConversationId(-1), mMsgType(-1)
    {
    }
    
    /**
     * Conversation id
     */
    int mConversationId;

    /**
     * Message type
     */
    int mMsgType;

    /**
     * Description
     */
    QString mDescription;
    
    /**
     * Display name
     */
    QString mDisplayName;
    
    /**
     * Contact Number
     */
    QString mContactNum;
 
    /**
     * MsvEntry Id
     */
   int msvEntryId;
    };


class MsgNotifier: public QObject
{
Q_OBJECT

public:
    /**
     * Constructor
     */
    MsgNotifier(QObject* parent = 0);

    /**
     * Destructor
     */
    ~MsgNotifier();

public:
    /**
     * displayNewMessageNotification
     * Calls the notificaiton display frame work
     * for displaying the new message notification.
     */
    void displayNewMessageNotification(NotificationData& data);

    /**
     * updateUnreadIndications
     * Activate/Deactivate message indications based on unread message count.
     * if unreadCount is zero then deactivate else activate.
     * @param unreadCount unread count.
     */
    void updateUnreadIndications(int unreadCount);

    /**
     * updateOutboxIndications
     * Activate/Deactivate message indications based on outbox 
     * message count.
     * @param indicatorData The indicator data for displaying the indication.
     */
    void updateOutboxIndications(MsgInfo& indicatorData);

private:
    
    /**
     * Get display-name of a contact from VCard.
     * @param filePath, VCard file-path
     * @return display-name
     */
    QString getVcardDisplayName(const QString& filePath);
    
private:

    /**
     * Object of private implementation.
     * Owned.
     */
    MsgNotifierPrivate* d_ptr;

    /**
     * Sim settings handler
     */
    MsgSimNumDetector* mSimHandler;
};

#endif // MSGNOTIFIER_H
//EOF