当前位置: 首页>>代码示例>>C++>>正文


C++ CArrayFixFlat::At方法代码示例

本文整理汇总了C++中CArrayFixFlat::At方法的典型用法代码示例。如果您正苦于以下问题:C++ CArrayFixFlat::At方法的具体用法?C++ CArrayFixFlat::At怎么用?C++ CArrayFixFlat::At使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CArrayFixFlat的用法示例。


在下文中一共展示了CArrayFixFlat::At方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PostEvent

void CContextMediaArrayImpl::PostEvent(CCMPost* aParent, CCMPost* aChild, TEvent aEvent)
{
	CALLSTACKITEM_N(_CL("CContextMediaArrayImpl"), _CL("PostEvent"));
	
	if (aParent != iParentPost) return;

	if (aEvent==EChildAdded) {
		iPostIdArray->AppendL(aChild->iPostId());
		iPostArray->AppendL(0);
		iObserver.PostEvent(aParent, aChild, aEvent);
	}

	if (aEvent==EPlaceholderFilled) {
		TInt i;
		for (i=0; i<iPostIdArray->Count();i++) {
			if (iPostIdArray->At(i) == aChild->iPostId()) {
				CC_TRAPD(ignore, iStorage.Release(iPostArray->At(i), 0));
				iPostArray->At(i) = 0;
				iObserver.PostEvent(aParent, aChild, aEvent);
				return;
			}
		}
	}

	if (aEvent==EPostHidden) {
		ReadFromStorage();
		iObserver.PostEvent(aParent, aChild, aEvent);
	}

	if (aEvent==EPostVisible) {
		ReadFromStorage();
		iObserver.PostEvent(aParent, aChild, aEvent);
	}

	if (aEvent==EPostUpdated) {
		iObserver.PostEvent(aParent, aChild, aEvent);
	} 

	if ((aEvent==EThumbnailLoaded) || (aEvent==EUnreadChanged)) {
		iObserver.PostEvent(aParent, aChild, aEvent);
	}

	if (aEvent==ELastPostChanged) {
		iObserver.PostEvent(aParent, aChild, aEvent);
	}
	
	//do nothing for:
	//	EMediaLoaded,
	//	EErrorUpdated,
}
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:50,代码来源:medialistbox.cpp

示例2: if

TUint32 CIkev2NatT::CheckPeerNotifysL(const CArrayFixFlat<TNotifPayloadIkev2*>& aNotifys, 
                                      const TInetAddr& aLocalAddr, const  TInetAddr& aRemoteAddr, TUint16 aPort, 
									  const TDesC8& aInitiatorSpi, const TDesC8& aResponderSpi, TBool& aSupported)
{    
  //
  // Check does there exists NAT_DETECTION_SOURCE_IP and NAT_DETECTION_DESTINATION_IP
  // Notify payload. If found compare payload data to local end NAT
  // traversal data as follows:
  // -- NAT_DETECTION_SOURCE_IP Notifys are examined against local Notify
  //    payload iDstIdentiy data: If no match found
  //    ==> Peer is behind  NAT
  // -- NAT_DETECTION_DESTINATION_IP Notify is examined against local Notify
  //    payload iSrcIdentiy data: If no match found
  //    ==> Local end behind NAT
  //
    aSupported = EFalse;
	TInt Count = aNotifys.Count();

	CIkev2NatT* RefObj = CIkev2NatT::NewL(aLocalAddr, aRemoteAddr, aPort, 
                                          aInitiatorSpi, aResponderSpi);
	 
	TNotifPayloadIkev2* PeerNotify;
	TUint32 PeerLth;
	TBool SrcMatch   = EFalse;
	TBool DstMatch   = EFalse;	
    TUint32 NatFlags = 0;
    TInt i = 0;

	while ( i < Count )
	{
		PeerNotify = aNotifys.At(i);
		if ( (PeerNotify->GetMsgType() == NAT_DETECTION_SOURCE_IP) && !SrcMatch )
		{
			NatFlags |= REMOTE_END_NAT;
			PeerLth = TPayloadIkev2::Cast(PeerNotify)->GetLength() - (TUint32)(PeerNotify->Size() + PeerNotify->GetSPISize());
			const TPtrC8 peerNotify(PeerNotify->NotifData(), PeerLth);
			if ( RefObj->DestinNofify().Compare(peerNotify) == 0)
			{
				SrcMatch  = ETrue;
				NatFlags &= ~REMOTE_END_NAT;
			}	
		}
		else if ( (PeerNotify->GetMsgType() == NAT_DETECTION_DESTINATION_IP) && !DstMatch )
		{
			aSupported = ETrue;						
			NatFlags  |= LOCAL_END_NAT;
			PeerLth = TPayloadIkev2::Cast(PeerNotify)->GetLength() - (TUint32)(PeerNotify->Size() + PeerNotify->GetSPISize()); 
			const TPtrC8 peerNotify(PeerNotify->NotifData(), PeerLth);
			if ( RefObj->SourceNofify().Compare(peerNotify) == 0 )
			{
				DstMatch  = ETrue;							
				NatFlags &= ~LOCAL_END_NAT;
			}	
		}			
	    i ++;
    }

	delete RefObj;	
    return NatFlags;     
}
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:60,代码来源:ikev2natt.cpp

示例3: GetPostAt

CCMPost*  CContextMediaArrayImpl::GetPostAt(TInt aIndex)
{
	CALLSTACKITEM_N(_CL("CContextMediaArrayImpl"), _CL("GetPostAt"));

	if (aIndex<0) return 0;
	if ((iItem!=ENone) && (aIndex==0)) return 0;

	if (iOrder==CPostStorage::EDescending) {
		aIndex=MdcaCount()-aIndex-1;
	}

	if (!iPostArray->At(aIndex)) {
		iPostArray->At(aIndex)=iStorage.GetByPostIdL(0, iPostIdArray->At(aIndex));
	}

	return iPostArray->At(aIndex);
}
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:17,代码来源:medialistbox.cpp

示例4: CloseArrayOfCallObjects

LOCAL_C void CloseArrayOfCallObjects(TAny* aCallArray)
/**
Close and delete the call object array.
*/
	{
	CArrayFixFlat<RMobileCall>* callArray = reinterpret_cast<CArrayFixFlat<RMobileCall>*>(aCallArray);
	TInt count = callArray->Count();
	for (TInt i=count-1; i>=0; --i)
		{
		callArray->At(i).Close();
		}	
	delete callArray;
 	callArray = NULL; 	
	}
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:14,代码来源:TelephonyFuncLine.cpp

示例5: WrapTitleTextL

// ---------------------------------------------------------------------------
// CAknDiscreetPopupDrawer::WrapTitleTextL
// Wraps long text to two lines.
// ---------------------------------------------------------------------------
//
void CAknDiscreetPopupDrawer::WrapTitleTextL()
    {
    CArrayFixFlat<TInt>* lineWidths 
        = new ( ELeave ) CArrayFixFlat<TInt>( KMaxNumOfLines );
    CleanupStack::PushL( lineWidths );
    CArrayFixFlat<TPtrC>* wrappedArray
        = new ( ELeave ) CArrayFixFlat<TPtrC>( KMaxNumOfLines );
    CleanupStack::PushL( wrappedArray );

    for ( TInt i = 0; i < KMaxNumOfLines; i++ )
        {
        lineWidths->AppendL( iTitleTextData.iTextRect.Width() );
        }

    HBufC* visualBuffer = HBufC::NewLC( 
            iTitleText->Length() + KMaxNumOfLines * KAknBidiExtraSpacePerLine );
    *visualBuffer = *iTitleText;
    TPtr ptr( visualBuffer->Des() );

    AknBidiTextUtils::ConvertToVisualAndWrapToArrayL(
            ptr, *lineWidths, *iTitleTextData.iTextFont, *wrappedArray, ETrue );

    if ( wrappedArray->Count() && wrappedArray->At( 1 ) != KNullDesC )
        {
        delete iTitleText;
        iTitleText = NULL;
        delete iBodyText;
        iBodyText = NULL;
        iTitleText = wrappedArray->At( 0 ).AllocL();
        iBodyText = wrappedArray->At( 1 ).AllocL();
        }

    CleanupStack::PopAndDestroy( visualBuffer );
    CleanupStack::PopAndDestroy( wrappedArray );
    CleanupStack::PopAndDestroy( lineWidths );
    }
开发者ID:cdaffara,项目名称:symbiandump-mw1,代码行数:41,代码来源:akndiscreetpopupdrawer.cpp

示例6: changeLanguage

/*!
    \brief Returns names and identifiers of supported languages in a phone.
 
    Language names are localized according the language's native presentation.
    Language ID's returned by this functions may be used as language parameter for changeLanguage(int language) function.
    Language IDs and names are OS specific and may vary across the platforms and releases.
    
    \attention Symbian specific API
    
    \deprecated HbLanguageUtil::supportedLanguages()
        is deprecated. Please use HbLocaleUtil::supportedLanguages() instead.
     
    \return Symbian - localized names and integer identifiers of languages supported in a device  
    \return other platforms - empty QHash    
*/
QHash<int, QString> HbLanguageUtil::supportedLanguages()
{
#if defined(Q_OS_SYMBIAN)   
    QHash<int, QString> languages; 
    
    QTranslator translator;
    QString path = "c:";
    path += QString(TRANSLATOR_PATH);
    if (!translator.load(path)) {
        path = "z:";
        path += QString(TRANSLATOR_PATH);
        if (!translator.load(path)) {
            return languages;
        } 
    } 

    QCoreApplication::installTranslator(&translator);
    QHash<int, QString> hashLanguageNames = readLanguageList();
 
    CArrayFixFlat<TInt>* systemEpocLanguageCodes = 0;
    TInt error = SysLangUtil::GetInstalledLanguages( systemEpocLanguageCodes );
    if ( error != KErrNone ) {
        delete systemEpocLanguageCodes;
        return languages;
    }
    
    for (int i = 0; i < systemEpocLanguageCodes->Count(); ++i) {
        int code = systemEpocLanguageCodes->At(i);
        QString id = QString(LANGUAGE_ID_PREFIX);
        id += QString::number(code);
        QString locName = hbTrId(id.toAscii().constData());
        if (locName.isEmpty() || locName == id) {
            locName = hashLanguageNames.value(code);
        }
        languages.insert(code, locName);
    }
    
    delete systemEpocLanguageCodes;
    return languages;
#else 
    QHash<int, QString> dummy;
    return dummy;
#endif
}
开发者ID:kuailexs,项目名称:symbiandump-mw1,代码行数:59,代码来源:hblanguageutil.cpp

示例7: DoBuildL


//.........这里部分代码省略.........
                CleanupStack::PushL(buf);

                // one line may create several wrapped lines
                lineCount += linePtrs->Count();

                if (aRasterizeFlags != ERasterizeNone)
                  	{    

                    // create new entries..
                    while (iLines.Count() < lineCount)
                        {
                        SRasterizedLine line;
                        line.iTexture = NULL;
                        line.iGap = 0;
                        iLines.AppendL(line);

                        if (iPictographInterface)
                            {
                            SRasterizedLine pictographline;
                            pictographline.iTexture = NULL;
                            pictographline.iGap = 0;
                            iPictographLines.AppendL(pictographline);                                
                            }
                        }
                    
                   	// Do rasterisation if we want to render to texture.
                    for(TInt i = 0; i < linePtrs->Count(); ++i)
                        {
                        TInt currentLine = (lineCount - linePtrs->Count()) + i;   
          	   	                
    	                if (aRasterizeFlags & ERasterizeText)
    	                    {
                            // rasterize a single line (updates texture in iLines[i].iTexture)
                            RasterizeLineL(linePtrs->At(i), iLines[currentLine]);
    	                    }
    	                    
	                    if (aRasterizeFlags & ERasterizePictographs && iPictographInterface)
	                        {
                            // Rasterize pictographs if needed
                            RasterizePictographLineL(linePtrs->At(i), font, iPictographLines[currentLine]);                                                                 	                            
	                        }
           	                // Get extents from the texture we just created
                            CHuiTexture* tex = iLines[i].iTexture;
                            extents.iHeight += iLines[i].iGap;
                            
                            if(tex)
                                {
                                extents.iWidth = Max(extents.iWidth, tex->Size().iWidth);
                                extents.iHeight += tex->Size().iHeight;
                                }    
                            	                                                         
    	                TBool moreAvailable = (currentLine + 1 < MaxLineCount());
                        if (!moreAvailable)
          	                {
       	                    // Maximum number of lines reached.
       	                    break;
       	                    }
                        }
                  	}
   	            else
   	                {
                    // Don't rasterise or create textures, just get the extents of this text.   	                    
                    for(TInt i = 0; i < linePtrs->Count(); ++i)
                        {  
                        TSize lineExtents = textStyle->LineExtentsL(linePtrs->At(i));
                        extents.iWidth = Max(extents.iWidth, lineExtents.iWidth);
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:67,代码来源:HuiRasterizedTextMesh.cpp

示例8:

TBool Ikev2MobIke::ProcessNotifysL(CIkev2Negotiation* aNegotiation, 
                                   const CArrayFixFlat<TNotifPayloadIkev2*>& aNotifys, 
                                   TBool aRequest, TInt aExchange)
{
    __ASSERT_DEBUG(aNegotiation, User::Invariant());
	if ( !aNegotiation->iHdr.iIkeData->iUseMobIke )
	{
		return EFalse; 
	}
	 
	TInt MsgType;
	TNotifPayloadIkev2* Payload;
	TPtrC8 Cookie2(NULL,0);
	TBool  NatDetection = EFalse;
	TBool  Status        = EFalse;
	TInt   Count = aNotifys.Count();
	TInt i      = 0;

	while ( i < Count )
	{
		
		Payload = aNotifys.At(i);
		MsgType = (TInt)Payload->GetMsgType();
		// 
		//  Process possible MOBIKE Notify messages 
		//
		switch ( MsgType )
		{

			case MOBIKE_SUPPORTED:
				//
				// Remote end supports MOBIKE protocol
				//
			    aNegotiation->iHdr.iMobikeUsed  = ETrue;
			    aNegotiation->iHdr.iFloatedPort = ETrue;  // Floated port used for now 			
			    aNegotiation->iHdr.iDestinAddr.SetPort(FLOATED_IKE_PORT);			
				break;

			case ADDITIONAL_IPV4_ADDRESS:
			case ADDITIONAL_IPV6_ADDRESS:				
				//
				// Additional IP addresses Notify
				//
				if ( aNegotiation->iHdr.iMobikeUsed && (aExchange == INFORMATIONAL) )
				{
					Status = ETrue;		
				}	
				break;

			case UPDATE_SA_ADDRESS:
				//
				// Peer informs about the IP address change
				//
				if ( aNegotiation->iHdr.iMobikeUsed && aRequest && (aExchange == INFORMATIONAL) )
				{
					aNegotiation->iIkeV2PlugInSession.RemoteAddrChanged(&aNegotiation->iHdr, aNegotiation->iHdr.iDestinAddr); 		
					Status = ETrue;		
				}	
				break;

			case COOKIE2:
				//
				// Peer informs about the IP address change
				//
				if ( aNegotiation->iHdr.iMobikeUsed && aRequest && (aExchange == INFORMATIONAL) )
				{
					Cookie2.Set(Payload->NotifData(), Payload->NotifDataLength());
					Status = ETrue;		
				}	
				break;

			case NAT_PREVENTION:
				//
				// NAT Prevention Notify
				//
				if ( aNegotiation->iHdr.iMobikeUsed  )
				{
					if ( aExchange == INFORMATIONAL ) 
					   Status = ETrue;		
				}	
				break;

			case UNACCPETABLE_ADDRESSES:
			case NAT_PREVENTED:
				if ( aNegotiation->iHdr.iMobikeUsed  )
				{					
					if ( aExchange == INFORMATIONAL ) 
					   Status = ETrue;		
				}	
				break;

			case NAT_DETECTION_SOURCE_IP:
			case NAT_DETECTION_DESTINATION_IP:
				if ( aNegotiation->iHdr.iMobikeUsed && (aExchange == INFORMATIONAL))
				{
					NatDetection = ETrue;		
					Status = ETrue;		
				}	
				break;
				
//.........这里部分代码省略.........
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:101,代码来源:ikev2mobike.cpp

示例9: GetCallInfoL

TInt CTelephonyFunctions::GetCallInfoL(TDes8& aCallSelect, TDes8& aCallInfo, TDes8& aRemoteInfo)
/**
Get the current call information.
*/
	{
    CTelephony::TCallSelectionV1& CallSelectionV1 = reinterpret_cast<CTelephony::TCallSelectionV1&> 
                                                        ( const_cast<TUint8&> ( *aCallSelect.Ptr() ) );
    
	if(CallSelectionV1.iLine != CTelephony::EVoiceLine)
		{
		return KErrAccessDenied;
		}

	if(IsFlightModeOn())
		{
		return KErrAccessDenied;
		}

    CTelephony::TCallInfoV1& CallInfoV1 = reinterpret_cast<CTelephony::TCallInfoV1&> 
                                                        ( const_cast<TUint8&> ( *aCallInfo.Ptr() ) );

    CTelephony::TRemotePartyInfoV1& RemotePartyInfoV1 = reinterpret_cast<CTelephony::TRemotePartyInfoV1&> 
                                                        ( const_cast<TUint8&> ( *aRemoteInfo.Ptr() ) );	

	TPtr8* callInfoPkgPtr;
	RMobileCall::TMobileCallInfoV1* callInfoObjPtr;

	if(iTsyVersion == KNoMultimodeTsy)
		{
		return KErrNotSupported;
		}
	else if(iTsyVersion==KETelExtMultimodeV1 || iTsyVersion==KETelExtMultimodeV2)
		{
		RMobileCall::TMobileCallInfoV1*  callInfoV1 = new(ELeave) RMobileCall::TMobileCallInfoV1; 
		CleanupStack::PushL(callInfoV1);
		RMobileCall::TMobileCallInfoV1Pckg* callInfoV1Pckg = new(ELeave) RMobileCall::TMobileCallInfoV1Pckg(*callInfoV1); 
		CleanupStack::PushL(callInfoV1Pckg);
		callInfoPkgPtr = callInfoV1Pckg;
		callInfoObjPtr = callInfoV1;
		}
	else	//TSY v3
		{
		RMobileCall::TMobileCallInfoV3*  callInfoV3 = new(ELeave) RMobileCall::TMobileCallInfoV3; 
		CleanupStack::PushL(callInfoV3);
		RMobileCall::TMobileCallInfoV3Pckg* callInfoV3Pckg = new(ELeave) RMobileCall::TMobileCallInfoV3Pckg(*callInfoV3); 
		CleanupStack::PushL(callInfoV3Pckg);
		callInfoPkgPtr = callInfoV3Pckg;
		callInfoObjPtr = callInfoV3;
		}
 
	TInt numOfCalls=0;
	User::LeaveIfError(iLineVoice.EnumerateCall(numOfCalls));
	if (numOfCalls==0)
		{
		User::Leave(KErrNotFound);
		}
	CArrayFixFlat<RMobileCall>* tempCallArray = new (ELeave) CArrayFixFlat<RMobileCall>(numOfCalls);
	CleanupStack::PushL(TCleanupItem(CloseArrayOfCallObjects, tempCallArray));
	TInt i;
	
	RLine::TCallInfo callinfo;
	RMobileCall::TMobileCallStatus callStatus;
	TBool callFound=EFalse;
	for(i=0; i<numOfCalls; i++)
   		{
   		User::LeaveIfError(iLineVoice.GetCallInfo(i,callinfo));
   		RMobileCall tempCall; 
 		
 		tempCallArray->AppendL(tempCall);
 		User::LeaveIfError(tempCallArray->At(i).OpenExistingCall(iLineVoice,callinfo.iCallName));
		User::LeaveIfError(tempCallArray->At(i).GetMobileCallStatus(callStatus));
		 				
		if((callStatus==RMobileCall::EStatusConnected) &&
			(CallSelectionV1.iSelect==CTelephony::EActiveCall))
			{
			User::LeaveIfError(tempCallArray->At(i).GetMobileCallInfo(*callInfoPkgPtr));
			callFound=ETrue;
			break;
			}
		else if((callStatus==RMobileCall::EStatusHold) &&
			(CallSelectionV1.iSelect==CTelephony::EHeldCall))
			{
			User::LeaveIfError(tempCallArray->At(i).GetMobileCallInfo(*callInfoPkgPtr));
			callFound=ETrue;
			break;
			}
		else if(((callStatus==RMobileCall::EStatusDialling) ||
			  	(callStatus==RMobileCall::EStatusRinging) ||
			 	(callStatus==RMobileCall::EStatusAnswering) ||
				(callStatus==RMobileCall::EStatusConnecting) ||
				(callStatus==RMobileCall::EStatusReconnectPending) ||
				(callStatus==RMobileCall::EStatusDisconnecting) ||
				(callStatus==RMobileCall::EStatusDisconnectingWithInband) ||
				(callStatus==RMobileCall::EStatusTransferring) ||
				(callStatus==RMobileCall:: EStatusTransferAlerting) 
				) &&
			(CallSelectionV1.iSelect==CTelephony::EInProgressCall))
			{
			User::LeaveIfError(tempCallArray->At(i).GetMobileCallInfo(*callInfoPkgPtr));
			callFound=ETrue;
//.........这里部分代码省略.........
开发者ID:cdaffara,项目名称:symbiandump-os1,代码行数:101,代码来源:TelephonyFuncLine.cpp

示例10: doTestStepL

// Each test step must supply a implementation for doTestStepL
enum TVerdict CTestAppLoaderEndTask::doTestStepL( void )
	{
	// Printing to the console and log file
	INFO_PRINTF1(_L("TEST-> END TASK"));

	TPtrC	program;
	if ( !GetStringFromConfig(ConfigSection(), KProgram, program) )
		{
		ERR_PRINTF2(KErrMissingParameter, &KProgram());
		SetTestStepResult(EFail);
		}
	else
		{
		RApaLsSession	apaLsSession;
		User::LeaveIfError(apaLsSession.Connect());
		CleanupClosePushL(apaLsSession);
	    User::LeaveIfError(apaLsSession.GetAllApps());

		RWsSession	ws;
		User::LeaveIfError(ws.Connect());
		CleanupClosePushL(ws);
		
	    TInt					numWindowGroups = ws.NumWindowGroups();
	    CArrayFixFlat<TInt>*	windowGroupList = new(ELeave) CArrayFixFlat<TInt>(numWindowGroups);
	    CleanupStack::PushL(windowGroupList);

	    // Populate array with current group list ids
	    User::LeaveIfError(ws.WindowGroupList(windowGroupList));

	    CApaWindowGroupName*	windowGroupName = CApaWindowGroupName::NewLC(ws);

	    /* Note: we use windowGroupList->Count() instead of numWindowGroups, as in the middle of the
	     * update the list could change in length (or worse, be reduced) thus producing an out of bounds
	     * error if numWindowGroups were used
	     */
	    TBool	searching=ETrue;
	    for ( TInt i=0; (i<windowGroupList->Count()) && searching; ++i )
	    	{
	        TInt	wgId = windowGroupList->At(i);
	        windowGroupName->ConstructFromWgIdL(wgId);

	        TUid	appUid = windowGroupName->AppUid();

	        TApaAppInfo	appInfo;
	        HBufC* 		appCaption = NULL;
	        // Some applications, like midlets, may not provide any info
	        if (apaLsSession.GetAppInfo(appInfo, appUid) == KErrNone)
	        	{
	            appCaption = appInfo.iCaption.AllocL();
	        	}
	        else
	        	{
	            appCaption = windowGroupName->Caption().AllocL();
	        	}
            CleanupStack::PushL(appCaption);

	        // Only list 'visible' applications
	        if ( appCaption->Length() )
	        	{
	            TPtrC	caption=*appCaption;
		        INFO_PRINTF2(KLogTask, &caption);

		        if ( program.CompareC(caption)==0 )
		        	{
					searching=EFalse;
					TApaTask	task(ws);
					task.SetWgId(wgId);
					if (task.Exists())
						{
						task.EndTask();
						}
					else
						{
						ERR_PRINTF2(KErrTaskNotFound, &program);
						SetTestStepResult(EFail);
						}
		        	}
				}
            CleanupStack::Pop(1, appCaption); // taskEntry, appCaption
	    	}

	    if ( searching )
	    	{
			ERR_PRINTF2(KErrTaskNotFound, &program);
			SetTestStepResult(EFail);
	    	}
	    CleanupStack::PopAndDestroy(4, &apaLsSession);    // windowGroupName, windowGroupList
		}

	// test steps return a result
	return TestStepResult();
	}
开发者ID:fedor4ever,项目名称:default,代码行数:93,代码来源:TestAppLoaderEndTask.cpp

示例11: DoBuildL


//.........这里部分代码省略.........
                        
                            TInt index = iLines.Count()-1;
                            // rasterize a single line (updates texture in iLines[0].iTexture)
                            RasterizeLineL(ptr, iLines[index], aTextStyle);                     

                            // Get extents from the texture we just created
                            CAlfTexture* tex = iLines[index].iTexture;
                            extents.iHeight += iLines[index].iGap;
                            if(tex)
                                {
                                extents.iWidth = Max(extents.iWidth, tex->Size().iWidth);
                                extents.iHeight += tex->Size().iHeight;
                                }                   
                    
                            CleanupStack::PopAndDestroy(buf);
                            lineCount--;
                            }
                        break;
                        }
                    } // fall through with single line
            case CAlfTextVisual::ELineWrapTruncate:
                {
                lineCount = 1; // there's always one line created per logical line
                HBufC* buf = text.AllocLC(); // todo.. is extra space required for bidi
                TPtr ptr = buf->Des();
                // truncate line
                AknBidiTextUtils::ConvertToVisualAndClipL(ptr, *font, maxWidth, maxWidth);
                // create the line entry if not already existing

                SRasterizedLine line;
                line.iTexture = NULL;
                line.iGap = 0;
                iLines.AppendL(line);
                        
 	            // rasterize a single line (updates texture in iLines[0].iTexture)
        	    RasterizeLineL(ptr, iLines[0], aTextStyle);	                    

   	            // Get extents from the texture we just created
                CAlfTexture* tex = iLines[0].iTexture;
                extents.iHeight += iLines[0].iGap;
                if(tex)
                    {
                    extents.iWidth = Max(extents.iWidth, tex->Size().iWidth);
                    extents.iHeight += tex->Size().iHeight;
                    }	                
                	
        	    CleanupStack::PopAndDestroy(buf);
                break;
                }

            case CAlfTextVisual::ELineWrapBreak:
                {
                // wrap lines to array
                linePtrs = new (ELeave) CArrayFixFlat<TPtrC>(KLineArrayGranularity);
                CleanupStack::PushL(linePtrs);
        
                buf = AknBidiTextUtils::ConvertToVisualAndWrapToArrayL(
                    text, maxWidth, *font, *linePtrs);
                CleanupStack::PushL(buf);

              	// Do rasterisation
                for(TInt i = 0; i < linePtrs->Count();i++)
                    {
                    SRasterizedLine line;
                    line.iTexture = NULL;
                    line.iGap = 0;
                    iLines.AppendL(line);
                        
                    // rasterize a single line (updates texture in iLines[i].iTexture)
                    RasterizeLineL(linePtrs->At(i), iLines[i], aTextStyle);
                    CAlfTexture* tex = iLines[i].iTexture;
                    extents.iHeight += iLines[i].iGap;
                            
                    if(tex)
                        {
                        extents.iWidth = Max(extents.iWidth, tex->Size().iWidth);
                        extents.iHeight += tex->Size().iHeight;
                        }    
                            	                                                         
                    if (i == iVisual->MaxLineCount()-1)
          	            {
       	                // Maximum number of lines reached.
       	                break;
       	                }
                    }
                CleanupStack::PopAndDestroy(buf);
                CleanupStack::PopAndDestroy(linePtrs);
                break;
                }
                
            default:
                break;
            }
            
        // Extents needs to be updated in order to make alignment 
        // work properly.
        iExtents = extents;

        UpdateDescriptorL();
        }
开发者ID:cdaffara,项目名称:symbiandump-mw4,代码行数:101,代码来源:alftextvisual.cpp

示例12: MdcaPoint

TPtrC16 CContextMediaArrayImpl::MdcaPoint(TInt aIndex) const
{
	CALLSTACKITEM_N(_CL("CContextMediaArrayImpl"), _CL("MdcaPoint"));

	if (aIndex>iPostArray->Count()) {
		User::Leave(KErrArgument);
	}

	if (!iStandAlone) {
		// ----- case first item in list ---------
		if (aIndex == 0) {
			if (iItem == EUseVCode) {
				iBuf->Des().Zero();
				iBuf->Des().AppendFormat(_L("%d\t"), KUseCodeIconIndex);
				iBuf->Des().Append(*iUseCode);
				iBuf->Des().Append(_L("\t\t\t"));
				return iBuf->Des();
			} else if (iItem == EAddReply) {
				iBuf->Des().Zero();
				if (iPostArray->Count()==0) {
					iBuf->Des().AppendFormat(_L("%d\t"), KReplyIconIndex);
					iBuf->Des().Append(*iFirstPost);
					iBuf->Des().Append(_L("\t\t\t"));
				} else {
					iBuf->Des().AppendFormat(_L("%d\t"), KReplyIconIndex);
					iBuf->Des().Append(*iAddReply);
					iBuf->Des().Append(_L("\t\t\t"));
				}
				return iBuf->Des();
			}
		}

	}

	// ---- normal case --------------------
	if (iOrder==CPostStorage::EDescending) {
		aIndex=MdcaCount()-aIndex-1;
	}
	if (iPostArray->At(aIndex) == 0) {
		iPostArray->At(aIndex) = iStorage.GetByPostIdL(0, iPostIdArray->At(aIndex));
	}
	
	iBuf->Des().Zero();
	const CCMPost * aPost = (*iPostArray)[aIndex];

	if (!iStandAlone) {
		TInt iconidx=aPost->GetThumbnailIndex();
		if (iconidx<0) iconidx=KUnknownIconIndex;
		
		if (aPost->iBodyText->Value().Compare(*iLoading) == 0) {
			iconidx = KUnknownIconIndex;
		} else if (aPost->iBodyText->Value().Compare(*iError)==0) {
			iconidx=KErrorIconIndex;
		}

		// First Line of the list box: icon_id, title, nb_unread
		iBuf->Des().AppendFormat(_L("%d\t"), iconidx);
	}

	// Loading indicator for thread ...
	TInt64 id = iPostIdArray->At(aIndex);
	TBool loading = ( (iNode == CPostStorage::RootId()) && 
		( (iNetwork.GetFetchStatus(id)==MNetworkStatus::EConnecting) ||
		(iNetwork.GetFetchStatus(id)==MNetworkStatus::EFetching) ) );
	if (loading) {
		if (aPost->iBodyText->Value().Length() == 0) {
			iBuf->Des().Append(*iNoTitle);
		} else {
			iBuf->Des().Append(aPost->iBodyText->Value().Left(15));
		}
		TTime now; now=GetTime(); 
		TInt sec = now.DateTime().Second();
		TInt dots = 6;
		TInt nb_dots = sec - ( dots*int(sec/dots));
		for (int i=0; i<=nb_dots; i++) {
			iBuf->Des().Append(_L("."));
		}
		iObserver.PostEvent(0, 0, EPostUpdated);
	} else {
		if (aPost->iBodyText->Value().Length() == 0) {
			iBuf->Des().Append(*iNoTitle);
		} else {
			iBuf->Des().Append(aPost->iBodyText->Value().Left(40));
		}
	}

	iBuf->Des().Append(_L("\t"));
	TInt unread = aPost->iUnreadCounter();
	if (unread>0) {
		iBuf->Des().AppendNum(unread );
	}

	if (! iStandAlone) {
		iBuf->Des().Append(_L("\t"));
	// Second and third Lines of the listbox
		if (aPost->iSender.iName().Compare(_L("?")) == 0) {
			iBuf->Des().Append(_L(" \t \t \t"));
		} else {
			if (iNode==CPostStorage::RootId()) {
				// second line
//.........这里部分代码省略.........
开发者ID:flaithbheartaigh,项目名称:jaikuengine-mobile-client,代码行数:101,代码来源:medialistbox.cpp

示例13: HandlePopUpMenuSelectionL

/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
TBool CMainContainer::HandlePopUpMenuSelectionL(TInt& aCommand)
{
	TBool ret(EFalse);
	
	TBool isEnable(EFalse),isDisable(EFalse),isRemove(EFalse),isaPreview(EFalse);
	ShowMenuItemsL(isEnable,isDisable,isRemove,isaPreview);
	
	if(!isRemove && !isaPreview){
		ret = ETrue;
		aCommand = EProfModify;
	}else{
	
		TBuf<100> hjelpper;
		CAknSinglePopupMenuStyleListBox* list = new(ELeave) CAknSinglePopupMenuStyleListBox;
		CleanupStack::PushL(list);
	
		CAknPopupList* popupList = CAknPopupList::NewL(list,R_AVKON_SOFTKEYS_OK_CANCEL);
		CleanupStack::PushL(popupList);
	
		list->ConstructL(popupList, CEikListBox::ELeftDownInViewRect);
		list->CreateScrollBarFrameL(ETrue);
		list->ScrollBarFrame()->SetScrollBarVisibilityL(CEikScrollBarFrame::EOff,CEikScrollBarFrame::EAuto);
	
		CArrayFixFlat<TInt>* cmdArray = new (ELeave) CArrayFixFlat<TInt>(5);
		CleanupStack::PushL(cmdArray);
		CDesCArrayFlat* Array = new (ELeave) CDesCArrayFlat(5);
		CleanupStack::PushL(Array);

		if(isEnable){
			StringLoader::Load(hjelpper,R_CMD_ENABLE);
			Array->AppendL(hjelpper);
			cmdArray->AppendL(EProfEnable);
		}else if(isDisable){
			StringLoader::Load(hjelpper,R_CMD_DISABLE);
			Array->AppendL(hjelpper);
			cmdArray->AppendL(EProfDisable);
		}
		
		if(isaPreview && !iDimPreview){
			StringLoader::Load(hjelpper,R_CMD_MODIFY);
			Array->AppendL(hjelpper);
			cmdArray->AppendL(EProfModify);
	
			StringLoader::Load(hjelpper,R_CMD_PREVIEW);
			Array->AppendL(hjelpper);
			cmdArray->AppendL(EProfTest);		
		}

		if(isRemove){
			StringLoader::Load(hjelpper,R_CMD_DELETE);
			Array->AppendL(hjelpper);
			cmdArray->AppendL(EProfRemove);		
		}

		list->Model()->SetItemTextArray(Array);
		CleanupStack::Pop();//Array
		list->Model()->SetOwnershipType(ELbmOwnsItemArray);
	
		if (popupList->ExecuteLD())
		{
			TInt Selected = list->CurrentItemIndex();
			if(Selected >= 0 && Selected < cmdArray->Count())
			{
				ret = ETrue;
				aCommand = cmdArray->At(Selected);
			}
		}
	
		CleanupStack::PopAndDestroy(1); // cmdArray
		CleanupStack::Pop();            // popuplist
		CleanupStack::PopAndDestroy(1); // list
	}
	
	return ret;
}
开发者ID:DrJukka,项目名称:Symbian_Codes,代码行数:79,代码来源:Main_Container.cpp


注:本文中的CArrayFixFlat::At方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。