mmstransport.h

来自「Symbian OS C++ for Mobile Phones v3 Exam」· C头文件 代码 · 共 65 行

H
65
字号
// Copyright (c) 2004 - 2007, Symbian Software Ltd. All rights reserved.

/**
	Sends multimedia messages using the MTM directly.
 */

#ifndef MMSTRANSPORT_H
#define MMSTRANSPORT_H

#include <bautils.h>
#include <msvapi.h>
#include <mtclreg.h>
#include <mmsclient.h>
#include <cmsvmimeheaders.h>

#include "mmsutils.h"
#include "messagetransport.h"


class CMmsTransport : public CMessageTransport
/**
	Sends multimedia messages to a remote device using the
	MMS MTM so can set the root SMIL document, and so control
	the message's presentation.
 */
	{
public:
	static CMmsTransport* NewL(TAny* aTransportCreateInfo);
	virtual ~CMmsTransport();
	
private:
	static CMmsTransport* New2L(MTransportObserver& aObserver, const TDesC& aAddress, TBool aInitListen);
	CMmsTransport(MTransportObserver& aObserver);
	void ConstructL(const TDesC& aAddress, TBool aInitListen);
	void DestroySendOperation();
	
	// override CMessageTransport
	virtual void DoCancel();
	// override CTransport
	virtual void RunL();
	
	// implement CMessageTransport
	virtual void BuildAndSendMessageL(const TDesC& aPayloadText);
	virtual TBool ShouldUseReceivedMtmUid(TUid aMtmUid) const;
	virtual HBufC* ExtractPlainTextLC(CMsvStore& aStore) const;
	
	void AddTextAttachmentL(CMsvStore& aStore, const TDesC& aText, const TDesC& aContentLocation);
	TMsvAttachmentId AddFileAttachmentL(CMsvStore& aStore, const TDesC& aNameAndExt, const TDesC8& aMimeType);
	TMsvAttachmentId AddFileAttachmentL(
		CMsvStore& aStore, RFile& aFile, const TDesC& aContentLocation, const TDesC8& aMimeType);
	
private:
	/** File server session, used for managing attachments. */
	RFs iFs;
	/** The MTM registry is used to obtain an instance of the MMS MTM. */
	CClientMtmRegistry* iClientMtmRegistry;
	/** The Client MTM, used to construct and send the message. */
	CMmsClientMtm* iMmsClientMtm;
	/** This object manages the asynchronous sending operation. */
	CMsvOperation* iSendOperation;
	};

#endif	// #ifndef MMSTRANSPORT_H

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?