亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? mtmsengine.cpp

?? symbian系統(tǒng)上的記事本程序
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
/*
* ============================================================================
*  Name     : CMtmsEngine from SMSExampleMtmsEngine.h
*  Part of  : SMSExample
*  Created  : 12.03.2005 by Forum Nokia
*  Version  : 1.0
*  Copyright: Nokia Corporation
* ============================================================================
*/

// INCLUDE FILES
#include "MtmsEngine.h"

// SYSTEM FILES
#include <f32file.h>        // TParsePtrC
#include <mmsclient.h>      // CMmsClientMtm
#include <mtclreg.h>        // CClientMtmRegistry 
#include <mtmdef.h>         // KMsvMessagePartBody 
#include <smsclnt.h>        // CSmsClientMtm
#include <smscmds.h>        // ESmsMtmCommandScheduleCopy
#include <smuthdr.h>        // CSmsHeader
#include <smutset.h>        // CSmsSettings
#include <txtrich.h>        // CRichText
#include <eikenv.h>
#include "common.h"
#include <aknnotewrappers.h>  
#include <EveryDay.rsg>
const TInt KMessageAddressLength 	= 32;
const TInt KMessageBodySize 		= 256;
const TInt KListInfoLength			= 512;

#define		MEMORY_FREE_EX(a) if(a) {delete a; a = NULL;}
// ----------------------------------------------------------------------------
// CMtmsEngine::NewL(MSMSExampleMtmsEngineObserver& aObserver)
//
// Symbian OS 2 phase constructor.
// ----------------------------------------------------------------------------
CMtmsEngine* CMtmsEngine::NewL(MMtmsEngineObserver& aObserver)
{
    CMtmsEngine* self = new (ELeave) CMtmsEngine(aObserver);
    CleanupStack::PushL(self);
    self->ConstructL();
    CleanupStack::Pop(self);
    return self;
}

// ----------------------------------------------------------------------------
// CMtmsEngine::CMtmsEngine(MSMSExampleMtmsEngineObserver& 
//												aObserver)
//
// Symbian OS 2 phase constructor.
// ----------------------------------------------------------------------------
CMtmsEngine::CMtmsEngine(MMtmsEngineObserver& aObserver)
: CActive(0),
iObserver(aObserver),
iIdArray(NULL),
iSmsId(KMsvNullIndexEntryId)
{
}

// ----------------------------------------------------------------------------
// CMtmsEngine::ConstructL()
//
// Symbian OS 2nd phase constructor.
// ----------------------------------------------------------------------------
void CMtmsEngine::ConstructL()
{
    CActiveScheduler::Add(this);
	
    // iEntrySelection encapsulates an array of entry IDs
    iEntrySelection = new (ELeave) CMsvEntrySelection;
	
    // Represents a channel of communication between a client thread (Client-side MTM, User
	// Interface MTM, or message client application) and the Message Server thread. 
	// Session is opened asynchorously. CreateMtmClientL() is called afterwards.
	// Another possibility is use OpenSyncL which is synchronous.
    iSession = CMsvSession::OpenAsyncL(*this);
}

// ----------------------------------------------------------------------------
// CMtmsEngine::CreateMtmClientL()
//
// Create a CSmsClientMtm after session has been opened.
// ----------------------------------------------------------------------------
void CMtmsEngine::CreateMtmClientL()
{
    // Client-side MTM registry. 
    iClientMtmReg = CClientMtmRegistry::NewL(*iSession);
	
    // Get the SMS Mtm client from the registry
    iSmsMtm = static_cast<CSmsClientMtm*>(iClientMtmReg->NewMtmL(KUidMsgTypeSMS));
	
}

// ----------------------------------------------------------------------------
// CMtmsEngine::~CMtmsEngine()
//
// Destructor.
// ----------------------------------------------------------------------------
CMtmsEngine::~CMtmsEngine()
{
    Cancel();
    delete iMsvOper;
    delete iEntrySelection;
    delete iSmsMtm;
    delete iClientMtmReg;
    delete iSession;
	if(iIdArray)
	{
		iIdArray->Reset();
		delete iIdArray;
	}
}

// ----------------------------------------------------------------------------
// CMtmsEngine::DoCancel()
//
// From CActive, cancel CMsvOperation 
// ----------------------------------------------------------------------------
void CMtmsEngine::DoCancel()
{
    if (iMsvOper)
	{
        iMsvOper->Cancel();
        delete iMsvOper;
        iMsvOper = NULL;
	}
}

// ----------------------------------------------------------------------------
// CMtmsEngine::RunL()
//
// Sending SMS is asynchronous operation.
// ----------------------------------------------------------------------------
void CMtmsEngine::RunL()
{
    iObserver.HandleMessageSentL(iStatus.Int());
}

// ----------------------------------------------------------------------------
// CMtmsEngine::CreateSMSMessageL(const TDesC& aAddress, 
//											const TDesC& aMessage)
//
// Create an SMS message
// ----------------------------------------------------------------------------
TMsvEntry CMtmsEngine::CreateSMSMessageL(const TDesC& aAddress, const TDesC& aMessage)
{
    // Set SMS parameters 
    TMsvEntry indexEntry;
	indexEntry.iDate.HomeTime();
    indexEntry.SetInPreparation(ETrue);
	// This is an SMS message
    indexEntry.iMtm = KUidMsgTypeSMS;
    indexEntry.iType = KUidMsvMessageEntry;
	//Gets the ID of the current SMS service.
    indexEntry.iServiceId = iSmsMtm->ServiceId();
    
    // Create entry to drafts
    iSmsMtm->SwitchCurrentEntryL(KMsvDraftEntryId);
	
	// Creates a new child entry owned by the context synchronously.
    iSmsMtm->Entry().CreateL(indexEntry);
	
    // Set the MTM's active context to the new message
    iSmsId = indexEntry.Id();
    iSmsMtm->SwitchCurrentEntryL(iSmsId);
	
	//modify by tommy
	CSmsHeader& header = iSmsMtm->SmsHeader();
    CSmsSettings* sendOptions = CSmsSettings::NewL();
    CleanupStack::PushL(sendOptions);
    sendOptions->CopyL(iSmsMtm->ServiceSettings()); // restore existing settings
    // set send options
    sendOptions->SetDelivery(ESmsDeliveryImmediately); // set to be delivered immediately
    // here we modified the character set
    sendOptions->SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabetUCS2) ; 
    // end 
    header.SetSmsSettingsL(*sendOptions);
	CleanupStack::PopAndDestroy(sendOptions);
	
    // Add message body. Body is set twice because index entry keeps a copy
	// of some summary information. Index entry and full stored entry
	// must be in sync.
    CRichText& body = iSmsMtm->Body();
    body.Reset();
    body.InsertL(0, aMessage);
    indexEntry.iDescription.Set(aMessage);
	
    // Add destination address (recipient). Copy address also to the index entry
    iSmsMtm->AddAddresseeL(aAddress);
    indexEntry.iDetails.Set(aAddress);
	
    // Commit changes because index entry is only a local variable
    iSmsMtm->Entry().ChangeL(indexEntry);
	
    // Save full message data to the store
    iSmsMtm->SaveMessageL();
	return indexEntry;
}

// ----------------------------------------------------------------------------
// CMtmsEngine::ValidateCreatedSMS()
//
// Validate message. This should be done before sending the SMS.
// ----------------------------------------------------------------------------
TBool CMtmsEngine::ValidateCreatedSMS()
{
    TMsvPartList partsToBeChecked = KMsvMessagePartBody | KMsvMessagePartRecipient |
        KMsvMessagePartOriginator | KMsvMessagePartDate;
	
	// ValidateMessage return KErrNone if message is valid.
    TMsvPartList failedParts = iSmsMtm->ValidateMessage(partsToBeChecked);
    
	if (failedParts == KMsvMessagePartNone)
	{
		return ETrue;
	}
	else 
	{
		return EFalse;
	}
}

// ----------------------------------------------------------------------------
// CMtmsEngine::SendSMSL()
//
// Before sending sms message should be created CreateSMSMessageL() and
// Validated ValidateCreatedSMS().
// ----------------------------------------------------------------------------
void CMtmsEngine::SendSMSL()
{
    // Changes the entry on which later actions are performed to the entry with the 
	// specified TMsvId. 
    iSmsMtm->SwitchCurrentEntryL(iSmsId);
	
    // Load the created message
    iSmsMtm->LoadMessageL();
	
    // Gets the current SMS service settings
    CSmsSettings& serviceSettings = iSmsMtm->ServiceSettings();
	
	// Gets the number of service centre addresses stored in this object.
    const TInt numSCAddresses = serviceSettings.NumSCAddresses();
    
	// There should always be a service center number
	if (numSCAddresses > 0)
	{
        CSmsNumber*	serviceCentreNumber = NULL;
		
        // get the service center number
        if ((serviceSettings.DefaultSC() >= 0)  &&  (serviceSettings.DefaultSC() < numSCAddresses))
            serviceCentreNumber = &(serviceSettings.SCAddress(serviceSettings.DefaultSC()));
        else
            serviceCentreNumber = &(serviceSettings.SCAddress(0));
		
        iSmsMtm->SmsHeader().SetServiceCenterAddressL(serviceCentreNumber->Address());
	}
	else 
	{
		// Leave if there is no service center number
		User::Leave(0);
	}
	
    iSmsMtm->SaveMessageL();
	
    // Index entry must be Updated
    TMsvEntry indexEntry = iSmsMtm->Entry().Entry();
	// Set in-preparation flag
    indexEntry.SetInPreparation(EFalse);
	// Sets the sending state
    indexEntry.SetSendingState(KMsvSendStateWaiting);
    iSmsMtm->Entry().ChangeL(indexEntry);
	
    // Time to send the message
    Cancel(); // prepare iMsvOper for use
	iEntrySelection->Reset();
	iEntrySelection->AppendL(iSmsId);
	
    TBuf8<1> dummyParam;
	// There is also InvokeSyncFunctionL which is synchronous.
	iMsvOper = iSmsMtm->InvokeAsyncFunctionL(ESmsMtmCommandScheduleCopy, *iEntrySelection, dummyParam, iStatus);
    SetActive();
}

// ----------------------------------------------------------------------------
// CMtmsEngine::MoveToFolderL( TMsvId aMessageId,  TMsvId aFolder )
//
// Move message to folder. Notice that the iSmsMtm points to the parent, not
// to the message itself. If you move messages from inbox to drafts, those
// messages cannot be edited because their complete flag is true.
// ----------------------------------------------------------------------------
void CMtmsEngine::MoveToFolderL(TInt aIndex, TMsvId aFolder)

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩亚州综合| 老司机精品视频一区二区三区| 裸体在线国模精品偷拍| 欧美一区在线视频| 久久精品国产77777蜜臀| 日韩免费观看高清完整版在线观看| 麻豆专区一区二区三区四区五区| 精品国产乱码久久久久久久久| 精品国产91亚洲一区二区三区婷婷| 久久99国产精品久久| 久久午夜老司机| 91免费在线视频观看| 亚洲国产视频直播| 欧美大片在线观看| 成人天堂资源www在线| 国产在线视频不卡二| 欧美国产日韩在线观看| 欧美午夜片在线看| 精品在线亚洲视频| 日韩毛片精品高清免费| 日韩精彩视频在线观看| 国产午夜精品久久| 在线影院国内精品| 国产麻豆精品95视频| 最新国产の精品合集bt伙计| 欧美日本国产视频| 懂色av一区二区三区免费看| 亚洲线精品一区二区三区八戒| 日韩欧美高清在线| 日本韩国一区二区| 国产一区二区中文字幕| 玉足女爽爽91| 国产成人免费视频网站高清观看视频| 亚洲欧美欧美一区二区三区| 日韩精品中文字幕在线不卡尤物 | 欧美人牲a欧美精品| 国产在线播放一区二区三区 | 亚洲福利电影网| 国产日韩欧美在线一区| 亚洲成a人v欧美综合天堂| 精品国产精品网麻豆系列| 在线视频国内自拍亚洲视频| 国产老肥熟一区二区三区| 亚洲成人在线免费| 国产精品国产三级国产有无不卡| 91精品国产品国语在线不卡| 在线视频欧美精品| 成人国产精品免费网站| 欧美日韩日日夜夜| 成人午夜精品在线| 精品一区二区在线播放| 欧美美女一区二区在线观看| 成人看片黄a免费看在线| 久久久久久久免费视频了| 色999日韩国产欧美一区二区| 精品一区二区三区的国产在线播放 | 国产精品久久福利| 久久免费视频色| 亚洲国产精品一区二区www在线| 91久久精品国产91性色tv| 美女网站色91| 亚洲天天做日日做天天谢日日欢| 欧美午夜寂寞影院| 国产一区二区三区精品欧美日韩一区二区三区 | 91在线免费播放| 奇米影视在线99精品| 国产欧美中文在线| 欧美最新大片在线看| 国产在线日韩欧美| 亚洲制服丝袜一区| 久久精品亚洲麻豆av一区二区| 色视频欧美一区二区三区| 免费av成人在线| 一区二区三区在线高清| 337p日本欧洲亚洲大胆色噜噜| 色94色欧美sute亚洲线路二| 国模套图日韩精品一区二区| 国产精品日韩成人| 欧美一区二区在线播放| bt欧美亚洲午夜电影天堂| 夜夜嗨av一区二区三区四季av| 久久综合资源网| 欧美剧在线免费观看网站| 99精品黄色片免费大全| 精彩视频一区二区三区| 一区二区在线观看免费| 久久麻豆一区二区| 欧美一区二区三区白人| 色94色欧美sute亚洲13| 成人在线视频一区二区| 久久97超碰国产精品超碰| 亚洲成年人网站在线观看| 中文字幕av不卡| 久久婷婷国产综合精品青草| 欧美高清你懂得| 在线观看日韩精品| 亚洲视频一区二区在线| 26uuu国产电影一区二区| 在线播放中文一区| 欧美日韩在线亚洲一区蜜芽| 色综合色狠狠综合色| 成人福利在线看| 国产精品人妖ts系列视频| 亚洲精品一区二区三区精华液| 91精品蜜臀在线一区尤物| 欧美日韩午夜精品| 精品视频1区2区| 欧美精品日韩精品| 国产亚洲精久久久久久| 精品人在线二区三区| 欧美一区二区三区视频在线| 69久久99精品久久久久婷婷| 欧美日本国产一区| 欧美日韩www| 91精品国产色综合久久不卡电影| 欧美日本视频在线| 日韩成人免费在线| 日本欧美久久久久免费播放网| 性做久久久久久免费观看 | 国产精品久久久久久妇女6080| 欧美精选在线播放| 欧美一区二区三区视频在线| 在线观看亚洲一区| 91精品福利在线一区二区三区| 欧美午夜片在线观看| 欧美一区日本一区韩国一区| 欧美sm美女调教| 成人性色生活片| 色综合天天天天做夜夜夜夜做| 色网站国产精品| 日韩一区二区电影| 国产日本欧美一区二区| 亚洲欧美在线高清| 亚洲电影视频在线| 美女诱惑一区二区| 国产成人av影院| 91久久奴性调教| 欧美一区二区三区免费观看视频 | 91日韩精品一区| 欧美精品视频www在线观看| 日韩精品专区在线影院观看| 久久精品免费在线观看| 亚洲三级小视频| 美女精品一区二区| av中文字幕在线不卡| 欧美日韩一区二区电影| 26uuu亚洲综合色| 亚洲欧美二区三区| 黄网站免费久久| 91福利区一区二区三区| 日韩三级中文字幕| 亚洲欧美偷拍另类a∨色屁股| 婷婷亚洲久悠悠色悠在线播放| 国产在线精品一区二区三区不卡| 国产高清一区日本| 国产白丝精品91爽爽久久| 欧美视频你懂的| 国产精品色一区二区三区| 日韩高清在线不卡| a4yy欧美一区二区三区| 日韩一级免费观看| 亚洲精品欧美专区| 国产成人在线视频网站| 欧美美女网站色| 亚洲精品国产无天堂网2021| 国产老肥熟一区二区三区| 欧美日韩mp4| 亚洲日韩欧美一区二区在线| 国产精品影音先锋| 欧美一区二区久久| 一级精品视频在线观看宜春院| 福利电影一区二区三区| 日韩欧美激情一区| 亚洲电影一区二区三区| 不卡的电影网站| 国产视频不卡一区| 麻豆久久一区二区| 欧美日韩日本视频| 日韩一区和二区| 丝袜亚洲另类欧美综合| 色素色在线综合| 综合av第一页| www.亚洲人| 亚洲国产岛国毛片在线| 国产精品91一区二区| 欧美一区二区在线免费观看| 亚洲一区av在线| 欧美在线影院一区二区| 国产精品丝袜91| 成人免费看片app下载| 精品人伦一区二区色婷婷| 蜜臀久久99精品久久久画质超高清| 午夜精品福利一区二区蜜股av| 色狠狠一区二区三区香蕉| 综合久久综合久久| 色香蕉成人二区免费| 一区二区成人在线视频| 欧美综合久久久| 亚洲123区在线观看| 69久久夜色精品国产69蝌蚪网|