messagingappbase/smsmtm/servermtm/inc/SMSSOUTB.H
changeset 25 84d9eb65b26f
parent 23 238255e8b033
child 27 e4592d119491
child 37 518b245aa84c
child 79 2981cb3aa489
equal deleted inserted replaced
23:238255e8b033 25:84d9eb65b26f
     1 // Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __SMSSOUTB_H__
       
    17 #define __SMSSOUTB_H__
       
    18 
       
    19 #include <e32base.h>
       
    20 
       
    21 #include <msventry.h>
       
    22 #include <msvsenderroraction.h>
       
    23 #include <smutset.h>
       
    24 #include <msvschedulepackage.h>
       
    25 #include "smssactive.h"
       
    26 
       
    27 #if (defined SYMBIAN_USER_PROMPT_SERVICE)
       
    28 #include <ups/upsclient.h>
       
    29 using namespace UserPromptService;
       
    30 #endif
       
    31 
       
    32 class CParaFormatLayer;
       
    33 class CCharFormatLayer;
       
    34 class CSmsSendSession;
       
    35 class CMsvScheduleSend;
       
    36 class CSmsEventLogger;
       
    37 class CSmsEditorBuffer;
       
    38 
       
    39 class CSmsOutboxSend : public CSmssActive
       
    40 /**
       
    41 @internalComponent
       
    42 @released
       
    43 */
       
    44 	{
       
    45 public:
       
    46 	enum TSmsOutboxSendState
       
    47 		{
       
    48 		ESmsOutboxSendStateWaiting,
       
    49 		ESmsOutboxSendStateFindingOtherMessages,
       
    50 		ESmsOutboxSendStateSending,
       
    51 		ESmsOutboxSendStateReScheduling,
       
    52 		ESmsOutboxSendStateAddLogEvent,
       
    53 		ESmsOutboxSendStateGetLogEvent,
       
    54 		ESmsOutboxSendStateChangeLogEvent,
       
    55 		ESmsOutboxSendStateLogEntryComplete,
       
    56 		ESmsOutboxSendStateMovingEntry,
       
    57 		ESmsOutboxSendStateComplete,
       
    58 		ESmsOutboxSendAuthoriseState
       
    59 		};
       
    60 
       
    61 public:
       
    62 	static CSmsOutboxSend* NewL(CMsvServerEntry& aServerEntry, CMsvScheduleSend& aScheduleSend, RFs& aFs);
       
    63 	~CSmsOutboxSend();
       
    64 
       
    65 	const TSmsProgress& Progress(); 
       
    66 	
       
    67 #if (defined SYMBIAN_USER_PROMPT_SERVICE)	
       
    68 	void StartL(TRequestStatus& aStatus,const CMsvEntrySelection& aSelection, const TBool aMove, const TDesC8& aParameter, TThreadId aClientThreadId, TBool aHasCapability);
       
    69 #endif	
       
    70 
       
    71 	void Start(TRequestStatus& aStatus,const CMsvEntrySelection& aSelection, const TBool aMove, const TDesC8& aParameter);
       
    72 	
       
    73 protected:
       
    74 	void DoSmssCancel();
       
    75 
       
    76 private:
       
    77 	void DoRunL();	
       
    78 
       
    79 private:
       
    80 	CSmsOutboxSend(CMsvServerEntry& aServerEntry, CMsvScheduleSend& aScheduleSend, RFs& aFs);
       
    81 	void ConstructL();
       
    82 	void SendNextHeaderL();
       
    83 	void DoComplete(TInt& aStatus); //from CSmssActive
       
    84 	void FindOtherMessagesL(const CMsvEntrySelection& aSelection);
       
    85 
       
    86 	void MoveEntryL();
       
    87 	void LogEntry();
       
    88 	void ReScheduleFailedMessageL();
       
    89 	void DoReScheduleL(const TMsvSendErrorAction* aErrorAction = NULL);
       
    90 
       
    91 	TBool ConditionsRightForSending(TMsvSendErrorAction& rErrorAction);
       
    92 
       
    93 // Logging Functions
       
    94 	void GetLogEvent(TLogId aId);
       
    95 	void AddLogEvent();
       
    96 	void ChangeLogEvent();
       
    97 
       
    98 	TBool MessageSent() const;
       
    99 	TBool CanLogRecipient(const CSmsNumber& aNumber) const;
       
   100 	TInt GetLogStatus() const;
       
   101 
       
   102 	void FailOutstandingMessages(TInt aError, TInt aSendingState);
       
   103 	void SendHeader();
       
   104 private:
       
   105 	TSmsProgress 		iProgress;
       
   106 
       
   107 	CMsvEntrySelection* iMsvEntrySelection;
       
   108 	CSmsSendSession* 	iSendSession;
       
   109 	CSmsEventLogger* 	iLogger;
       
   110 
       
   111 	CRichText* 			iRichText;
       
   112 	CParaFormatLayer* 	iParaLayer;
       
   113 	CCharFormatLayer* 	iCharLayer;
       
   114 	CSmsEditorBuffer* 	iText;
       
   115 	CSmsHeader* 		iSmsHeader;
       
   116 
       
   117 	CMsvScheduleSend& 	iScheduleSend;
       
   118 
       
   119 	TMsvSchedulePackage iPackage;
       
   120 	TMsvEntry 			iEntry;
       
   121 	TMsvId 				iCurrentMessage;
       
   122 	TBool 				iMove;
       
   123 	TBool 				iSentFolderExists;
       
   124 	TTime 				iStartTime;
       
   125 	TBool 				iCondMet;
       
   126 	TInt 				iErr;
       
   127 		
       
   128 #if (defined SYMBIAN_USER_PROMPT_SERVICE)
       
   129 	/** For Interaction with UPS server */
       
   130 	RUpsSession 		iUpsSession;
       
   131 	RUpsSubsession 		iUpsSubsession;
       
   132 	TBool 			iHasCapability;
       
   133 	TUpsDecision 		iDecision;
       
   134 #endif	
       
   135 	};
       
   136 
       
   137 #endif	// __SMSSOUTB_H__