Exemplo n.º 1
0
void CRpsMsg::ConstructL(const TDesC8& aMsgType, const TDesC8& aOpCode, const TUint aMsgNum, const CDesCArrayFlat& aArgArray) 
	{
	
	TUint numArgs(aArgArray.Count());
	iMsgDataArray = new (ELeave)CDesC8ArrayFlat(1);
	
	// Calc the total msg length
	TUint msgLen(KRqstLengthNoOpCodeNoArgsNoCommas + aOpCode.Length());
	for(TInt i(0); i < numArgs; ++i)
		{
		msgLen += aArgArray.MdcaPoint(i).Length();
		}
	// add commas to calculation
	msgLen += KRqstMsgElementsNoArgs + numArgs - 1;
	
	// Msg Type
	iMsgDataArray->AppendL(aMsgType);
	iMsgDataArray->AppendL(KComma);
	
	// Msg Len
	TBuf8<KMaxMsgLenChars> mlenString;
	mlenString.NumFixedWidth(msgLen, EDecimal, KMaxMsgLenChars);
	iMsgDataArray->AppendL(mlenString);
	iMsgDataArray->AppendL(KComma);
	
	// Msg Seq Num
	TBuf8<KMaxMsgNumChars> msnString;
	//msnString.Num(NextMsgNum());
	msnString.NumFixedWidth(aMsgNum, EDecimal, KMaxMsgNumChars);
	iMsgDataArray->AppendL(msnString);
	iMsgDataArray->AppendL(KComma);
	
	// OpCode
	iMsgDataArray->AppendL(aOpCode);
	iMsgDataArray->AppendL(KComma);
	
	// Arguments. Convert aArgArray data to 8-bit as we go.
	for(TInt i(0); i < numArgs; ++i)
		{
		TBuf8<KMaxElementSize> buf;
		buf.Copy(aArgArray.MdcaPoint(i));
		iMsgDataArray->AppendL(buf);
		iMsgDataArray->AppendL(KComma);
		}
		
	// EOM
	iMsgDataArray->AppendL(KEOM);
    }
Exemplo n.º 2
0
void CPlaylistMgr::EventOpenDefault()
{
    iControlMgr->CleanList();

    //返回
    iBackIndex = KPlaylistBackStateRoot;
    AddBackItem();

    CDesCArrayFlat* files = CUIViewData::GetInstance()->GetSelectFileList();

    for (TInt i=0; i<files->Count(); i++)
    {
        pListItemStruct back = new (ELeave) ListItemStruct;
        back->iIconIndex = 0;
        back->iShowName = (*files)[i].AllocL();
        back->iType = KPlaylistItemTypeNode;
        iControlMgr->AddListItem(back);
    }
}
Exemplo n.º 3
0
void CPlaylistMgr::EventOpenFavorite()
{
    iControlMgr->CleanList();

    //返回
    iBackIndex = KPlaylistBackStateRoot;
    AddBackItem();

    CDesCArrayFlat* files = iDataMgr->GetPlaylistFiles();

    for (TInt i=0; i<files->Count(); i++)
    {
        pListItemStruct back = new (ELeave) ListItemStruct;
        back->iIconIndex = 0;
        back->iHideInfo = (*files)[i].AllocL();
        back->iShowName = (*files)[i].AllocL();
        back->iType = KPlaylistItemTypePlaylist;
        iControlMgr->AddListItem(back);
    }
}
Exemplo n.º 4
0
//
// NEW
//
void CHlpView::PopulateCategoryListL()
	{
	// First get a category listing, then get the list of topics
	// for each specified category.
	// Get and print the category listing
	CDesCArrayFlat* array = new(ELeave) CDesCArrayFlat(5);
	CleanupStack::PushL(array);
	iHelpModel.CategoryListL(array);

	if	(!array->Count())
		User::Leave(KErrArgument); // ??

	iHelpCategories->SetArrayExternalOwnership(EFalse);
	iHelpCategories->SetArrayL(array);
	iHelpCategories->SetArrayExternalOwnership(EFalse);
	iHelpCategories->SetCurrentItem(0);

	PopulateTopicListL(iHelpCategories->Array()->MdcaPoint(iHelpCategories->CurrentItem()));

	CleanupStack::Pop();
	}
Exemplo n.º 5
0
// ----------------------------------------------------------------------------
// CSCPHistoryPlugin::HandleEvent
// 
// 
// Status : Approved
// ----------------------------------------------------------------------------
//    
void CSCPHistoryPlugin :: HandleEventL( TInt aID, CSCPParamObject& aParam, CSCPParamObject& aOutParam)
	{				
	Dprint ( ( _L( "CSCPHistoryPlugin::HandleEvent()" ) ) );
	
	if ( iFs == NULL )
	    {
	    return ; // Eventhandler not available
	    }	
		// check for Case
		
	switch ( aID )
        {

        case ( KSCPEventValidate ) :
            {            
           	// Obtain the paramValue
           	Dprint ( ( _L( "CSCPHistoryPlugin::KSCPEventValidate" ) ) );
			TInt passhistoryParamValue;
			passhistoryParamValue = GetHistoryCountParamValue();
			Dprint ( ( _L( "CSCPHistoryPlugin::HandleEvent passhistoryParamValue = %d" ), passhistoryParamValue ) );
			// if all required bounds are zero, there is nothing to do.
			if ( passhistoryParamValue != 0)
			    {
				// Get the configFile's path.
				// If this fails, there is something badly wrong(Private folder is not there)
				TInt errSCF = SetConfigFile ();
				if (errSCF != KErrNone)
				{
					break; // Break out from Case
				}

				// Get the historyItemCount, If the err is raised, the file is not there
				// This will lead to KSCPEventPasswordChanged event and new history file will
				// be created
				TInt historyItemCounter;
				TInt errHC = GetHistoryItemCount( historyItemCounter );
				Dprint ( ( _L( "CSCPHistoryPlugin::HandleEvent historyItemCounter = %d" ), historyItemCounter ) );
				if (errHC != KErrNone)
				{
					break; // Break out from Case
				}

				// continue with the KSCPEventValidate Check

				// Get the password from the paramObject
				TBuf<KSCPPasscodeMaxLength> seccode;
				if ( aParam.Get( KSCPParamPassword, seccode ) != KErrNone )
				{
					// Nothing to do anymore
					Dprint( (_L("CSCPHistoryPlugin::HandleEvent()\
					ERROR: KSCPEventValidate/KSCPParamPassword is != KErrNone") ));
					break; // Break out from Case
				}            
				
				// Hash  the securitycode	
				TBuf<KSCPPasscodeMaxLength> securityhash;
				iEventHandler->HashInput(seccode,securityhash);
			
				// get history
				CDesCArrayFlat* array = NULL;
				TInt errGH = KErrNone;
				
				array = new CDesCArrayFlat(1);			
				if ( array != NULL )
				    {
				    TRAPD( err2, errGH = GetHistoryArrayL( *array ) );
				    if ( err2 != KErrNone )
				        {
				        errGH = err2;
				        }
				    }
				else
				    {
				    errGH = KErrNoMemory;
				    }
			
				// If for some reason err is raised, break out
				// If the Historyonfig file get deleted on the fly ex
				if (errGH != KErrNone)
				    {
					array->Reset();
					delete array;
					break; // Break out from Case
				    }
				TInt correction;
				correction = 0;

				if ( array->Count() >=  passhistoryParamValue )
                {
                    correction =  array->Count() - passhistoryParamValue;
                }
				// check for match
				TBuf<KSCPPasscodeMaxLength> arrayItem;
				
				// Set the historyobject
				for (TInt i= 0 + correction; i < array->Count(); i++)
				    {
					arrayItem =  array->MdcaPoint(i);
					if (arrayItem.Compare(securityhash) == KErrNone)
					    {
                            aOutParam.Set( KSCPParamStatus, KErrSCPInvalidCode );
                            Dprint ( ( _L( "EDeviceLockHistoryBuffer Failed" ) ) );
                            aOutParam.AddtoFailedPolices(EDeviceLockHistoryBuffer);
                            break;
                        } // End of compare IF
                    } // End of For
					
                // kill the local
                array->Reset();
                delete array;

                } // passhistoryParamValue
            break;
            } // end of KSCPEventValidate
Exemplo n.º 6
0
// -----------------------------------------------------------------------------
// ShowTypedQueryL
// Shows list query and returns the user selection.
// -----------------------------------------------------------------------------
//
TUid CSendUiImpl::ShowTypedQueryL(
    CSendUi::TSendUiMenuType    aMenuType,
    const CMessageData*         aMessageData,
    TSendingCapabilities        aRequiredCapabilities,
    CArrayFix<TUid>*            aServicesToDim,
    const TDesC&                aTitleText )
{
    // Implemented for CR # 401-1806 >>
    // This section to enable/disable features (supported by feature manager) at run time, is to be revised,
    // once an observer class is available from feature manager side to intimate about feature state

    CRepository* repository = CRepository::NewLC( KCRUidSendUi );
    TInt oldFeatures(0);
    TInt newFeatures(0);
    TBool updateNeeded( EFalse );

    if ( repository->Get( KKeySendUiFeatureManagerServices, oldFeatures ) != KErrNone )
    {
        updateNeeded = ETrue;
    }
    FeatureManager::InitializeLibL();
    FeatureStatus( KFeatureIdMmsPostcard, newFeatures, KSendUiPostcard );
    FeatureStatus( KFeatureIdAudioMessaging, newFeatures, KSendUiAudioMessage );
    FeatureStatus( KFeatureIdSenduiMmsUpload, newFeatures, KSendUiMmsUpload );
    FeatureManager::UnInitializeLib();
    if ( newFeatures != oldFeatures )
    {
        repository->Set( KKeySendUiFeatureManagerServices, newFeatures );
        updateNeeded = ETrue;
    }

    CleanupStack::PopAndDestroy( repository );

    RProperty propertyUpdateOperation;
    TRequestStatus status;
    if ( updateNeeded )
    {
        RProperty::Set(
            KPSUidSendUiProperty,
            KSendUiUpdateRequest,
            KSendUiUpdateRequested );
        User::LeaveIfError( propertyUpdateOperation.Attach( KPSUidSendUiProperty, KSendUiUpdateRequest ));
        propertyUpdateOperation.Subscribe( status );
        User::WaitForRequest(status);
        TInt value = KErrNone;
        if(propertyUpdateOperation.Get( value ) !=KErrNotFound && value == KSendUiUpdated )
        {
            TRAPD( err, GetServicesL() );
            if ( err )
            {
#ifdef _DEBUG
                TBuf<256> buf;
                buf.Format(_L("SendUi err"));
                User::InfoPrint(buf);
#endif
                TUid serviceId( KNullUid );
                return serviceId;
            }
        }
        propertyUpdateOperation.Close();
    }
    // Implemented for CR # 401-1806 <<
    // List items for list query.
    CDesCArrayFlat* listItems = new (ELeave) CDesCArrayFlat( KArrayGranularity );
    CleanupStack::PushL( listItems);

    // This array is used to map user selection to correct service.
    CArrayFix<TUid>* listItemUids =
        new ( ELeave ) CArrayFixFlat<TUid>( KArrayGranularity );
    CleanupStack::PushL( listItemUids );

    iServicesToDim->Reset();

    TInt i = 0;
    if ( aServicesToDim )
    {
        for ( i = 0; i < aServicesToDim->Count(); i++  )
        {
            iServicesToDim->AppendL( (*aServicesToDim)[i] );
        }
    }

    // Get and filter ECom based services.
    FilterServicesL(
        *listItems,
        *listItemUids,
        aRequiredCapabilities,
        aMessageData,
        aMenuType );

    TUid serviceId( KNullUid );
    if ( listItems->Count() > 0 )
    {
        // Show list query.
        SortListL( *listItems, *listItemUids );

        serviceId = ShowListQueryL(
                        listItems,
                        *listItemUids,
                        aTitleText,
                        aMenuType );
    }

    CleanupStack::PopAndDestroy( 2, listItems );  // listItemUids, listItems

    return serviceId;
}