本文整理汇总了C++中CArrayPtr::AppendL方法的典型用法代码示例。如果您正苦于以下问题:C++ CArrayPtr::AppendL方法的具体用法?C++ CArrayPtr::AppendL怎么用?C++ CArrayPtr::AppendL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CArrayPtr
的用法示例。
在下文中一共展示了CArrayPtr::AppendL方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ResetSkinChooseItem
void CYCSettingList::ResetSkinChooseItem()
{
CAknEnumeratedTextPopupSettingItem* item = (CAknEnumeratedTextPopupSettingItem*)(this->SettingItemArray()->At(ELTSettingSkinChosse));
CArrayPtr<CAknEnumeratedText>* texts = item->EnumeratedTextArray();
texts->ResetAndDestroy();
HBufC* textDef = StringLoader::LoadLC(R_TEXT_DEFAULT);
CAknEnumeratedText* enumTextDef = new (ELeave) CAknEnumeratedText(0, textDef);
CleanupStack::Pop(textDef);
CleanupStack::PushL(enumTextDef);
texts->AppendL(enumTextDef);
CleanupStack::Pop(enumTextDef);
RPointerArray<SkinImageStruct>& skins = iScaner->GetSkins();
for (TInt i=0; i<skins.Count(); i++)
{
pSkinImageStruct sk = skins[i];
CAknEnumeratedText* enumText;
HBufC* text = sk->iShortName.AllocLC();
enumText = new (ELeave) CAknEnumeratedText(sk->iIndex+1, text);
CleanupStack::Pop(text);
CleanupStack::PushL(enumText);
texts->AppendL(enumText);
CleanupStack::Pop(enumText);
}
}
示例2: SetIconsArray
void CMessageListBox::SetIconsArray()
{
CArrayPtr<CGulIcon>* iconArray = new (ELeave)
CArrayPtrFlat<CGulIcon>(2);
CleanupStack::PushL(iconArray);
TBuf<128> path;
path = CRippleVaultAppUi::ApplicationDriveAndPath();
path.Append(KS80SmsMbmFileName);
iconArray->AppendL(iEikonEnv->CreateIconL(path,
EMbmS80smsInbox, EMbmS80smsInboxm));
iconArray->AppendL(iEikonEnv->CreateIconL(path,
EMbmS80smsSent, EMbmS80smsSentm));
CleanupStack::Pop(); // iconArray
// Set the listbox's first column to fill the listbox's whole width
CColumnListBoxData* colData = iListbox->ItemDrawer()->ColumnData();
if(colData)
{
colData->SetIconArray(iconArray);
colData->SetGraphicsColumnL(0, ETrue);
colData->SetColumnWidthPixelL(0, 30);
colData->SetColumnAlignmentL(0, CGraphicsContext::ELeft);
colData->SetColumnWidthPixelL(1, 100);
}
iListbox->SetItemHeightL(30);
}
示例3: AddIconL
TInt CJuikIconManagerImpl::AddIconL(TInt aProviderId, CGulIcon* aIcon)
{
CALLSTACKITEM_N(_CL("CJuikIconManagerImpl"), _CL("AddIconL"));
auto_ptr<CGulIcon> icon( aIcon );
CArrayFix<TInt>& map = ProviderIconIndexL(aProviderId);
TInt ix = KErrNotFound;
if ( iEmptySlotCount > 0 )
ix = FindEmptySlotL();
if ( ix == KErrNotFound )
{
iIconArray->AppendL( icon.release() );
map.AppendL( LastIndex( *iIconArray ) );
}
else
{
iEmptySlotCount--;
if ( iEmptySlotCount < 0 ) Bug( _L("Empty slot count underflow") ).Raise();
(*iIconArray)[ix] = icon.release();
map.AppendL( ix );
}
return LastIndex( map );
}
示例4: DecodeSequenceLC
// -----------------------------------------------------------------------------
// CCMSX509GeneralNames::DecodeL
// Decrypts raw data to this instance
// -----------------------------------------------------------------------------
void CCMSX509GeneralNames::DecodeL( const TDesC8& aRawData )
{
CArrayPtr< TASN1DecGeneric >* nameData =
DecodeSequenceLC( aRawData );
TInt nameCount = nameData->Count();
if( nameCount == 0 )
{
User::Leave( KErrArgument );
}
CArrayPtr< CCMSX509GeneralName >* names =
new( ELeave ) CArrayPtrFlat< CCMSX509GeneralName >( nameCount );
CleanupStack::PushL( names );
for( TInt i = 0; i < nameCount; i++ )
{
CCMSX509GeneralName* name = CCMSX509GeneralName::NewL( );
CleanupStack::PushL( name );
name->DecodeL( nameData->At( i )->Encoding() );
names->AppendL( name );
}
CleanupStack::Pop( nameCount ); // names
CleanupStack::Pop( names );
CleanupStack::PopAndDestroy( nameData );
if( iGeneralNames )
{
iGeneralNames->ResetAndDestroy();
delete iGeneralNames;
}
iGeneralNames = names;
}
示例5: new
// -----------------------------------------------------------------------------
// CCMSX509GeneralNames::SetGeneralNamesL
// GeneralNames setter
// -----------------------------------------------------------------------------
EXPORT_C void CCMSX509GeneralNames::SetGeneralNamesL(
const CArrayPtr< CCMSX509GeneralName >& aGeneralNames )
{
TInt nameCount = aGeneralNames.Count();
if( nameCount == 0 )
{
User::Leave ( KErrArgument );
}
CArrayPtr< CCMSX509GeneralName >* names =
new( ELeave ) CArrayPtrFlat< CCMSX509GeneralName >( nameCount );
CleanupStack::PushL( names );
for( TInt i = 0; i < nameCount; i++ )
{
CCMSX509GeneralName* origName = aGeneralNames[ i ];
CCMSX509GeneralName* name =
CCMSX509GeneralName::NewL( origName->Tag(), origName->Data() );
CleanupStack::PushL( name );
names->AppendL( name );
}
CleanupStack::Pop( nameCount ); // names
CleanupStack::Pop( names );
if( iGeneralNames )
{
iGeneralNames->ResetAndDestroy();
delete iGeneralNames;
}
iGeneralNames = names;
}
示例6: CreateSkinChooseItem
CAknSettingItem* CYCSettingList::CreateSkinChooseItem(TInt aSettingId)
{
TBool isNumberedStyle = this->IsNumberedStyle();
CArrayPtr<CGulIcon>* icons = this->ListBox()->ItemDrawer()->FormattedCellData()->IconArray();
CAknEnumeratedTextPopupSettingItem* item = new (ELeave) CAknEnumeratedTextPopupSettingItem(aSettingId, iSkinChoose);
CleanupStack::PushL(item);
HBufC* textResource= NULL;
textResource = StringLoader::LoadLC(R_TEXT_SETTING_SKIN_CHOOSE);
// The same resource id can be used for multiple enumerated text setting pages.
item->ConstructL(isNumberedStyle, aSettingId, textResource->Des(), icons,
R_ENUMERATEDTEXT_SETTING_PAGE, -1, 0, R_POPUP_SETTING_TEXTS);
// Load texts dynamically.
CArrayPtr<CAknEnumeratedText>* texts = item->EnumeratedTextArray();
texts->ResetAndDestroy();
HBufC* textDef = StringLoader::LoadLC(R_TEXT_DEFAULT);
CAknEnumeratedText* enumTextDef = new (ELeave) CAknEnumeratedText(0, textDef);
CleanupStack::Pop(textDef);
CleanupStack::PushL(enumTextDef);
texts->AppendL(enumTextDef);
CleanupStack::Pop(enumTextDef);
RPointerArray<SkinImageStruct>& skins = iScaner->GetSkins();
for (TInt i=0; i<skins.Count(); i++)
{
pSkinImageStruct sk = skins[i];
CAknEnumeratedText* enumText;
HBufC* text = sk->iShortName.AllocLC();
enumText = new (ELeave) CAknEnumeratedText(sk->iIndex+1, text);
CleanupStack::Pop(text);
CleanupStack::PushL(enumText);
texts->AppendL(enumText);
CleanupStack::Pop(enumText);
}
this->SettingItemArray()->AppendL(item);
CleanupStack::PopAndDestroy(textResource);
CleanupStack::Pop(item);
return item;
}
示例7: AddEnumeratedLanguageL
void AddEnumeratedLanguageL(CArrayPtr<CAknEnumeratedText>& aArray,
TInt aEnum, HBufC* aText)
{
CAknEnumeratedText* text = new (ELeave) CAknEnumeratedText(aEnum, aText);
CleanupStack::PushL(text);
aArray.AppendL(text);
CleanupStack::Pop(text);
}
示例8: ConstructL
// ---------------------------------------------------------
// CSymTorrentSearchContainer::ConstructL
// EPOC two phased constructor
// ---------------------------------------------------------
//
void CSymTorrentSearchContainer::ConstructL(const TRect& aRect,
CSymTorrentAppUi* aAppUi, CSTTorrentManager* aTorrentMgr)
{
iAppUi=aAppUi;
iTorrentMgr=aTorrentMgr;
CreateWindowL();
iListBox = new (ELeave) CAknDoubleGraphicStyleListBox();
iListBox->SetMopParent(this);
iListBox->ConstructL(this, EAknListBoxSelectionList);
iListBox->SetContainerWindowL(*this);
iListBox->View()->SetListEmptyTextL(_L("(empty)"));
//create scrollbar
iListBox->CreateScrollBarFrameL();
iListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
CArrayPtr<CGulIcon>* icons = new (ELeave) CAknIconArray(1); // must be initialized with the number of icons used by the list!
CleanupStack::PushL(icons);
#ifdef EKA2
{
CGulIcon* chainLinkIcon = CGulIcon::NewL();
CleanupStack::PushL(chainLinkIcon);
CFbsBitmap* chainLinkBmp = NULL;
CFbsBitmap* chainLinkMask = NULL;
AknIconUtils::CreateIconLC(chainLinkBmp, chainLinkMask, KBitmapFile,
EMbmSymtorrentChainlink, EMbmSymtorrentChainlink_mask);
chainLinkIcon->SetBitmap(chainLinkBmp);
chainLinkIcon->SetMask(chainLinkMask);
CleanupStack::Pop(2);
icons->InsertL(0, chainLinkIcon);
CleanupStack::Pop();
}
#else
{
CEikonEnv* eikEnv = CEikonEnv::Static();
icons->AppendL(eikEnv->CreateIconL(KBitmapFile,
EMbmSymtorrentChainlink, EMbmSymtorrentChainlink_mask));
}
#endif
CleanupStack::Pop(icons); // icons
iListBox->ItemDrawer()->ColumnData()->SetIconArray(icons);
SetRect(aRect);
CDesCArray* itemArray = static_cast<CDesCArray*>
(iListBox->Model()->ItemTextArray());
itemArray->InsertL(0, _L("0\tFirst line\tSecond line"));
ActivateL();
}
示例9: AddItemL
void CMainMenuGridContainer::AddItemL(TInt aBitmapId, TInt aMaskId,
TInt aIndex)
{
CArrayPtr<CGulIcon>* icons =
iGrid->ItemDrawer()->FormattedCellData()->IconArray();
if (!icons) {
icons = new ( ELeave ) CAknIconArray(9);
iGrid->ItemDrawer()->FormattedCellData()->SetIconArrayL(icons);
}
CleanupStack::PushL(icons);
CFbsBitmap* bitmap;
CFbsBitmap* mask;
#ifdef NAV2_CLIENT_SERIES60_V3
AknIconUtils::CreateIconL(bitmap, mask, iView->GetMbmName(),
aBitmapId, aMaskId);
AknIconUtils::SetSize(bitmap, iIconRect.Size(),
EAspectRatioPreservedAndUnusedSpaceRemoved);
#else
bitmap = iEikonEnv->CreateBitmapL(iView->GetMbmName(), aBitmapId);
mask = iEikonEnv->CreateBitmapL(iView->GetMbmName(), aMaskId);
#endif
CleanupStack::PushL(bitmap);
CleanupStack::PushL(mask);
if (aIndex >= 0 && aIndex < icons->Count()) {
icons->InsertL(aIndex, CGulIcon::NewL(bitmap, mask));
} else {
icons->AppendL(CGulIcon::NewL(bitmap, mask));
}
CleanupStack::Pop(mask);
CleanupStack::Pop(bitmap);
CleanupStack::Pop(icons);
_LIT(KItem, "%d\t\t0");
TBuf<8> buf;
MDesCArray* array = iGrid->Model()->ItemTextArray();
CDesCArray* cArray = (CDesCArray*)array;
if (aIndex >= 0 && aIndex < icons->Count()) {
buf.Format(KItem, aIndex);
cArray->InsertL(aIndex, buf);
aIndex++;
//We need to delete and re-index the array since we inserted
//a new icon in the icon array.
cArray->Delete(aIndex, icons->Count() - aIndex);
for (TInt i = aIndex; i < icons->Count(); i++) {
buf.Format(KItem, i);
cArray->AppendL(buf);
}
} else {
buf.Format(KItem, (icons->Count() - 1));
cArray->AppendL(buf);
}
//Inform list box that data was added.
iGrid->HandleItemAdditionL();
}
示例10: PostLayoutDynInitL
void CFileSelectDialog::PostLayoutDynInitL()
{
CAknListQueryDialog::PostLayoutDynInitL();
CArrayPtr<CGulIcon>* icons;
icons=new (ELeave) CAknIconArray(1);
CGulIcon* icon = AknsUtils::CreateGulIconL(AknsUtils::SkinInstance(),KAknsIIDQgnPropEmpty, AknIconUtils::AvkonIconFileName(),EMbmAvkonQgn_prop_empty,EMbmAvkonQgn_prop_empty_mask);
icon->SetBitmapsOwnedExternally(EFalse);
icons->AppendL(icon);
SetIconArrayL(icons);
Update();
Show();
}
示例11: SetBearerListL
void CDirectPrintPrinterSettingView::SetBearerListL(CAknEnumeratedTextPopupSettingItem* item)
{
TInt err = GetBearerMgr()->GetProtocolNames(iBearerList);
if (!err)
{
CArrayPtr<CAknEnumeratedText>* textArray = item->EnumeratedTextArray();
textArray->ResetAndDestroy();
TInt count = iBearerList.Count();
for (TInt i=0; i<count; i++)
{
CAknEnumeratedText* enumText = new (ELeave) CAknEnumeratedText(i, iBearerList[i].iName.AllocLC());
CleanupStack::Pop();
CleanupStack::PushL(enumText);
textArray->AppendL(enumText);
CleanupStack::Pop();
}
}
}
示例12: ReplaceIconL
void CJuikIconManagerImpl::ReplaceIconL(TInt aProviderId, TInt aIconId, CGulIcon* aIcon)
{
CALLSTACKITEM_N(_CL("CJuikIconManagerImpl"), _CL("ReplaceIconL"));
auto_ptr<CGulIcon> icon( aIcon );
CArrayFix<TInt>& map = ProviderIconIndexL(aProviderId);
AssertIndexL( map, aIconId );
TInt ix = map.At( aIconId );
if ( ix != KErrNotFound )
{
AssertIndexL( *iIconArray, ix );
delete (*iIconArray)[ix];
(*iIconArray)[ix] = icon.release();
}
else
{
iIconArray->AppendL( icon.release() );
map[aIconId] = LastIndex( *iIconArray );
}
}
示例13: TestLqdlgSetIconArrayL
// -----------------------------------------------------------------------------
// CTestSDKQueries::TestLqdlgSetIconArrayL
// -----------------------------------------------------------------------------
//
TInt CTestSDKQueries::TestLqdlgSetIconArrayL( CStifItemParser& /*aItem*/ )
{
TInt selectedOption( KZero );
CDesCArrayFlat* mArray = new (ELeave) CDesCArrayFlat( KTen );
CleanupStack::PushL( mArray );
TBuf< KTen > palabra;
for (TInt num = KZero; num< KTen; num++)
{
palabra.Format(_L("option %d"), num);
mArray->AppendL(palabra);
}
CAknListQueryDialog* dlg = new( ELeave ) CAknListQueryDialog( &selectedOption );
dlg->PrepareLC( R_UPDATE_QUERY_DIALOG );
dlg->SetItemTextArray( mArray );
dlg->SetOwnershipType( ELbmDoesNotOwnItemArray );
TFileName file( KTestMbmFile );
User::LeaveIfError( CompleteWithAppPath( file ) );
CArrayPtr<CGulIcon>* mIcons = new(ELeave) CAknIconArray( KFive );
CleanupStack::PushL(mIcons);
CFbsBitmap* bitmap = NULL;
CFbsBitmap* mask = NULL;
AknIconUtils::CreateIconLC( bitmap, mask, file, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask );
CGulIcon* mIcon = CGulIcon::NewL( bitmap, mask );
CleanupStack::PushL( mIcon );
mIcons->AppendL( mIcon );
dlg->SetIconArrayL( mIcons );
CleanupStack::Pop( mIcon );
CleanupStack::Pop( KThree );
CleanupStack::PopAndDestroy( dlg );
CleanupStack::Pop( KOne );
return KErrNone;
}
示例14: BuildTopLevelRtNodesListLC
void CDmAdEngine::BuildTopLevelRtNodesListLC(CArrayPtr<CDmAdRtNode>* aRtNodes,
CArrayPtr<CDmAdRtNode>*& aTopLevelRtNodes)
{
CArrayPtr<CDmAdRtNode>* rtNodesList;
rtNodesList = new (ELeave) CArrayPtrFlat<CDmAdRtNode>(4);
CleanupStack::PushL(TCleanupItem(CDmAdRtNode::CleanupOperationDeleteCArrayPtr,
rtNodesList));
for (TInt i=0; i < aRtNodes->Count(); i++)
{
CDmAdRtNode* rtNode = aRtNodes->At(i);
if (iDdfApi->IsTopLevelRtNode(rtNode->Uri()))
{
rtNodesList->AppendL(rtNode);
aRtNodes->Delete(i);
i--;
}
}
aTopLevelRtNodes = rtNodesList;
}
示例15: BuildChildRtNodesListLC
void CDmAdEngine::BuildChildRtNodesListLC(CArrayPtr<CDmAdRtNode>* aRtNodes,
const TDesC8& aSomeParentUri,
CArrayPtr<CDmAdRtNode>*& aChildRtNodes)
{
CArrayPtr<CDmAdRtNode>* rtNodesList;
rtNodesList = new (ELeave) CArrayPtrFlat<CDmAdRtNode>(4);
CleanupStack::PushL(TCleanupItem(CDmAdRtNode::CleanupOperationDeleteCArrayPtr,
rtNodesList));
for (TInt i=0; i < aRtNodes->Count(); i++)
{
CDmAdRtNode* rtNode = aRtNodes->At(i);
if (rtNode->IsSomeChild(aSomeParentUri))
{
rtNodesList->AppendL(rtNode);
aRtNodes->Delete(i);
i--;
}
}
aChildRtNodes = rtNodesList;
}