本文整理汇总了C++中TMsvEntry::SetInPreparation方法的典型用法代码示例。如果您正苦于以下问题:C++ TMsvEntry::SetInPreparation方法的具体用法?C++ TMsvEntry::SetInPreparation怎么用?C++ TMsvEntry::SetInPreparation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TMsvEntry
的用法示例。
在下文中一共展示了TMsvEntry::SetInPreparation方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateMessageL
void CSmsReplyToStep::CreateMessageL()
{
INFO_PRINTF1(_L("Creating message..."));
TMsvEntry entry;
entry.SetVisible(ETrue);
entry.SetInPreparation(ETrue);
entry.iServiceId = iTestUtils->iSmsServiceId;
entry.iType = KUidMsvMessageEntry;
entry.iMtm = KUidMsgTypeSMS;
entry.iDate.HomeTime();
entry.iSize = 0;
entry.iDescription.Set(KNullDesC);
entry.iDetails.Set(KNullDesC);
entry.SetSendingState(KMsvSendStateScheduled);
// Create the SMS header object...
CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *iTestUtils->iRichText);
CleanupStack::PushL(header);
// Set the body text...
iTestUtils->iRichText->Reset();
iTestUtils->iRichText->InsertL(0, KMessageData);
// Copy the message settings...
header->SetSmsSettingsL(*iTestUtils->iServiceSettings);
// Set the service centre
TInt defaultIndex = iTestUtils->iServiceSettings->DefaultServiceCenter();
header->SetServiceCenterAddressL(iTestUtils->iServiceSettings->GetServiceCenter(defaultIndex).Address());
// Set recipient - ask derived class
SetRecipientsL(*header);
// Update entry description and details...
CArrayPtrFlat<CSmsNumber>& recipient = header->Recipients();
entry.iDetails.Set(recipient[0]->Address());
entry.iDescription.Set(iTestUtils->iRichText->Read(0, iTestUtils->iServiceSettings->DescriptionLength()));
entry.SetInPreparation(EFalse);
// Create the entry - set context to the global outbox.
iTestUtils->iMsvEntry->SetEntryL(KMsvGlobalOutBoxIndexEntryId);
iTestUtils->iMsvEntry->CreateL(entry);
// Create new store and save header information
iTestUtils->iMsvEntry->SetEntryL(entry.Id());
CMsvStore* store = iTestUtils->iMsvEntry->EditStoreL();
CleanupStack::PushL(store);
header->StoreL(*store);
store->StoreBodyTextL(*iTestUtils->iRichText);
store->CommitL();
CleanupStack::PopAndDestroy(2, header);
iMessageId = entry.Id();
}
示例2: CreateNewMessageL
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CSMSSender::CreateNewMessageL()
{
Cancel();
iMessageMade = iMessageSent = iMessageReceived = EFalse;
delete iMtm;
iMtm = NULL;
TMsvEntry newEntry; // This represents an entry in the Message Server index
newEntry.iMtm = KUidMsgTypeSMS; // message type is SMS
newEntry.iType = KUidMsvMessageEntry; // this defines the type of the entry: message
newEntry.iServiceId = KMsvLocalServiceIndexEntryId; // ID of local service (containing the standard folders)
newEntry.iDate.UniversalTime(); // set the date of the entry to home time
newEntry.SetInPreparation(ETrue); // a flag that this message is in preparation
newEntry.SetReadOnly(EFalse);
// - CMsvEntry accesses and acts upon a particular Message Server entry.
// - NewL() does not create a new entry, but simply a new object to access an existing entry.
// - It takes in as parameters the client's message server session,
// ID of the entry to access and initial sorting order of the children of the entry.
CMsvEntry* entry = CMsvEntry::NewL(*iSession, KMsvDraftEntryIdValue, TMsvSelectionOrdering());
CleanupStack::PushL(entry);
delete iOperation;
iOperation = NULL;
iOperation = entry->CreateL(newEntry, iStatus);
CleanupStack::PopAndDestroy(entry);
iPhase = EWaitingForCreate;
SetActive();
}
示例3: CreateNewMessageL
TMsvId CFakeSMSSender::CreateNewMessageL(TTime aMsgTime)
{
CMsvEntry* Draftentry = CMsvEntry::NewL(*iMsvSession, KMsvDraftEntryIdValue ,TMsvSelectionOrdering());
CleanupStack::PushL(Draftentry);
CMsvOperationWait* wait = CMsvOperationWait::NewLC();
wait->Start();
TMsvEntry newEntry; // This represents an entry in the Message Server index
newEntry.iMtm = KUidMsgTypeSMS; // message type is SMS
newEntry.iType = KUidMsvMessageEntry; //KUidMsvServiceEntry // this defines the type of the entry: message
newEntry.iServiceId = KMsvLocalServiceIndexEntryId; // // ID of local service (containing the standard folders)
newEntry.iDate = aMsgTime; // set the date of the entry to home time
newEntry.SetInPreparation(ETrue); // a flag that this message is in preparation
newEntry.SetReadOnly(EFalse);
CMsvOperation* oper = Draftentry->CreateL(newEntry,wait->iStatus);
CleanupStack::PushL(oper);
CActiveScheduler::Start();
while( wait->iStatus.Int() == KRequestPending )
{
CActiveScheduler::Start();
}
// ...and keep track of the progress of the create operation.
TMsvLocalOperationProgress progress = McliUtils::GetLocalProgressL(*oper);
User::LeaveIfError(progress.iError);
// Draftentry->MoveL(progress.iId,KMsvGlobalInBoxIndexEntryId);
CleanupStack::PopAndDestroy(3);//Draftentry,wait,oper
return progress.iId;
}
示例4: PostprocessEntryL
// -----------------------------------------------------------------------------
// CWPMessage::PostprocessEntryL
// -----------------------------------------------------------------------------
//
void CWPMessage::PostprocessEntryL( CMsvEntry& aCEntry, TMsvEntry& aTEntry )
{
FLOG( _L( "CWPMessage::PostprocessEntryL" ) );
aTEntry.SetReadOnly(EFalse);
aTEntry.SetVisible(ETrue);
aTEntry.SetInPreparation(EFalse);
aCEntry.ChangeL(aTEntry);
}
示例5: PrepareEntryLC
// -----------------------------------------------------------------------------
// CWPMessage::PrepareEntry
// -----------------------------------------------------------------------------
//
void CWPMessage::PrepareEntryLC( TMsvEntry& aEntry )
{
FLOG( _L( "CWPMessage::PrepareEntryLC" ) );
// Current time
TTime time;
// Get Universal time
time.UniversalTime();
FLOG( _L( "CWPMessage::PrepareEntryLC create an invisible blank entry" ) );
// create an invisible blank entry
aEntry.iType = KUidMsvMessageEntry;
aEntry.SetVisible(EFalse);
aEntry.SetInPreparation(ETrue);
aEntry.SetReadOnly(EFalse);
aEntry.SetUnread(ETrue);
aEntry.iDate = time;
aEntry.iServiceId = KMsvLocalServiceIndexEntryId;
aEntry.iError = KErrNone;
// iMtmData1 is been used/reserved for count, please don't use for any other purpose.
aEntry.SetMtmData1(3);
FLOG( _L( "CWPMessage::PrepareEntryLC create an invisible blank entry done" ) );
// Look up the details
HBufC* details = NULL;
if( iMessage->Authenticated() )
{
FLOG( _L( "CWPMessage::PrepareEntryLC iMessage->Authenticated() true" ) );
details = LoadStringLC( R_FROM_SERVICEPROVIDER );
FLOG( _L( "CWPMessage::PrepareEntryLC LoadString done" ) );
}
else
{
FLOG( _L( "CWPMessage::PrepareEntryLC iMessage->Authenticated() false" ) );
if( iSender )
{
FLOG( _L( "CWPMessage::PrepareEntryLC iSender true" ) );
details = HBufC::NewLC( iSender->Length() );
details->Des().Copy( *iSender );
}
else
{
FLOG( _L( "CWPMessage::PrepareEntryLC iSender false" ) );
details = KNullDesC().AllocLC();
}
}
FLOG( _L( "CWPMessage::PrepareEntryLC iDetails.Set" ) );
aEntry.iDetails.Set( *details );
FLOG( _L( "CWPMessage::PrepareEntryLC Done" ) );
}
示例6: PopulateMessageL
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CSMSSender::PopulateMessageL(TMsvEntry& aMsvEntry,TDes& aDescription,TDes& aDetails)
{
ASSERT(iMtm);
// We get the message body from Mtm and insert a bodytext
CRichText& mtmBody = iMtm->Body();
mtmBody.Reset();
mtmBody.InsertL(0, iMessage); // insert our msg tag as the body text
if(iDescription)
{
if(iDescription->Des().Length() > 30)
aDescription.Copy(iDescription->Des().Left(30));
else
aDescription.Copy(iDescription->Des());
}
else
{
if(iMessage.Length() > 30)
aDescription.Copy(iMessage.Left(30));
else
aDescription.Copy(iMessage);
}
if(iDetails)
{
if(iDetails->Des().Length() > 30)
aDetails.Copy(iDetails->Des().Left(30));
else
aDetails.Copy(iDetails->Des());
}
else
{
if(iRecipients.Length() > 30)
aDetails.Copy(iRecipients.Left(30));
else
aDetails.Copy(iRecipients);
}
aMsvEntry.SetInPreparation(EFalse);
aMsvEntry.SetScheduled(EFalse);
aMsvEntry.iDate.UniversalTime();
aMsvEntry.SetSendingState(KMsvSendStateWaiting);
}
示例7: AddUserFolderL
// -----------------------------------------------------------------------------
// CMmsAdapterMsvApi::AddUserFolderL
// Creates new user folder
// -----------------------------------------------------------------------------
TInt CMmsAdapterMsvApi::AddUserFolderL( TMsvId& aFolder, const TDesC& aName )
{
TRACE_FUNC_ENTRY;
LOGGER_WRITE_1( "aName: %S", &aName );
// Make sure that we are not going to add same folder twise
TBool found( EFalse );
found = FindUserFolderL( aName, aFolder );
if ( found )
{
LOGGER_WRITE( "Folder already exists" );
LOGGER_LEAVEFN( "CMmsAdapterMsvApi::AddUserFolderL" );
return KErrNone;
}
CMsvEntry* entry = iSession.GetEntryL(KMsvMyFoldersEntryIdValue);
CleanupStack::PushL( entry );
TTime date;
date.UniversalTime();
TMsvEntry folderEntry;
folderEntry.iType = KUidMsvFolderEntry;
folderEntry.iMtm = KUidMsvLocalServiceMtm;
folderEntry.iDetails.Set( aName );
folderEntry.iServiceId = KMsvLocalServiceIndexEntryIdValue;
folderEntry.iSize = sizeof( folderEntry );
folderEntry.iDate = date;
folderEntry.SetStandardFolder( EFalse );
folderEntry.SetVisible( ETrue );
folderEntry.SetComplete( ETrue );
folderEntry.SetInPreparation( EFalse );
folderEntry.SetReadOnly( EFalse );
entry->CreateL( folderEntry );
CleanupStack::PopAndDestroy( entry );
aFolder = folderEntry.Id();
TRACE_FUNC_EXIT;
return KErrNone;
}
示例8: doTestStepL
TVerdict CCreateSmsMessageTestStep::doTestStepL()
{
CActiveScheduler* scheduler = new (ELeave) CActiveScheduler;
CActiveScheduler::Install(scheduler);
CleanupStack::PushL(scheduler);
CSessionObserver* sessionObserver = new (ELeave) CSessionObserver;
CleanupStack::PushL(sessionObserver);
CMsvSession* session = CMsvSession::OpenSyncL(*sessionObserver);
CleanupStack::PushL(session);
_LIT(KFileName,"FileName");
TPtrC tag;
if ( !GetStringFromConfig(ConfigSection(),KFileName,tag))
{
ERR_PRINTF1(_L("No Input for FileName in CreateSmsMessage"));
User::Leave(KErrNotReady);
}
HBufC* fileName = tag.AllocLC();
// Create a Rich Text object
CPlainText::TTextOrganisation ttOrg = {CPlainText::EOrganiseByLine};
CParaFormatLayer* paraFormatLayer = CParaFormatLayer::NewL();
CleanupStack::PushL(paraFormatLayer);
CCharFormatLayer* charFormatLayer = CCharFormatLayer::NewL();
CleanupStack::PushL(charFormatLayer);
CRichText* bodyRichText = CRichText::NewL(paraFormatLayer, charFormatLayer);
CleanupStack::PushL(bodyRichText);
// Store the file contents into the CRichText object
bodyRichText->ImportTextFileL(0, fileName->Des(), ttOrg);
// Create the SMS header object...
CSmsHeader* header = CSmsHeader::NewL(CSmsPDU::ESmsSubmit, *bodyRichText);
CleanupStack::PushL(header);
// Set the body text...
CSmsSettings* smsSettings = CSmsSettings::NewL();
CleanupStack::PushL(smsSettings);
CSmsAccount* account = CSmsAccount::NewLC();
account->LoadSettingsL(*smsSettings);
// Copy the message settings...
header->SetSmsSettingsL(*smsSettings);
// Set the service centre
TInt defaultIndex = smsSettings->DefaultServiceCenter();
header->SetServiceCenterAddressL(smsSettings->GetServiceCenter(defaultIndex).Address());
// Set recipient - ask derived class
SetRecipientsL(*header);
CArrayPtrFlat<CSmsNumber>& recipient = header->Recipients();
INFO_PRINTF1(_L("Creating message..."));
TMsvEntry entry;
entry.SetVisible(ETrue);
entry.SetInPreparation(ETrue);
TMsvId srvcId=0;
TSmsUtilities::ServiceIdL(*session, srvcId);
entry.iServiceId = srvcId;
entry.iType = KUidMsvMessageEntry;
entry.iMtm = KUidMsgTypeSMS;
entry.iDate.UniversalTime();
entry.iSize = 0;
entry.iDescription.Set(KNullDesC);
entry.iDetails.Set(KNullDesC);
entry.SetSendingState(KMsvSendStateWaiting);
// Update entry description and details...
entry.iDetails.Set(recipient[0]->Address());
entry.iDescription.Set(recipient[0]->Address());
entry.SetInPreparation(EFalse);
//TPtrC tag;
_LIT(KParent,"Parent");
TPtrC parentTag;
if ( !GetStringFromConfig(ConfigSection(),KParent,parentTag))
{
ERR_PRINTF1(_L("No Input for Outbox"));
User::Leave(KErrNotReady);
}
// Create the entry - set context to the global outbox.
TMsvId paramParentId = MsgingUtils::GetLocalFolderId(parentTag);//KMsvGlobalOutBoxIndexEntryId;
CMsvEntry* newEntry = CMsvEntry::NewL(*session,paramParentId,TMsvSelectionOrdering());
CleanupStack::PushL(newEntry);
newEntry->SetEntryL(paramParentId);
newEntry->CreateL(entry);
// Create new store and save header information
newEntry->SetEntryL(entry.Id());
CMsvStore* store = newEntry->EditStoreL();
CleanupStack::PushL(store);
//.........这里部分代码省略.........
示例9: send_messageL
void CSmsFile::send_messageL(const TDesC& recipient, const TDesC& body)
{
if (iStatus==KRequestPending) {
User::Leave(KErrServerBusy);
}
state=_L("send_messageL");
TMsvEntry newEntry; // This represents an entry in the Message Server index
newEntry.iMtm = KUidMsgTypeSMS; // message type is CSmsFile
newEntry.iType = KUidMsvMessageEntry; // this defines the type of the entry: message
newEntry.iServiceId = KMsvLocalServiceIndexEntryId; // ID of local service (containing the standard folders)
newEntry.iDate.HomeTime(); // set the date of the entry to home time
newEntry.SetInPreparation(ETrue); // a flag that this message is in preparation
// get ref to outbox
state=_L("NewL");
CMsvEntry *entry =CMsvEntry::NewL(*iSession, KMsvGlobalOutBoxIndexEntryId ,TMsvSelectionOrdering());
CleanupStack::PushL(entry);
// create message in outbox
state=_L("CreateL");
entry->CreateL(newEntry);
state=_L("GetEntry");
entry = iSession->GetEntryL(newEntry.Id());
// SetCurrentEntryL takes ownership of the CMsvEntry
state=_L("SetCurrentEntry");
iMtm->SetCurrentEntryL(entry);
CleanupStack::Pop(); // entry
state=_L("Entry()");
TMsvEntry msvEntry = (iMtm->Entry()).Entry();
state=_L("Body()");
CRichText& mtmBody = iMtm->Body();
mtmBody.Reset();
state=_L("set message");
mtmBody.InsertL(0, body); // insert our msg tag as the body text
// set iRecipient into the Details of the entry
msvEntry.iDetails.Set(recipient); // set recipient info in details
msvEntry.SetInPreparation(EFalse); // set inPreparation to false
msvEntry.SetSendingState(KMsvSendStateWaiting); // set the sending state (immediately)
msvEntry.iDate.HomeTime(); // set time to Home Time
// To handle the CSmsFile specifics we start using SmsMtm
CSmsClientMtm* smsMtm = STATIC_CAST(CSmsClientMtm*, iMtm);
state=_L("RestoreServiceAndSettingsL");
smsMtm->RestoreServiceAndSettingsL();
state=_L("set header");
// CSmsHeader encapsulates data specific for CSmsFile messages,
// like service center number and options for sending.
CSmsHeader& header = smsMtm->SmsHeader();
state=_L("get options");
if (!sendOptions) {
sendOptions = CSmsSettings::NewL();
sendOptions->CopyL(smsMtm->ServiceSettings()); // restore existing settings
state=_L("SetDelivery");
sendOptions->SetDelivery(ESmsDeliveryImmediately); // set to be delivered immediately
}
// set send options
// ERROR HERE!
state=_L("SetSmsSettingsL");
header.SetSmsSettingsL(*sendOptions);
state=_L("check sc");
// let's check if there's sc address
if (header.Message().ServiceCenterAddress().Length() == 0)
{
// no, there isn't. We assume there is at least one sc number set and use
// the default SC number.
CSmsSettings* serviceSettings = &(smsMtm->ServiceSettings());
// if number of scaddresses in the list is null
if (!serviceSettings->NumSCAddresses())
{
// FIXME: what to do?
User::Leave(1);
} else {
// set sc address to default.
CSmsNumber* sc = 0;
sc = &(serviceSettings->SCAddress(serviceSettings->DefaultSC()));
header.Message().SetServiceCenterAddressL(sc->Address());
}
}
state=_L("add addresses");
// Add our recipient to the list, takes in two TDesCs, first is real address and second is an alias
// works also without the alias parameter.
//.........这里部分代码省略.........