messagingapp/msgnotifications/msgnotifier/inc/msgstorehandler.h
branchRCL_3
changeset 57 ebe688cedc25
equal deleted inserted replaced
54:fa1df4b99609 57:ebe688cedc25
       
     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 #include <platform/ssm/ssmstateawaresession.h>
       
    26 
       
    27 //USER INCLUDES
       
    28 #include "msginfodefs.h"
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CMsvSession;
       
    32 class MMsvSessionObserver;
       
    33 class OutboxIndicatorData;
       
    34 class MsgNotifierPrivate;
       
    35 class CCSRequestHandler;
       
    36 class CMsvEntrySelection;
       
    37 
       
    38 // CONSTANTS
       
    39 
       
    40 /**
       
    41  * @class MsgStoreHandler
       
    42  * handles the Messaging store for outbox events.
       
    43  */
       
    44 class MsgStoreHandler: public CActive, public MMsvSessionObserver, public MMsvEntryObserver
       
    45 {
       
    46 public:
       
    47 
       
    48     /**
       
    49      * Default constructor.
       
    50      */
       
    51     explicit MsgStoreHandler(MsgNotifierPrivate* notifier, CCSRequestHandler* aHandler);
       
    52 
       
    53     /**
       
    54      * Destructor
       
    55      */
       
    56     virtual ~MsgStoreHandler();
       
    57     
       
    58     /**
       
    59      * Get the number of entries in the outbox that are in the failed or resend state.
       
    60      * @param indicatorData, MsgInfo Return parameter.
       
    61      */
       
    62     TInt GetOutboxEntriesL(MsgInfo& aFailedIndicatorData, 
       
    63                            MsgInfo& aPendingIndicatorData);
       
    64 
       
    65     /*
       
    66      * Get unread message count.
       
    67      */
       
    68     int GetUnreadMessageCountL();
       
    69 
       
    70 public:
       
    71     /**
       
    72      * From MMsvSessionObserver. HandleSessionEventL.
       
    73      */
       
    74     void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
       
    75 
       
    76     /**
       
    77      * from MMsvEntryObserver, HandleEntryEventL
       
    78      */
       
    79     virtual void HandleEntryEventL(TMsvEntryEvent aEvent, TAny *aArg1, TAny *aArg2, TAny *aArg3);
       
    80 
       
    81 private:
       
    82 
       
    83     /**
       
    84      * UpdateOutboxIndications()
       
    85      * @
       
    86      */
       
    87      void UpdateOutboxIndications();
       
    88 
       
    89      /**
       
    90       * Initializes the MsgStoreHandler class.     
       
    91       */
       
    92      void InitL();
       
    93      
       
    94     /**
       
    95      * Process the indicator data to retrieve relevant details of the conversation
       
    96      * @param msgId, message id.
       
    97      * @param indicatorData data retrieved about the outbox entry
       
    98      * 
       
    99      */
       
   100     void ProcessIndicatorDataL(TMsvId msgId, MsgInfo& indicatorData);
       
   101     
       
   102     /**
       
   103      * Get MMS notification status.
       
   104      * @param aMsvId MMS notification status.
       
   105      */
       
   106     TCsMmsNotificationMsgState MmsNotificationStatus(TMsvEntry entry);
       
   107 
       
   108     /**
       
   109      * verifys the current operation status
       
   110      *@param aEntry, TMsvEntry
       
   111      */
       
   112     TBool OperationFinished(const TMsvEntry& aEntry) const;
       
   113 
       
   114     /**
       
   115      * verifys the current operation status
       
   116      * @param aEntry, TMsvEntry
       
   117      */
       
   118     TBool OperationOngoing(const TMsvEntry& aEntry) const;
       
   119 
       
   120     /**
       
   121      * Process the class0 SMS and extract all the relevant information
       
   122      * @param aHeader, Class0 SMS header
       
   123      */
       
   124     void HandleClass0SmsL(CMsvEntry* aMsgEntry, TMsvId aMsgId);
       
   125 
       
   126 	/**
       
   127 	 * From CActive
       
   128 	 */
       
   129     void DoCancel();
       
   130     void RunL();
       
   131 
       
   132 private:
       
   133     /**
       
   134      * Own. Msv Session
       
   135      */
       
   136     CMsvSession* iMsvSession;
       
   137 
       
   138     /**
       
   139      * Own. Msv Entry
       
   140      */
       
   141     CMsvEntry* iMsvEntry;
       
   142 
       
   143     /**
       
   144      * Not Owned. Message notifier.
       
   145      */
       
   146     MsgNotifierPrivate* iNotifier;
       
   147 
       
   148     /**
       
   149      * Not Owned. Request handler
       
   150      */
       
   151     CCSRequestHandler* iRequestHandler;
       
   152     
       
   153     /**
       
   154      * List of messages in Fialed states
       
   155      */
       
   156     CMsvEntrySelection* iFailedMessages;   
       
   157     
       
   158     /**
       
   159      * Interface to receive notifications when the
       
   160      * System State changes.
       
   161      */
       
   162     RSsmStateAwareSession iStateAwareSession;   
       
   163 };
       
   164 
       
   165 #endif // MSG_STORE_HANDLER_H
       
   166 // EOF