⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mtmsengine.h

📁 symbian 3nd 实现短信息收发
💻 H
字号:
/*
* ============================================================================
*  Name     : CMtmsEngine from MtmsEngine.h
*  Part of  : SMSExample
*  Created  : 12.03.2005 by Forum Nokia
*  Description:
*     SMS engine handles SMS message creation, validation, sending and SMS
*     message handling (i.e moving, deleting, copying, retreiving message data).
*  Version  : 1.0
*  Modify:
*	  2007-11-18 Add 2 functions by tommy
*  Copyright: Nokia Corporation
* ============================================================================
*/

#ifndef MTMS_ENGINE
#define MTMS_ENGINE

// INCLUDES 
#include <e32base.h> // CBase
#include <msvapi.h>  // MMsvSessionObserver
#include <badesca.h> // CDesCArrayFlat

// FORWARD DECLARATIONS
class CClientMtmRegistry;
class CSmsClientMtm;
class MMtmsEngineObserver;

// CLASS DECLARATION

/**
*  SMS engine.
*/
class CMtmsEngine : public CActive, public MMsvSessionObserver
{
public:
	static CMtmsEngine* NewL(MMtmsEngineObserver& aObserver);
	~CMtmsEngine();
public:
	void	MoveToFolderL(TInt aIndex, TMsvId aFolder);
	void	DeleteMessageL(TInt nCurrent);
	void	GetMessageInfo(TInt aIndex, TDes& aDate);
	void	SendSMSL();
	TMsvId 	CreateSMSMessageL(const TDesC& aAddress, const TDesC& aMessage);
	TBool	ValidateCreatedSMS();

	void	CopyMessageL( TMsvId aMessageId, TMsvId aFolder );
	void	GetMessageAddressL( TMsvId aMessageId, TDes& aAddress );
	TBool	GetMessageL( TMsvId aMessageId, TDes& aMessage );
	TBool	GetMessageIndexBodyTextL( TMsvId aMessageId, TDes& aMessage );
	void	GetFolderSMSMessageInformation(TMsvId aFolderID, CDesCArrayFlat*& aIsRead, CDesCArrayFlat*& aMobile, CDesCArrayFlat*& aMessage);	
	RArray<TMsvId>* GetMessageIds();

private:
	void	DeleteMessageL(TMsvId aMessageId );
public:
	void	MoveToFolderL( TMsvId aMessageId,  TMsvId aFolder );
/**
* A constructor.
* @param aObserver Observer of this engine.
	*/
	CMtmsEngine(MMtmsEngineObserver& aObserver);
	
	/**
	* ConstructL()
	*/
	void ConstructL();
	
	/**
	* Creates SMS client.
	*/
	void CreateMtmClientL();
	
private: // from CActive
	virtual void DoCancel();
	virtual void RunL();
	
	
private: // from MMsvSessionObserver
	void HandleSessionEventL(TMsvSessionEvent aEvent, TAny* aArg1, TAny* aArg2, TAny* aArg3);
	
private:
	
	// SMS client MTM interface
	CSmsClientMtm*      iSmsMtm;
	
	// Observer of this engine.
	MMtmsEngineObserver& iObserver;
	
	// Controls asynchronous commands in the messaging system
	// Get progress information about the sending.
	CMsvOperation*      iMsvOper;
	
	// Encapsulates an array of entry IDs.
	CMsvEntrySelection* iEntrySelection;
	
	// Represents a session to the messaging server
	CMsvSession*        iSession;   
	
	// This registry holds details of the all the Client-side 
	// MTMs currently available on the system. 
	CClientMtmRegistry* iClientMtmReg;
	
	// Array of ids
	RArray<TMsvId>*     iIdArray;
	
	// Id of an SMS message
	TMsvId              iSmsId;
};
	
	/**
	*  CMtmsEngine SMS engine observer.
	*/
class MMtmsEngineObserver
{
public:
    virtual void HandleMessageSentL(TInt aError) = 0;
};
	
	
#endif  // MTMS_ENGINE
	

⌨️ 快捷键说明

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