messagingapp/msgnotifications/msgnotifier/inc/msgstorehandler.h
changeset 25 84d9eb65b26f
child 34 84197e66a4bd
equal deleted inserted replaced
23:238255e8b033 25:84d9eb65b26f
       
     1 /*
       
     2  * Copyright (c) 2008 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:  Wrapper classes which encapsulates Message store functions
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef MSG_STORE_HANDLER_H
       
    19 #define MSG_STORE_HANDLER_H
       
    20 
       
    21 // INCLUDE FILES
       
    22 #include <msvapi.h>
       
    23 #include <ccsdefs.h>
       
    24 #include <QString>
       
    25 
       
    26 //USER INCLUDES
       
    27 #include "msginfodefs.h"
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CMsvSession;
       
    31 class MMsvSessionObserver;
       
    32 class OutboxIndicatorData;
       
    33 class MsgNotifierPrivate;
       
    34 class CCSRequestHandler;
       
    35 class CMsvEntrySelection;
       
    36 
       
    37 // CONSTANTS
       
    38 
       
    39 /**
       
    40  * @class MsgStoreHandler
       
    41  * handles the Messaging store for outbox events.
       
    42  */
       
    43 class MsgStoreHandler: public MMsvSessionObserver, public MMsvEntryObserver
       
    44 {
       
    45 public:
       
    46 
       
    47     /**
       
    48      * Default constructor.
       
    49      */
       
    50     explicit MsgStoreHandler(MsgNotifierPrivate* notifier, CCSRequestHandler* aHandler);
       
    51 
       
    52     /**
       
    53      * Destructor
       
    54      */
       
    55     virtual ~MsgStoreHandler();
       
    56     
       
    57     /**
       
    58      * Get the number of entries in the outbox that are in the failed or resend state.
       
    59      * @param indicatorData, MsgInfo Return parameter.
       
    60      */
       
    61     TInt GetOutboxEntriesL(MsgInfo& aFailedIndicatorData, 
       
    62                            MsgInfo& aPendingIndicatorData);
       
    63 
       
    64     /*
       
    65      * Get unread message count.
       
    66      */
       
    67     int GetUnreadMessageCountL();
       
    68 
       
    69 public:
       
    70     /**
       
    71      * From MMsvSessionObserver. HandleSessionEventL.
       
    72      */
       
    73     void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
       
    74 
       
    75     /**
       
    76      * from MMsvEntryObserver, HandleEntryEventL
       
    77      */
       
    78     virtual void HandleEntryEventL(TMsvEntryEvent aEvent, TAny *aArg1, TAny *aArg2, TAny *aArg3);
       
    79 
       
    80 private:
       
    81 
       
    82     /**
       
    83      * UpdateOutboxIndications()
       
    84      * @
       
    85      */
       
    86      void UpdateOutboxIndications();
       
    87 
       
    88      /**
       
    89       * Initializes the MsgStoreHandler class.     
       
    90       */
       
    91      void InitL();
       
    92      
       
    93     /**
       
    94      * Process the indicator data to retrieve relevant details of the conversation
       
    95      * @param msgId, message id.
       
    96      * @param indicatorData data retrieved about the outbox entry
       
    97      * 
       
    98      */
       
    99     void ProcessIndicatorDataL(TMsvId msgId, MsgInfo& indicatorData);
       
   100     
       
   101     /**
       
   102      * Get MMS notification status.
       
   103      * @param aMsvId MMS notification status.
       
   104      */
       
   105     TCsMmsNotificationMsgState MmsNotificationStatus(TMsvEntry entry);
       
   106 
       
   107     /**
       
   108      * verifys the current operation status
       
   109      *@param aEntry, TMsvEntry
       
   110      */
       
   111     TBool OperationFinished(const TMsvEntry& aEntry) const;
       
   112 
       
   113     /**
       
   114      * verifys the current operation status
       
   115      * @param aEntry, TMsvEntry
       
   116      */
       
   117     TBool OperationOngoing(const TMsvEntry& aEntry) const;
       
   118 
       
   119 private:
       
   120     /**
       
   121      * Own. Msv Session
       
   122      */
       
   123     CMsvSession* iMsvSession;
       
   124 
       
   125     /**
       
   126      * Own. Msv Entry
       
   127      */
       
   128     CMsvEntry* iMsvEntry;
       
   129 
       
   130     /**
       
   131      * Not Owned. Message notifier.
       
   132      */
       
   133     MsgNotifierPrivate* iNotifier;
       
   134 
       
   135     /**
       
   136      * Not Owned. Request handler
       
   137      */
       
   138     CCSRequestHandler* iRequestHandler;
       
   139     
       
   140     /**
       
   141      * List of messages in Fialed states
       
   142      */
       
   143     CMsvEntrySelection* iFailedMessages;
       
   144     
       
   145     /**
       
   146      * List of messages for which failed note shown
       
   147      */
       
   148     CMsvEntrySelection* iFailedNotes;
       
   149 };
       
   150 
       
   151 #endif // MSG_STORE_HANDLER_H
       
   152 // EOF