void CMTPTypeServiceEventElement::ConstructL(const TUint16 aEventCode,const TMTPTypeGuid& aEventGUID,const TDesC& aEventName)
    {

    ConstructL();

    // Set mandatory construction values.
    SetUint16L(EEventCode, aEventCode);
    SetL(EEventGUID, aEventGUID);
    SetStringL(EEventName,aEventName);
    }
Exemple #2
0
force_inline
void String0::Set(const char *s, int len)
{
	Clear();
	if(len < 14) {
		SVO_MEMCPY(chr, s, len);
		SLen() = len;
		Dsyn();
		return;
	}
	SetL(s, len);
	Dsyn();
}
// ---------------------------------------------------------------------------
// CSsmInitStartupReason::InitStartupReasonL
// ---------------------------------------------------------------------------
//
void CSsmInitStartupReason::InitStartupReasonL()
    {
    FUNC_LOG;

    TInt val( 0 );
    TInt errorCode = MapperUtilityL().CrValue( KCRUidStartup, KStartupReason, val );
    ERROR( errorCode, "Failed to get KStartupReason CenRep key" );

    if ( errorCode == KErrNone )
        {
        SetL( KPSUidStartup, KPSStartupReason, val );        
        INFO_1( "Value of startup reason is %d", val );
        }
    User::LeaveIfError( errorCode );
    }
EXPORT_C void CGlobalText::ApplyCharFormatL(const TCharFormat& aFormat,const TCharFormatMask& aMask,
											TInt /*aPos*/,TInt /*aLength*/)
/** Changes the text object's character formatting. The attributes which are 
set in the mask are read from aFormat into the text object's character format 
layer. The attributes which are not set in the mask are not changed. Note 
that the position and length arguments are only used in the rich text 
implementation of this function.

@param aFormat Contains the character format attribute values to apply. 
@param aMask Bitmask specifying the character format attributes to change. 
@param aPos This argument is not used for global text. 
@param aLength This argument is not used for global text. */
	{

	__TEST_INVARIANT;

	TCharFormatMask applyMask=aMask;
	TCharFormat cf(aFormat);
	iGlobalCharFormatLayer->Sense(cf,applyMask);
	(CONST_CAST(CCharFormatLayer*,iGlobalCharFormatLayer))->SetL(cf,applyMask);
	CEditableText::SetHasChanged(ETrue);

	__TEST_INVARIANT;
	}
void CMTPTypeServiceObjPropExtnForm::ConstructL( const TMTPTypeGuid  aPKNamespace, const TUint aPKID, const TDesC& aName, const TUint8 aFormFlag, const MMTPType* aForm )
    {  
    for (TUint i(0); (i < ENumElements); i++)
       {
       const TElementInfo& element(iElementInfo[i]);
       if (ChunkCount() <= element.iChunkId)
           {
           MMTPType* chunk(NULL);
           switch (element.iChunkId)
               {
           case EIdFlat1Chunk:
               iChunkFlat1.OpenL();
               chunk = &iChunkFlat1;
               break;
               
           case EIdNameChunk:
               iChunkName = CMTPTypeString::NewL();
               chunk = iChunkName;
               break;
               
           case EIdFlat2Chunk:
               iChunkFlat2.OpenL();
               chunk = &iChunkFlat2;
               break;
               
           case EIdFormChunk:
               iChunkForm.SetMeta(aFormFlag, iDataType);
               if (HasFormField(aFormFlag))
                   {
                   iChunkForm.OpenL(element.iType);
                   chunk = &iChunkForm;
                   SetExpectedChunkCount(KNumChunksWithForm);
                   }
               break;
               
           default:
               Panic(EMTPTypeBoundsError);
               break;
               }
                   
           if (chunk)
               {
               ChunkAppendL(*chunk);   
               }
           }
       }      
    // Set the construction values.
    SetL( EPKeyNamespace, aPKNamespace );
    SetUint32L( EPKeyID, aPKID );
    SetStringL( EPropertyName, aName );
    SetUint8L(EFormFlag, aFormFlag);
    
    if (aForm)
        {
        if (!HasFormField(aFormFlag))
            { 
            User::Leave(KMTPDataTypeInvalid);
            } 
        else
            {
            SetL(EForm, *aForm); 
            }
        }
    
    iInitialised = ETrue;
    }
Exemple #6
0
EXPORT_C void TDbColumn::SetL(const TDesC16& aValue)
	{
	SetL(aValue.Ptr(),aValue.Length()<<1);
	}
// ----------------------------------------------------------------------------------------------------------
// Executes the given command on the collection
// ----------------------------------------------------------------------------------------------------------
//
void CTestCollectionPlugin::CommandL(CMPXCommand& aCmd)
{
    LOG1(_L("CTestCollectionPlugin::CommandL"));
    const TDesC& title = aCmd.ValueText( KMPXMediaGeneralTitle );
    TMPXCommandId cmdId = aCmd.ValueTObjectL<TMPXCommandId>(KMPXCommandGeneralId);
    LOG2(_L("CommandId = %d"), cmdId);

    if(title == _L("CollectionPluginTest0175") )
    {
    }
    else if(title == _L("CollectionPluginTest0176") )
    {
        iObs->HandleCommandComplete(NULL, KErrNone);
    }
    else if(title == _L("CollectionPluginTest0177") )
    {
        iObs->HandleCommandComplete(NULL, KErrGeneral);
    }
    else if(title == _L("CollectionPluginTest0183") )
    {
    }
    else if(title == _L("CollectionPluginTest0184") )
    {
        CMPXCommand* newCmd = CMPXCommand::NewL();
        CleanupStack::PushL( newCmd );
        *newCmd = aCmd;
        iObs->HandleCommandComplete(newCmd, KErrNone);
        CleanupStack::PopAndDestroy( newCmd );
    }
    else
    {
        TBool syncOp(EFalse);
        if( aCmd.IsSupported(KMPXCommandGeneralDoSync) )
        {
            syncOp = *aCmd.Value<TBool>(KMPXCommandGeneralDoSync);
        }

        switch( cmdId )
        {
        case KMPXCommandIdCollectionRetrieveUriForDeletion:
        {   // TODO
            LOG1(_L("CTestCollectionPlugin::CommandL - KMPXCommandIdCollectionRetrieveUriForDeletion"));
            //DoRetrieveUriForDeletionL(aCmd);
            break;
        }
        case KMPXCommandIdCollectionRemove:
        {
            LOG1(_L("CTestCollectionPlugin::CommandL - KMPXCommandIdCollectionRemove"));
            //DoRemovePathL(aCmd);
            break;
        }
        case KMPXCommandIdCollectionRemoveMedia:
        {
            LOG1(_L("CTestCollectionPlugin::CommandL - KMPXCommandIdCollectionRemoveMedia"));
            //DoRemoveMediaL(aCmd);
            break;
        }
        case KMPXCommandIdCollectionCleanupDeletedMedias:
        {
            LOG1(_L("CTestCollectionPlugin::CommandL - KMPXCommandIdCollectionCleanupDeletedMedias"));
            //DoCleanupDeletedMediasL(aCmd);
            break;
        }
        case KMPXCommandIdCollectionAdd:
        {
            LOG1(_L("CTestCollectionPlugin::CommandL - KMPXCommandIdCollectioAdd"));

            CMPXMedia& media = *aCmd.Value<CMPXMedia>(KMPXCommandColAddMedia);
            AddL(media);
            break;
        }
        case KMPXCommandIdCollectionSet:
        {
            LOG1(_L("CTestCollectionPlugin::CommandL - KMPXCommandIdCollectionSet"));

            CMPXMedia& media = *aCmd.Value<CMPXMedia>(KMPXCommandColSetMedia);
            SetL( media );
            break;
        }
        case KMPXCommandIdCollectionCompleteDelete:
        {
            LOG1(_L("CTestCollectionPlugin::CommandL - KMPXCommandIdCollectionCompleteDelete"));
            //DoHandleDeleteCompleteL( aCmd );
            break;
        }
        default:
        {
            User::Panic(_L("CTestCollectionPlugin::CommandL panic"), 1); // magic number
        }
        }
        if (!syncOp)
        {
            iObs->HandleCommandComplete( NULL, KErrNone );
        }
    }
}