messagingapp/msgui/appengine/inc/conversationmsgstorehandler.h
changeset 25 84d9eb65b26f
parent 23 238255e8b033
child 27 e4592d119491
child 37 518b245aa84c
equal deleted inserted replaced
23:238255e8b033 25:84d9eb65b26f
    19 #define CONVERSATION_MSG_STORE_HANDLER_H
    19 #define CONVERSATION_MSG_STORE_HANDLER_H
    20 
    20 
    21 // INCLUDE FILES
    21 // INCLUDE FILES
    22 #include <msvapi.h>
    22 #include <msvapi.h>
    23 #include <ccsdefs.h>
    23 #include <ccsdefs.h>
       
    24 #include <QString>
    24 
    25 
    25 // FORWARD DECLARATIONS
    26 // FORWARD DECLARATIONS
    26 class CMsvSession;
    27 class CMsvSession;
    27 class MMsvSessionObserver;
    28 class MMsvSessionObserver;
    28 class DraftsModel;
    29 class DraftsModel;
    29 
    30 class CClientMtmRegistry;
    30 // CONSTANTS
    31 class CMmsClientMtm;
       
    32 class CMmsNotificationClientMtm;
       
    33 
    31 
    34 
    32 class ConversationMsgStoreHandler: public MMsvSessionObserver
    35 class ConversationMsgStoreHandler: public MMsvSessionObserver
    33     {
    36     {
    34 public:
    37 public:
    35     
    38     
    82     /**
    85     /**
    83      * Delete specified messages from message store
    86      * Delete specified messages from message store
    84      * @param aIdArray Array of message ids.
    87      * @param aIdArray Array of message ids.
    85      */
    88      */
    86     void DeleteMessages(RArray<TInt>& aIdArray);
    89     void DeleteMessages(RArray<TInt>& aIdArray);
       
    90 
       
    91     /**
       
    92      * Delete all draft messages.
       
    93      */
       
    94     void DeleteAllDraftMessagesL();
       
    95 
       
    96     /**
       
    97      * Resend a specified message that has failed.
       
    98      * @param aId TMsvId of the failed message 
       
    99 	 * @return bool true if succeeded
       
   100      */
       
   101     bool ResendMessageL(TMsvId aId);
    87     
   102     
    88     /**
   103     /**
    89      * Returns the msv session object
   104      * Returns the msv session object
    90      * @return CMsvSession object
   105      * @return CMsvSession object
    91      */
   106      */
    94     /**
   109     /**
    95      * Start fetching all draft messages
   110      * Start fetching all draft messages
    96      */
   111      */
    97     void FetchDraftMessages(DraftsModel* draftsModel);
   112     void FetchDraftMessages(DraftsModel* draftsModel);
    98 
   113 
       
   114     /**
       
   115      * Mark message as read and get the message type.
       
   116      * @param messageId  message Id 
       
   117      * @param msgType message type is written to this.
       
   118      * @param msgType message sub type is written to this.
       
   119      */
       
   120     void markAsReadAndGetType(int msgId,
       
   121                               int& msgType,
       
   122                               int& msgSubType);
       
   123     
       
   124     /**
       
   125      * Extract the message type.
       
   126      * @param entry  message entry.
       
   127      * @param msgType message type is written to this.
       
   128      * @param msgType message sub type is written to this.
       
   129      */
       
   130     void extractMsgType(const TMsvEntry& entry,
       
   131                         int& msgType,
       
   132                         int& msgSubType);
       
   133     /**
       
   134      * Query if the download operation be performed for
       
   135      * a message notification entry
       
   136      * @param aId, message notification id
       
   137      * @return true if download operation is possible
       
   138      */
       
   139     bool DownloadOperationSupported(const TMsvId& aId);
       
   140     
       
   141 	
       
   142     /**
       
   143      * Sets content to messageId
       
   144      * @param messageId, Message Id content
       
   145      */
       
   146     void setNotificationMessageId(int messageId);
       
   147 
       
   148     /**
       
   149      * Seeker method for getting mms notification estimated msg size
       
   150      * @return Formatted string of msg size
       
   151      */
       
   152     QString NotificationMsgSize();
       
   153     
       
   154     /**
       
   155      * Seeker method for getting mms notification class type
       
   156      * @return Notification Class type string
       
   157      */
       
   158     QString NotificationClass();
       
   159     
       
   160     /**
       
   161      * Seeker method for message status and error string
       
   162      * mms notification's download state
       
   163      * @param [OUT] status, msg status
       
   164      * @param [OUT] statusStr, localized string of msg status
       
   165      */
       
   166     void NotificationStatus(int& status,
       
   167                      QString& statusStr);
       
   168     
       
   169     /**
       
   170      * Seeker method getting expiry info of a notification msg
       
   171      * @param [OUT] expiryTime, notification's expiry time
       
   172      * @param [OUT] expiryTimeQString, formatted string of
       
   173      * notification's expiry time
       
   174      */
       
   175     void NotificationExpiryDate(
       
   176             TTime& expiryTime,
       
   177             QString& expiryTimeStr);
       
   178 					 
       
   179     /**
       
   180      * Download a specified message
       
   181      * @param aId TMsvId of the message 
       
   182      * @return KErrNone if Download request is successful, 
       
   183      *         KErrNotFound if settings are not available,
       
   184      *         KErrGeneral for other cases
       
   185      */
       
   186     TInt DownloadMessageL(TMsvId aId);
       
   187 
    99 private:
   188 private:
   100 
   189 
   101     /**
   190     /**
   102      * verifys the current operation status
   191      * verifys the current operation status
   103      *@param aEntry, TMsvEntry
   192      *@param aEntry, TMsvEntry
   167 
   256 
   168     /**
   257     /**
   169      * State
   258      * State
   170      */
   259      */
   171     TDraftHandlerState iState;
   260     TDraftHandlerState iState;
   172     
   261     /**
       
   262      * Own. Mtm Registry
       
   263      */
       
   264     CClientMtmRegistry* iMtmReg;
       
   265 
       
   266     /**
       
   267      * MMS client mtm
       
   268      */
       
   269     CMmsClientMtm* iMmsClient;
       
   270 
       
   271     /**
       
   272      * Notification client mtm
       
   273      */
       
   274     CMmsNotificationClientMtm* iNotificationClient;
       
   275 	
       
   276 	TBool iOfflineSupported;	
   173     };
   277     };
   174 
   278 
   175 #endif // CONVERSATION_MSG_STORE_HANDLER_H
   279 #endif // CONVERSATION_MSG_STORE_HANDLER_H
   176 
   280 
   177 // EOF
   281 // EOF