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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? mtmsengine.cpp.bak

?? symbian系統上的記事本程序
?? BAK
?? 第 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"
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)
{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩av电影一区| 99久久精品国产网站| 99久久99久久精品国产片果冻| 欧美一级黄色片| 亚洲影视资源网| 欧美亚洲一区二区在线观看| 亚洲视频免费看| 91美女视频网站| 一区二区三区日韩欧美| 一本大道久久a久久精二百| 1000精品久久久久久久久| 成人黄页毛片网站| 国产精品国产三级国产普通话99 | 亚洲精品伦理在线| 不卡的电影网站| 亚洲一区二区三区四区五区黄| 色婷婷av久久久久久久| 亚洲资源中文字幕| 欧美日韩一本到| 裸体在线国模精品偷拍| 久久婷婷成人综合色| 处破女av一区二区| 亚洲狠狠爱一区二区三区| 欧美剧情片在线观看| 国产sm精品调教视频网站| 亚洲男女一区二区三区| 欧美日韩在线一区二区| 中文字幕免费一区| 国产98色在线|日韩| 亚洲国产日韩a在线播放性色| 日韩一卡二卡三卡| 91丨porny丨首页| 久久成人免费电影| 亚洲制服丝袜av| 久久久久久久久久电影| 欧美三区在线观看| 懂色av一区二区在线播放| 日韩精品一区第一页| 综合久久国产九一剧情麻豆| 日韩免费电影网站| 欧美午夜影院一区| 91免费视频网址| 国产.精品.日韩.另类.中文.在线.播放 | 亚洲一区二区三区四区在线观看 | 欧美视频在线不卡| 国产成人鲁色资源国产91色综| 在线综合视频播放| 亚洲综合无码一区二区| 欧美va日韩va| 宅男在线国产精品| 欧美精品亚洲一区二区在线播放| 91视频免费播放| 色综合久久久久久久久久久| 国产成人综合在线| 国产成人免费视频网站| 国产精品亚洲专一区二区三区| 首页亚洲欧美制服丝腿| 日本不卡中文字幕| 蜜桃视频在线一区| 九九热在线视频观看这里只有精品| 五月天网站亚洲| 美女国产一区二区三区| 久久精品国产网站| 国产精品一级黄| 一本在线高清不卡dvd| 欧美吞精做爰啪啪高潮| 在线播放欧美女士性生活| 欧美电影免费观看高清完整版在线观看 | 91精品国产综合久久精品app| 欧美日本在线看| 26uuu精品一区二区三区四区在线| 337p日本欧洲亚洲大胆色噜噜| 中日韩av电影| 天涯成人国产亚洲精品一区av| 免费观看成人鲁鲁鲁鲁鲁视频| 国产乱码一区二区三区| 91蜜桃传媒精品久久久一区二区| 欧美精品丝袜中出| 国产精品五月天| 久久丁香综合五月国产三级网站| 国产宾馆实践打屁股91| 337p亚洲精品色噜噜噜| 国产精品午夜久久| 麻豆精品新av中文字幕| 色综合久久久久网| 久久蜜桃av一区二区天堂| 亚洲成a人在线观看| 国产精品羞羞答答xxdd| 91麻豆精品久久久久蜜臀| 综合激情成人伊人| 成人精品鲁一区一区二区| 欧美一区二区三区免费视频| 亚洲日本乱码在线观看| 国产一区久久久| 精品久久人人做人人爰| 蜜臀va亚洲va欧美va天堂| 欧美性xxxxxxxx| 亚洲国产一区在线观看| www.成人在线| 日本一区二区成人| 国产成人a级片| 国产精品理论在线观看| 国产激情一区二区三区四区| 久久综合九色综合欧美亚洲| 久久国产精品免费| 欧美精品一区二区三| 久久97超碰国产精品超碰| 亚洲精品一区二区三区影院| 国产在线不卡一区| 亚洲国产精华液网站w| 成人激情免费视频| 亚洲精品成人精品456| 日本精品裸体写真集在线观看| 尤物在线观看一区| 日韩欧美在线影院| 日韩欧美一级片| 日本va欧美va精品| 精品处破学生在线二十三| 久久精品99国产精品日本| 国产性天天综合网| 91亚洲精品久久久蜜桃| 日日摸夜夜添夜夜添精品视频| 欧美一二区视频| 99久久久久久| 精品一区二区在线播放| 国产精品不卡一区| 欧美一区二区视频观看视频| 国产成人自拍高清视频在线免费播放| 中文字幕av一区二区三区免费看| 在线视频中文字幕一区二区| 麻豆精品视频在线观看视频| 亚洲精品视频自拍| 久久影院视频免费| 欧洲av在线精品| 北条麻妃一区二区三区| 日本va欧美va瓶| 亚洲成人激情av| 亚洲久本草在线中文字幕| 久久精品视频网| 日韩欧美国产1| 欧美二区乱c少妇| 色欧美日韩亚洲| av综合在线播放| 国产一区二区不卡在线| 美女一区二区三区在线观看| 亚洲视频一二三| 亚洲欧洲美洲综合色网| 久久久久97国产精华液好用吗| 欧美精品在线视频| 欧美猛男gaygay网站| 色哟哟亚洲精品| 欧洲生活片亚洲生活在线观看| av在线不卡观看免费观看| 99久久伊人精品| 一本色道久久加勒比精品| 91丨九色丨国产丨porny| 91色九色蝌蚪| 欧美色国产精品| 91精品国产全国免费观看| 日韩一区二区电影网| 久久久国产精品不卡| 久久精品一二三| 成人免费小视频| 亚洲综合在线电影| 久久精品久久久精品美女| 国内外精品视频| 99久久免费视频.com| 一本一道久久a久久精品| 91久久久免费一区二区| 日韩一区二区三区免费看| 精品国产乱码久久久久久1区2区| 国产精品另类一区| 亚洲成a人片在线不卡一二三区| 久久av中文字幕片| 一本久道久久综合中文字幕 | 裸体在线国模精品偷拍| av成人免费在线观看| 欧美一区二区三区免费在线看| 中文字幕精品综合| 美日韩一区二区| 91日韩精品一区| 国产三级三级三级精品8ⅰ区| 有坂深雪av一区二区精品| 国产黄色精品视频| 91精品国产综合久久久久久久| 国产精品久久久久久久久动漫 | 成人免费精品视频| 欧美一区永久视频免费观看| 亚洲精选一二三| 国产成人在线影院| 久久婷婷国产综合精品青草| 视频一区二区三区中文字幕| 91欧美激情一区二区三区成人| 久久久久国色av免费看影院| 另类欧美日韩国产在线| 偷拍与自拍一区| 国产91在线观看丝袜| 亚洲国产高清aⅴ视频| 国产乱码精品一区二区三区av| 欧美一区二区三区的|