本文整理汇总了C++中CDesCArray::Reset方法的典型用法代码示例。如果您正苦于以下问题:C++ CDesCArray::Reset方法的具体用法?C++ CDesCArray::Reset怎么用?C++ CDesCArray::Reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CDesCArray
的用法示例。
在下文中一共展示了CDesCArray::Reset方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetAvailableHeightsInTwipsAndPointsL
EXPORT_C TInt FontUtils::GetAvailableHeightsInTwipsAndPointsL(const CGraphicsDevice& aDevice,const TDesC& aTypefaceName,CArrayFix<TInt>& aTwipsList,CDesCArray& aPointsList)
/** Gets a list of all heights in twips, available for the named typeface and the
graphics device specified.
Also gets a list of heights in points, represented as character strings.
@param aDevice The graphics device.
@param aTypefaceName The name of the typeface.
@param aTwipsList On return, contains all available heights for the typeface,
in twips.
@param aPointsList On return, the heights in points, represented as character
strings.
@return KErrNotSupported if the named typeface is not supported by the graphics
device, otherwise KErrNone. */
{ // static
aTwipsList.Reset();
aPointsList.Reset();
TInt err=GetAvailableHeightsInTwipsL(aDevice,aTypefaceName,aTwipsList);
if (err==KErrNotSupported)
return err;
const TInt count=aTwipsList.Count();
for (TInt ii=0;ii<count;ii++)
{
const TInt points=PointsFromTwips(aTwipsList[ii]);
if (points<EMinFontHeight)
continue;
TBuf<8> num;
num.Num(points);
aPointsList.AppendL(num);
}
return KErrNone;
}
示例2: GetAvailableFontsL
EXPORT_C void FontUtils::GetAvailableFontsL(const CGraphicsDevice& aDevice, CDesCArray& aFontNameList,TInt aFonts)
/** Gets the list of typeface names available for the graphics device.
@param aDevice The graphics device.
@param aFontNameList On return, contains the list of typeface names.
@param aFonts Can be used to specify which sorts of typefaces are required.
For possible values, see the flags defined in gulftflg.hrh
beginning with EGulAllFonts. */
{ // static
aFontNameList.Reset();
const TInt numTypefaces=aDevice.NumTypefaces();
TTypefaceSupport typefaceInfo;
for (TInt ii=0;ii<numTypefaces;ii++)
{
aDevice.TypefaceSupport(typefaceInfo,ii);
if (typefaceInfo.iTypeface.IsProportional())
{
if (aFonts==EGulMonospaceFontsOnly)
continue;
}
else if (aFonts==EGulNoMonospaceFonts || aFonts==EGulNoMonospaceOrSymbolFonts)
continue;
if (typefaceInfo.iTypeface.IsSymbol())
{
if (aFonts==EGulNoSymbolFonts || aFonts==EGulNoMonospaceOrSymbolFonts || aFonts==EGulMonospaceFontsOnly)
continue;
}
else if (aFonts==EGulSymbolFontsOnly)
continue;
aFontNameList.AppendL(typefaceInfo.iTypeface.iName);
}
}
示例3: CopyArrayL
// ----------------------------------------------------------------------------
// Copies elements from one array of descriptors to another
// ----------------------------------------------------------------------------
//
EXPORT_C void MPXUser::CopyArrayL(const MDesCArray& aSrc, CDesCArray& aDest)
{
aDest.Reset();
for (TInt i=0; i < aSrc.MdcaCount(); ++i)
{
aDest.AppendL(aSrc.MdcaPoint(i));
}
}
示例4: ClearL
void CPixelMetricsMapperViewContainer::ClearL()
{
MDesCArray* itemList = iListbox->Model()->ItemTextArray();
CDesCArray* itemArray = ( CDesCArray* ) itemList;
itemArray->Reset();
iListbox->HandleItemAdditionL();
iCount = 0;
DrawNow();
}
示例5: StoreFolder
void CPhotoListView::StoreFolder()
{
int answer;
TInt Index;
if(iFolderStatus>=0)
{
TInt compareflag;
TBuf<160> folderName;
folderName.FillZ();
folderName.Zero();
folderName.SetLength(0);
CAknTextQueryDialog* dlg = CAknTextQueryDialog::NewL(folderName, CAknQueryDialog::ENoTone );
answer=( dlg->ExecuteLD( R_FOLDER_NAME_QUERY ) ); // new folder name
if(answer)
{
iFolderStatus=0;
compareflag=iPhotosAppUi->CheckAndSaveFolderToDB(folderName);
if(compareflag!=1)
{
comment.Copy(folderName);
iNewFolder = 1;
ReadandSendData();
}
else
{
CDesCArray* folderexist = iPhotosAppUi->FolderExist();
//CEikonEnv::Static ()->AlertWin (folderexist->MdcaPoint(0)) ;
TBuf<100> msg;
msg.Copy(folderexist->MdcaPoint(0));
CAknMessageQueryDialog* verdlg = CAknMessageQueryDialog::NewL(msg);
verdlg->PrepareLC(R_ABOUT_QUERY);
verdlg->RunLD();
folderexist->Reset();
}
}
else
{
Index=0;
iFolderStatus=0;
iPublic_Photo=EFalse;
}
}
}
示例6: AppendItemAndUpdateBoxL
void
CTrialContainer::ResetItems(TBool showTrial)
{
MDesCArray* itemList = iListBox->Model()->ItemTextArray();
CDesCArray* itemArray = static_cast<CDesCArray*>( itemList );
itemArray->Reset();
iListBox->HandleItemRemovalL(); // Updates listbox.
// Actually, the HandleItemRemovalL does not provoke a redraw...
iListBox->Reset();
if ((iShowTrial = showTrial)) {
AppendItemAndUpdateBoxL(R_STARTMENU_TRIAL, *itemArray);
}
AppendItemAndUpdateBoxL(R_STARTMENU_REGISTER, *itemArray);
AppendItemAndUpdateBoxL(R_STARTMENU_ALREADYREGISTERED, *itemArray);
}
示例7: RefreshShareContentL
// --------------------------------------------------------------------------
// CUpnpContentServerHandler::RefreshShareContentL
// ( other items are commented in header )
// --------------------------------------------------------------------------
//
void CUpnpContentServerHandler::RefreshShareContentL(
TInt aType )
{
__LOG8_1( "%s begin.", __PRETTY_FUNCTION__ );
if ( ( aType == EImageAndVideo && iVisualSharingReq ) ||
( aType == EPlaylist && iMusicSharingReq ) )
{
// no refresh available if sharing is ongoing
__LOG1( "Error: %d", __LINE__ );
User::Leave( KErrServerBusy );
}
if ( iMetadata->RefreshOngoing() )
{
__LOG("CUpnpContentServerHandler: Waiting refresh 1");
iWait.Start();
}
delete iReader;
iReader = NULL;
iReader = CUpnpSelectionReader::NewL( iMetadata );
RArray<TInt> selectedItems;
CleanupClosePushL( selectedItems );
CDesCArray* containers = new ( ELeave ) CDesCArrayFlat( 10 );
CleanupStack::PushL( containers );
iReader->FetchCollectionsL( containers );
GetSelectionIndexesL( selectedItems, aType );
CDesCArray* ids = new (ELeave) CDesCArrayFlat(4);
CleanupStack::PushL( ids );
CDesCArray* names = new (ELeave) CDesCArrayFlat(4);
CleanupStack::PushL( names );
iReader->CollectionIdsL( *ids, *names );
if ( aType == EImageAndVideo )
{
iVisualSharingReq = CUpnpSharingRequest::NewL( aType,
selectedItems,
ids,
names );
}
else if ( aType == EPlaylist )
{
iMusicSharingReq = CUpnpSharingRequest::NewL( aType,
selectedItems,
ids,
names );
}
else
{
User::Leave( KErrArgument );
}
CleanupStack::Pop( names ); // ownership transferred
CleanupStack::Pop( ids ); // ownership transferred
ChangeShareContentL( selectedItems, aType );
selectedItems.Reset();
containers->Reset();
CleanupStack::PopAndDestroy( containers );
CleanupStack::PopAndDestroy( &selectedItems );
__LOG8_1( "%s end.", __PRETTY_FUNCTION__ );
}
示例8: ResetView
void CPlaylist::ResetView()
{
CDesCArray* array = static_cast<CDesCArray*>(iListBox->Model()->ItemTextArray());
array->Reset();
iListBox->Reset();
}
示例9: SendFileL
void CImSmtpSession::SendFileL()
{
// Start the 'file mailer' object
__ASSERT_DEBUG(!iSmtpFile,gPanic(EImsmSmtpFileObjectAlreadyExists));
// log the info of the message to be sent
if (iLogMessage)
iLogMessage->Reset();
// Update the header info for this message..
CImHeader* header = CImHeader::NewLC();
CMsvStore* store = iServerEntry.EditStoreL();
CleanupStack::PushL(store);
header->RestoreL(*store);
TBool isBccRcpt = EFalse;
CDesCArray* rcptArray = NULL;
TBool sendBccNow = iToRcptHeaderUpdated;
if(!iToRcptHeaderUpdated)
{
// Set the new info...
//set from address
HBufC* formatedAddress = CreateFormattedAddressLC(iSettings.EmailAddress(), iSettings.EmailAlias());//Format the address fields
header->SetFromL(*formatedAddress);
CleanupStack::PopAndDestroy(formatedAddress);
formatedAddress = NULL;
// set ReceiptAddress if one exists in the settings
if( header->ReceiptAddress().Length() == 0 && iSettings.ReceiptAddress().Length() > 0 )
{
formatedAddress=CreateFormattedAddressLC(iSettings.ReceiptAddress(),iSettings.EmailAlias());//Format the address fields
header->SetReceiptAddressL(*formatedAddress);
CleanupStack::PopAndDestroy(formatedAddress);
formatedAddress = NULL;
}
if(header->ToRecipients().Count()==0 && header->CcRecipients().Count()==0)
{
sendBccNow=ETrue;
}
// ReplyToAddress
if ((header->ReplyTo().Length() == 0 || header->ReplyTo() == iSettings.ReplyToAddress()) &&
(iSettings.ReplyToAddress().Length() > 0))
{
formatedAddress= CreateFormattedAddressLC(iSettings.ReplyToAddress(),iSettings.EmailAlias());//Format the address fields
header->SetReplyToL(*formatedAddress);
CleanupStack::PopAndDestroy(formatedAddress);
formatedAddress = NULL;
}
//make a copy of 'Bcc' recipients then remove from Msg header
rcptArray= &(header->BccRecipients());
if (iSettings.SendCopyToSelf()==ESendCopyAsBccRecipient)
{
if ( header->ReceiptAddress().Length() )
rcptArray->AppendL(header->ReceiptAddress());
else if ( header->ReplyTo().Length() )
rcptArray->AppendL(header->ReplyTo());
}
if(rcptArray->Count() > 0)
{
iBccRcptFound=ETrue; // 'Bcc' recipients exists
iBccRcptIndex=0; //reset the counter
iFinishedWithBccRcpts=EFalse;
iSendFiles->ResetBccRcptArrayL();
TInt numberRcpts = rcptArray->Count();
if(numberRcpts)
{
iSendFiles->BccRcptArray().AppendL((*rcptArray)[0]);
CDesCArray& tempArr = iSendFiles->BccRcptArray();
for(TInt counter=1; counter<numberRcpts; counter++)
{
TInt aPos = 0;
tempArr.Find((*rcptArray)[counter],aPos,ECmpFolded16);
if(aPos > 0)
iSendFiles->BccRcptArray().AppendL((*rcptArray)[counter]);
}
}
rcptArray->Reset();
}
iToRcptHeaderUpdated=ETrue;
isBccRcpt=EFalse;
}
// Reset the number of Sent Messages, if all previous messages have been sent
if (iNumMsgsSent >= iNumMsgsToSend)
{
iNumMsgsSent = 0;
}
// Calc the num of messages we're sending. If there is a To or CC,
// recipient then there will be a message sent
if(header->ToRecipients().Count()>0 || header->CcRecipients().Count()>0)
iNumMsgsToSend = 1;
else
iNumMsgsToSend = 0;
//.........这里部分代码省略.........
示例10: GetFolder
void CPhotoListView::GetFolder()
{
TInt PopValue;
//TBuf<150> msg;
TInt count=0;
CDesCArray* items = iPhotosAppUi->GetFolderList();
CDesCArray* foldernames = iPhotosAppUi->ReturnText();
if (items == NULL)
{
Count = 0;
items = new (ELeave) CDesCArrayFlat(1);
items->AppendL(foldernames->MdcaPoint(0));
}
else
{
Count = items->MdcaCount();
items->AppendL(foldernames->MdcaPoint(0));
}
foldernames->Reset();
CEikTextListBox* list = new( ELeave ) CAknSinglePopupMenuStyleListBox;
CleanupStack::PushL( list );
CAknPopupList* popupList = CAknPopupList::NewL(
list,
R_AVKON_SOFTKEYS_SELECT_CANCEL,
AknPopupLayouts::EMenuWindow);
CleanupStack::PushL( popupList );
popupList->SetMaximumHeight(2);
list->ConstructL( popupList, CEikListBox::ELeftDownInViewRect );
list->CreateScrollBarFrameL( ETrue );
list->ScrollBarFrame()->SetScrollBarVisibilityL(
CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
CTextListBoxModel* model = list->Model();
model->SetItemTextArray( items );
model->SetOwnershipType( ELbmOwnsItemArray );
count = GetPhotoCount();
// TInt price;
// TLex lex(iPhotosAppUi->iCharge);
// lex.Val(price);
// count = count * price;
// TBuf<30> temp;
// temp.AppendNum(count);
// msg.Copy(_L("Charge "));
// msg.Append(temp);
// msg.Append(_L(" pesos"));
//msg.Copy(_L("Select Album:"));
//msg.Copy(*(iEikonEnv->AllocReadResourceL(R_IMAGES_SELECT_ALBUM)));
/*count = count / 3;
temp.Copy(_L(""));
temp.AppendNum(count);
path = iPhotosAppUi->ImageFolderPath();
if(path == 0 || path == 1)
msg.Append(_L(" Photos)"));
else if(path == 2 || path == 3)
msg.Append(_L(" Videos)"));*/
popupList->SetTitleL(*(iEikonEnv->AllocReadResourceL(R_IMAGES_SELECT_ALBUM)));
PopValue = popupList->ExecuteLD();
if(PopValue==0)
{
iFolderStatus=-1;
}
else if(PopValue==1)
{
PopValue=list->CurrentItemIndex();
iFolderStatus=PopValue;
TPtrC ptr1(items->MdcaPoint(PopValue));
comment.Copy(ptr1);
}
items->Reset();
CleanupStack::Pop(); // popupList
CleanupStack::PopAndDestroy(); // list
}