Beispiel #1
0
EXPORT_C TBool AknsUtils::BooleanPropertyL( MAknsSkinInstance* aInstance,
    const TAknsItemID& aID )
    {
    if( !aInstance ) User::Leave( KErrNotSupported );

    CAknsStringItemData* data = static_cast<CAknsStringItemData*>(
        aInstance->GetCachedItemData( aID, EAknsITString ) );
    if( !data ) User::Leave( KErrNotFound );

    if( !data->String().CompareF( KAknsUtilsTrue ) ) return ETrue;
    if( !data->String().CompareF( KAknsUtilsFalse ) ) return EFalse;

    User::Leave( KErrArgument );
    return EFalse; // Never reached
    }
// -----------------------------------------------------------------------------
// CTestSDKSkins::TestSIDSetStringL
// -----------------------------------------------------------------------------
TInt CTestSDKSkins::TestSIDSetStringL( CStifItemParser& /*aItem*/ )
    {
    CAknsStringItemData* itemData = CAknsStringItemData::NewL();
    CleanupStack::PushL( itemData );
    STIF_ASSERT_NOT_NULL( itemData );
    
    _LIT( KString, "string" );
    TBuf<KLength> string( KString );
    itemData->SetStringL( string );
    TBuf<KLength> stringGet = itemData->String();
    STIF_ASSERT_TRUE( 0 == stringGet.Compare( string ) );
    
    CleanupStack::PopAndDestroy( itemData );
    
    return KErrNone;
    
    }
// -----------------------------------------------------------------------------
// AknsDrawUtils::SlidingMode
// (commented in the header).
// -----------------------------------------------------------------------------
//
EXPORT_C TSlidingMode AknsDrawUtils::SlidingMode( MAknsSkinInstance*
#ifdef RD_SLIDING_ANIMATION_EFFECTS
    aInstance
#endif // RD_SLIDING_ANIMATION_EFFECTS
)
    {
#ifdef RD_SLIDING_ANIMATION_EFFECTS
    if (!KAknsFeaSlideNotes || !aInstance)
        {
        return ESlidingDisabled;
        }

    CAknsStringItemData* data = static_cast<CAknsStringItemData*>(
        aInstance->GetCachedItemData( KAknsIIDPropertyNoteSlidingMode, EAknsITString ) );
    if( !data )
        {
        return ESlidingDisabled;
        }

    if( !data->String().CompareF( KAknsDrawUtilsSLDisabled ) ) return ESlidingDisabled;
    if( !data->String().CompareF( KAknsDrawUtilsSLFromCBA ) ) return ESlidingFromCBA;
    if( !data->String().CompareF( KAknsDrawUtilsSLFromL ) ) return ESlidingFromLeft;
    if( !data->String().CompareF( KAknsDrawUtilsSLFromTL ) ) return ESlidingFromTopLeft;
    if( !data->String().CompareF( KAknsDrawUtilsSLFromT ) ) return ESlidingFromTop;
    if( !data->String().CompareF( KAknsDrawUtilsSLFromTR ) ) return ESlidingFromTopRight;
    if( !data->String().CompareF( KAknsDrawUtilsSLFromR ) ) return ESlidingFromRight;
    if( !data->String().CompareF( KAknsDrawUtilsSLFromBR ) ) return ESlidingFromBottomRight;
    if( !data->String().CompareF( KAknsDrawUtilsSLFromB ) ) return ESlidingFromBottom;
    if( !data->String().CompareF( KAknsDrawUtilsSLFromBl ) ) return ESlidingFromBottomLeft;
    if( !data->String().CompareF( KAknsDrawUtilsSLRnd ) ) return ESlidingFromRandom;
#endif //RD_SLIDING_ANIMATION_EFFECTS

    return ESlidingDisabled; // Never reached when animations are on
    }