messagingappbase/smsmtm/servermtm/inc/SMSRecipientSend.h
changeset 23 238255e8b033
equal deleted inserted replaced
5:4697dfb2d7ad 23:238255e8b033
       
     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 SMS_RECIPIENT_SEND_H_
       
    17 #define SMS_RECIPIENT_SEND_H_
       
    18 
       
    19 #include <msvstd.h>
       
    20 #include <es_sock.h>
       
    21 #include <biodb.h>
       
    22 #include <es_wsms.h>
       
    23 
       
    24 #include "smssactive.h"
       
    25 
       
    26 class CSmsMessage;
       
    27 class TSmsProgress;
       
    28 class CSmsEventLogger;
       
    29 class CSmsHeader;
       
    30 
       
    31 class CSmsRecipientSend : public CSmssActive
       
    32 /**
       
    33 @internalComponent
       
    34 @released
       
    35 */
       
    36 	{
       
    37 public:
       
    38 	enum TSmsRecipientSendState
       
    39 		{
       
    40 		ESmsRecipientSendWaiting,
       
    41 		ESmsRecipientSendGetLogEvent,
       
    42 		ESmsRecipientSendAddLogEvent,
       
    43 		ESmsRecipientSendChangeLogEvent,
       
    44 		ESmsRecipientSendSendingMessage
       
    45 		};
       
    46 
       
    47 public:
       
    48 	~CSmsRecipientSend();
       
    49 	void Start(TRequestStatus& aStatus, const TMsvEntry& aEntry, CSmsHeader& aHeader, CSmsNumber& aRcpt);
       
    50 	virtual TBool AcceptMessage(const TMsvEntry& aEntry, const CSmsHeader& aHeader) const = 0;
       
    51 
       
    52 protected:
       
    53 	CSmsRecipientSend(TSmsProgress& aProgress, RFs& aFs, CMsvServerEntry& aServerEntry);
       
    54 	
       
    55 protected:
       
    56 	void ConstructL();
       
    57 	virtual TBool AcceptBioMsgId(const TBioMsgId& aBiomsgId) const = 0;
       
    58 	TInt AcceptBioType(TInt aBioType, TBioMsgIdType aBearer) const;
       
    59 	void GetDefaultSendBearerL(TInt aBioType, TBioMsgIdType aBearer, TBioMsgId& rBioMsgId) const;
       
    60 
       
    61 	void GetLogEvent();
       
    62 	void AddLogEvent();
       
    63 
       
    64 private:
       
    65 	void DoRunL();
       
    66 	void DoComplete(TInt& aStatus);
       
    67 	void DoSmssCancel();
       
    68 
       
    69 	virtual void SendMessageL() = 0;
       
    70 	virtual void StartL() = 0;
       
    71 	virtual void DoCancelSendingMessage()=0;
       
    72 
       
    73 	void ChangeLogEvent();
       
    74 
       
    75 protected:
       
    76 
       
    77 	TSmsProgress& iProgress;
       
    78 	TSmsRecipientSendState iState;
       
    79 	TPckgBuf<TUint> iSendBuffer;
       
    80 
       
    81 	CSmsHeader* iHeader;
       
    82 	CSmsNumber* iRecipient;
       
    83 	TMsvEntry	iEntry;
       
    84 
       
    85 	RSocketServ iSession;
       
    86 	RSocket iSocket;
       
    87 
       
    88 private:
       
    89 	CSmsEventLogger* iLogger;
       
    90 	};
       
    91 
       
    92 class CTextRecipientSend : public CSmsRecipientSend
       
    93 /**
       
    94 @internalComponent
       
    95 @released
       
    96 */
       
    97 	{
       
    98 public:
       
    99 	static CTextRecipientSend* NewL(TSmsProgress& aProgress, RFs& aFs, CMsvServerEntry& aServerEntry);
       
   100 	~CTextRecipientSend();
       
   101 
       
   102 private:
       
   103 
       
   104 	CTextRecipientSend(TSmsProgress& aProgress, RFs& aFs, CMsvServerEntry& aServerEntry);
       
   105 	TBool AcceptMessage(const TMsvEntry& aEntry, const CSmsHeader& aHeader) const;
       
   106 	TBool AcceptBioMsgId(const TBioMsgId& aBiomsgId) const;
       
   107 
       
   108 	void SendMessageL();
       
   109 	void StartL();
       
   110 	void DoCancelSendingMessage();
       
   111 
       
   112 	void PrependNbsStringL(const TMsvEntry& aEntry, CSmsMessage& arMessage, HBufC*& rOldMessage);
       
   113 	void RevertBackToOldMessageL(const TDesC& aOldMessage, CSmsMessage& arMessage);
       
   114 	};
       
   115 
       
   116 class CWapRecipientSend : public CSmsRecipientSend
       
   117 /**
       
   118 @internalComponent
       
   119 @released
       
   120 */
       
   121 	{
       
   122 public:
       
   123 	static CWapRecipientSend* NewL(TSmsProgress& aProgress, RFs& aFs, CMsvServerEntry& aServerEntry);
       
   124 	~CWapRecipientSend();
       
   125 
       
   126 private:
       
   127 	CWapRecipientSend(TSmsProgress& aProgress, RFs& aFs, CMsvServerEntry& aServerEntry);
       
   128 	TBool AcceptMessage(const TMsvEntry& aEntry, const CSmsHeader& aHeader) const;
       
   129 	TBool AcceptBioMsgId(const TBioMsgId& aBiomsgId) const;
       
   130 
       
   131 	void SendMessageL();
       
   132 	void StartL();
       
   133 	void DoCancelSendingMessage();
       
   134 
       
   135 private:
       
   136 	HBufC8* iMessage8;
       
   137 	TWapAddr iWapAddr;
       
   138 	};
       
   139 
       
   140 #endif