// --------------------------------------------------------------------------
// Ctestpubscalableicons::TestAknIconUtilsScaleBitmapL
// --------------------------------------------------------------------------
//
TInt Ctestpubscalableicons::TestAknIconUtilsScaleBitmapL( CStifItemParser& /*aItem*/ )
    {
    _LIT(Kctestpubscalableicons, "Ctestpubscalableicons");
    _LIT(Ktestakniconutilsscalebitmapl, "In TestAknIconUtilsScaleBitmapL");
    TestModuleIf().Printf(0, Kctestpubscalableicons, Ktestakniconutilsscalebitmapl);
    iLog->Log(Ktestakniconutilsscalebitmapl);

    TFileName file( KMbmFile );
    User::LeaveIfError( CompleteWithAppPath( file ) );
    CFbsBitmap* aSrcBitmap = AknIconUtils::CreateIconL( file, EMbmAvkonQgn_indi_mic );

    CleanupStack::PushL( aSrcBitmap );

    TRect aTrgRect( TSize( KWidth, KHeight ) );
    
    CFbsBitmap* aTrgBitmap = new( ELeave ) CFbsBitmap;
    aTrgBitmap->Create(TSize( KWidth, KHeight), ENone );

    AknIconUtils::ScaleBitmapL( aTrgRect, aTrgBitmap, aSrcBitmap );
    
    STIF_ASSERT_NOT_NULL( aTrgBitmap );
    
    CleanupStack::PopAndDestroy( aSrcBitmap );

    return KErrNone;
    }
// --------------------------------------------------------------------------
// Ctestpubscalableicons::TestAknIconUtilsDestroyIconDataL
// --------------------------------------------------------------------------
//
TInt Ctestpubscalableicons::TestAknIconUtilsDestroyIconDataL( CStifItemParser& /*aItem*/ )
    {
    _LIT(Kctestpubscalableicons, "Ctestpubscalableicons");
    _LIT(Ktestakniconutilsdestroyicondatal, "In TestAknIconUtilsDestroyIconDataL");
    TestModuleIf().Printf(0, Kctestpubscalableicons, Ktestakniconutilsdestroyicondatal);
    iLog->Log(Ktestakniconutilsdestroyicondatal);

    TFileName file( KMbmFile );
    User::LeaveIfError( CompleteWithAppPath( file ) );

    RAknsSrvSession skinsSession; 
    User::LeaveIfError( skinsSession.Connect() );
 
    CleanupClosePushL( skinsSession );

    CTestPubScalableIconsMifProvider* aFileProvider = 
            CTestPubScalableIconsMifProvider::NewL( &skinsSession, file );
    
    CleanupStack::PushL( aFileProvider );
    
    CFbsBitmap* aBitmap = AknIconUtils::CreateIconL( *aFileProvider, EMbmAvkonQgn_indi_mic );
    CleanupStack::PushL( aBitmap );
    
    AknIconUtils::PreserveIconData( aBitmap);
    AknIconUtils::DestroyIconData( aBitmap );
    
    skinsSession.Close();
    CleanupStack::PopAndDestroy();
    CleanupStack::Pop();
    CleanupStack::PopAndDestroy();
    
    return KErrNone;
    }
// --------------------------------------------------------------------------
// Ctestpubscalableicons::TestAknIconUtilsSetSizeAndRotationL
// --------------------------------------------------------------------------
//
TInt Ctestpubscalableicons::TestAknIconUtilsSetSizeAndRotationL( CStifItemParser& /*aItem*/ )
    {
    _LIT(Kctestpubscalableicons, "Ctestpubscalableicons");
    _LIT(Ktestakniconutilssetsizeandrotationl, "In TestAknIconUtilsSetSizeAndRotationL");
    TestModuleIf().Printf(0, Kctestpubscalableicons, Ktestakniconutilssetsizeandrotationl);
    iLog->Log(Ktestakniconutilssetsizeandrotationl);

    TFileName file( KMbmFile );
    User::LeaveIfError( CompleteWithAppPath( file ) );
    
    RAknsSrvSession skinsSession; 
    User::LeaveIfError( skinsSession.Connect() );
 
    CleanupClosePushL( skinsSession );

    CTestPubScalableIconsMifProvider* aFileProvider = CTestPubScalableIconsMifProvider::NewL( &skinsSession, file );
    
    CleanupStack::PushL( aFileProvider );
    
    CFbsBitmap* aBitmap = AknIconUtils::CreateIconL( *aFileProvider, EMbmAvkonQgn_indi_mic );
    CleanupStack::PushL( aBitmap );
    
    TSize aSize( KWidth, KHeight );
    TInt aAngle = 0;

    AknIconUtils::SetSizeAndRotation( aBitmap, aSize, EAspectRatioPreserved, aAngle );
    
    skinsSession.Close();
    CleanupStack::PopAndDestroy();
    CleanupStack::Pop();
    CleanupStack::PopAndDestroy();
    
    return KErrNone;
    }
// --------------------------------------------------------------------------
// Ctestpubscalableicons::TestAknIconUtilsGetContentDimensions1L
// --------------------------------------------------------------------------
//
TInt Ctestpubscalableicons::TestAknIconUtilsGetContentDimensions1L( CStifItemParser& /*aItem*/ )
    {
    _LIT(Kctestpubscalableicons, "Ctestpubscalableicons");
    _LIT(Ktestakniconutilsgetcontentdimensions1l, "In TestAknIconUtilsGetContentDimensions1L");
    TestModuleIf().Printf(0, Kctestpubscalableicons, Ktestakniconutilsgetcontentdimensions1l);
    iLog->Log(Ktestakniconutilsgetcontentdimensions1l);

    TFileName file( KMbmFile );
    User::LeaveIfError( CompleteWithAppPath( file ) );
    CFbsBitmap* aSrcBitmap = AknIconUtils::CreateIconL( file, EMbmAvkonQgn_indi_mic );

    CleanupStack::PushL( aSrcBitmap );
    TSize aContentDimensions;

    AknIconUtils::GetContentDimensions( aSrcBitmap, aContentDimensions );
    
    TInt width = KWidth;
    TInt height = KHeight;
    
    STIF_ASSERT_EQUALS( aContentDimensions.iWidth, width );
    STIF_ASSERT_EQUALS( aContentDimensions.iHeight, height );
    
    CleanupStack::PopAndDestroy();

    return KErrNone;
    }
// --------------------------------------------------------------------------
// Ctestpubscalableicons::TestCAknIconSetBitmapL
// --------------------------------------------------------------------------
//
TInt Ctestpubscalableicons::TestCAknIconSetBitmapL( CStifItemParser& /*aItem*/ )
    {
    _LIT(Kctestpubscalableicons, "Ctestpubscalableicons");
    _LIT(Ktestcakniconsetbitmapl, "In TestCAknIconSetBitmapL");
    TestModuleIf().Printf(0, Kctestpubscalableicons, Ktestcakniconsetbitmapl);
    iLog->Log(Ktestcakniconsetbitmapl);

    CAknIcon* temp = CAknIcon::NewL();
    CleanupStack::PushL( temp );

    TFileName file( KMbmFile );
    User::LeaveIfError( CompleteWithAppPath( file ) );
    CFbsBitmap* aSrcBitmap = AknIconUtils::CreateIconL( file, EMbmAvkonQgn_indi_mic );

    CleanupStack::PushL( aSrcBitmap );
    
    temp->SetBitmap( aSrcBitmap );
    
    CFbsBitmap* bitmap = temp->Bitmap();
    
    STIF_ASSERT_SAME( aSrcBitmap, bitmap );
    
    CleanupStack::Pop( aSrcBitmap );
    CleanupStack::PopAndDestroy( temp );

    return KErrNone;
    }
// --------------------------------------------------------------------------
// Ctestpubscalableicons::TestCAknIconSetMaskL
// --------------------------------------------------------------------------
//
TInt Ctestpubscalableicons::TestCAknIconSetMaskL( CStifItemParser& /*aItem*/ )
    {
    _LIT(Kctestpubscalableicons, "Ctestpubscalableicons");
    _LIT(Ktestcakniconsetmaskl, "In TestCAknIconSetMaskL");
    TestModuleIf().Printf(0, Kctestpubscalableicons, Ktestcakniconsetmaskl);
    iLog->Log(Ktestcakniconsetmaskl);

    CAknIcon* temp = CAknIcon::NewL();
    CleanupStack::PushL( temp );
    
    TFileName file( KMbmFile );
    User::LeaveIfError( CompleteWithAppPath( file ) );
    CFbsBitmap* main = NULL;
    CFbsBitmap* mask = NULL;
    AknIconUtils::CreateIconL( main, mask, file, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask );

    CleanupStack::PushL( mask );
    
    temp->SetMask( mask );

    CFbsBitmap* tempMask = temp->Mask();
    
    STIF_ASSERT_SAME( mask, tempMask );

    CleanupStack::Pop( mask );
    CleanupStack::PopAndDestroy( temp );

    return KErrNone;
    }
void CTangramAnimation::Init()
	{
	TFileName file;
#ifndef __WINS__
	file.Copy(KTangramImage);
	CompleteWithAppPath(file);
#else
	file.Copy(KResourceDirction);
	file.Append(KTangramImage);
#endif	
	iBitmapArray->LoadDataFromFile(file);
	}
Ejemplo n.º 8
0
void GetResourcePath(TDes& aAppPath)
{
#if defined ( EKA2 )
    TParsePtrC parse((CEikonEnv::Static()->EikAppUi()->Application())->ResourceFileName());
    aAppPath.Insert(0, parse.Drive());
#else
    CompleteWithAppPath(aAppPath);
#endif
#ifdef __WINS__
	aAppPath[0] = 'c';
#endif		
}
// -----------------------------------------------------------------------------
// CTestSDKNotifiers::TestNotifiersPGDialogSetImageLL
// -----------------------------------------------------------------------------
//
TInt CTestSDKNotifiers::TestNotifiersPGDialogSetImageLL( CStifItemParser& /*aItem*/ )
    {
    CAknGlobalProgressDialog* progressdialog = CAknGlobalProgressDialog::NewL();
    CleanupStack::PushL( progressdialog );
    
    TFileName file( KMbmFile );
    User::LeaveIfError( CompleteWithAppPath( file ) );
    
    progressdialog->SetImageL( file, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask );
    
    CleanupStack::PopAndDestroy( progressdialog );
    return KErrNone;
    }
void CTangramAnimation::ConvertComplete()
	{
	iAnimation->SetSrcBitmap(iBitmapArray->GetBitmapArray(),
			iBitmapArray->GetBitmapCount());
	TFileName file;
#ifndef __WINS__
	file.Append(KTangramAnimation);
	CompleteWithAppPath(file);
#else
	file.Copy(KResourceDirction);
	file.Append(KTangramAnimation);
#endif
	iAnimation->LoadDataFromXml(file);
	}
void CCellTowerDataSimulation::InternalizeL() {
	RFs aSession;
	RFile aFile;
	TFileName aFileName;
	TInt aFileSize;

	if(aSession.Connect() == KErrNone) {
		CleanupClosePushL(aSession);

#ifndef __SERIES60_3X__
		aFileName = TFileName(_L("CellTowerSimData.txt"));
		CompleteWithAppPath(aFileName);
#else
		if(aSession.PrivatePath(aFileName) == KErrNone) {
#ifndef __WINSCW__
			aFileName.Insert(0, _L(":"));
			CCommandLineArguments* pArguments;
			TFileName drive;
			pArguments = CCommandLineArguments::NewL();
			if (pArguments->Count() > 0) {
				drive.Append(pArguments->Arg(0)[0]);
				aFileName.Insert(0, drive);
				delete pArguments;
			}
#endif

			aFileName.Append(_L("CellTowerSimData.txt"));

#ifdef __WINSCW__
			aFileName.Insert(0, _L("z:"));
#endif
		}
#endif

		if(aFile.Open(aSession, aFileName, EFileStreamText|EFileRead) == KErrNone) {
			CleanupClosePushL(aFile);
			aFile.Size(aFileSize);

			// Creat buffer & read file
			iCellBuffer = HBufC8::NewL(aFileSize);
			TPtr8 pCellBuffer(iCellBuffer->Des());
			aFile.Read(pCellBuffer);
			aFile.Close();
			
			CleanupStack::PopAndDestroy(&aFile);
		}
		
		CleanupStack::PopAndDestroy(&aSession);
	}
}
void CSpaceInvadersAppView::LoadBitmapsL()
{
    TFileName mbmShipFileName(shipFile);
    CompleteWithAppPath(mbmShipFileName);

    iBitmapShip = new (ELeave) CFbsBitmap();

    User::LeaveIfError(iBitmapShip->Load(mbmShipFileName, 0));

    TFileName mbmAlien1FileName(alien1File);
    CompleteWithAppPath(mbmAlien1FileName);

    iBitmapAlien1 = new (ELeave) CFbsBitmap();

    User::LeaveIfError(iBitmapAlien1->Load(mbmAlien1FileName, 0));

    TFileName mbmAlien2FileName(alien2File);
    CompleteWithAppPath(mbmAlien2FileName);

    iBitmapAlien2 = new (ELeave) CFbsBitmap();

    User::LeaveIfError(iBitmapAlien2->Load(mbmAlien2FileName, 0));

    TFileName mbmAlien3FileName(alien3File);
    CompleteWithAppPath(mbmAlien3FileName);

    iBitmapAlien3 = new (ELeave) CFbsBitmap();

    User::LeaveIfError(iBitmapAlien3->Load(mbmAlien3FileName, 0));

    TFileName mbmShotFileName(shotFile);
    CompleteWithAppPath(mbmShotFileName);

    iBitmapShot = new (ELeave) CFbsBitmap();

    User::LeaveIfError(iBitmapShot->Load(mbmShotFileName, 0));
}
Ejemplo n.º 13
0
void GetAppPath(TDes& aAppPath)
{
#if defined ( EKA2 )
	User::LeaveIfError(CEikonEnv::Static()->FsSession().PrivatePath(aAppPath));
    // insert the drive to the private path
    TParsePtrC parse((CEikonEnv::Static()->EikAppUi()->Application())->AppFullName());
    aAppPath.Insert(0, parse.Drive());
#else
    CompleteWithAppPath(aAppPath);

#endif
#ifdef __WINS__
	aAppPath[0] = 'c';
#endif	
}
void CCustomControlScroll::LoadL()
	{
	TFileName file(KMultiBitmapFilename);
	User::LeaveIfError(CompleteWithAppPath(file));
		
	iBitmapDirection[0] = new (ELeave)CFbsBitmap;
	iBitmapDirection[0]->Load(file, EMbmCcscrollScrollup);
	iBitmapDirection[1] = new (ELeave)CFbsBitmap;
	iBitmapDirection[1]->Load(file, EMbmCcscrollScrolldown);
	iBitmapScroller = new (ELeave)CFbsBitmap;
	iBitmapScroller->Load(file, EMbmCcscrollScroller);

	iBitmapWidth = iBitmapScroller->SizeInPixels().iWidth;
	iBitmapHeight = iBitmapScroller->SizeInPixels().iHeight;
	}
// --------------------------------------------------------------------------
// Ctestpubscalableicons::TestAknIconUtilsIsMifFileL
// --------------------------------------------------------------------------
//
TInt Ctestpubscalableicons::TestAknIconUtilsIsMifFileL( CStifItemParser& /*aItem*/ )
    {
    _LIT(Kctestpubscalableicons, "Ctestpubscalableicons");
    _LIT(Ktestakniconutilsismiffilel, "In TestAknIconUtilsIsMifFileL");
    TestModuleIf().Printf(0, Kctestpubscalableicons, Ktestakniconutilsismiffilel);
    iLog->Log(Ktestakniconutilsismiffilel);

    TFileName file( KMifFile );
    User::LeaveIfError( CompleteWithAppPath( file ) );

    TBool isMif = AknIconUtils::IsMifFile( file );
    
    STIF_ASSERT_TRUE( isMif );

    return KErrNone;
    }
// -----------------------------------------------------------------------------
// CTestSDKNotifiers::TestNotifiersMsgQueryShowMsgQueryLL
// -----------------------------------------------------------------------------
//
TInt CTestSDKNotifiers::TestNotifiersMsgQueryShowMsgQueryLL( CStifItemParser& /*aItem*/ )
    {
    CActiveExample* observer = CActiveExample::NewLC();
    observer->ShowMsgQueryLL( KNullDesC, KZero, KNullDesC, KNullDesC, KZero, KZero );
    CleanupStack::PopAndDestroy( observer );
    
    TFileName file( KMbmFile );
    User::LeaveIfError( CompleteWithAppPath( file ) );
    TBuf<KBufSize> text( KTestString );
    
    CActiveExample* observerparamer = CActiveExample::NewLC();
    observerparamer->ShowMsgQueryLL( text, KZero, text, file, KZero, KOne );
    CleanupStack::PopAndDestroy( observerparamer );
    
    return KErrNone;
    }
Ejemplo n.º 17
0
void TAzenqosEngineUtils::CompleteWithPrivatePathL(TDes& des)
{
#ifdef EKA2//3rd edition
	RFs rfs;
	TFileName fn;

	User::LeaveIfError(rfs.Connect());
	CleanupClosePushL(rfs);
	User::LeaveIfError(rfs.PrivatePath(fn));
	CleanupStack::PopAndDestroy();
	fn += des;
	des = fn;
#else
	CompleteWithAppPath(des);
#endif
}
Ejemplo n.º 18
0
// member functions
void CSplashContainer::ConstructL(const TRect &aRect)
{
  iBitmap = new(ELeave)CFbsBitmap();

  CreateWindowL();

  SetRect(aRect);
  SetExtentToWholeScreen();

  TFileName bitmapFile(KDrawBitmapPath);
  User::LeaveIfError(CompleteWithAppPath(bitmapFile));

  iLogoBitmap = new(ELeave)CFbsBitmap();
  User::LeaveIfError(iLogoBitmap->Load(bitmapFile, EMbmMauruSplash));

  ActivateL();
}
// --------------------------------------------------------------------------
// Ctestpubscalableicons::TestAknIconUtilsValidateLogicalAppIconIdL
// --------------------------------------------------------------------------
//
TInt Ctestpubscalableicons::TestAknIconUtilsValidateLogicalAppIconIdL( CStifItemParser& /*aItem*/ )
    {
    _LIT(Kctestpubscalableicons, "Ctestpubscalableicons");
    _LIT(Ktestakniconutilsvalidatelogicalappiconidl, "In TestAknIconUtilsValidateLogicalAppIconIdL");
    TestModuleIf().Printf(0, Kctestpubscalableicons, Ktestakniconutilsvalidatelogicalappiconidl);
    iLog->Log(Ktestakniconutilsvalidatelogicalappiconidl);

    TFileName file( KMbmFile );
    User::LeaveIfError( CompleteWithAppPath( file ) );

    TInt bitmapId = EMbmAvkonQgn_indi_mic;
    TInt mask = EMbmAvkonQgn_indi_mic_mask;
    
    AknIconUtils::ValidateLogicalAppIconId( file, bitmapId, mask );

    return KErrNone;
    }
void CCustomControlList::LoadL()
	{
	iIcons = new(ELeave) CAknIconArray(5);
	CleanupStack::PushL(iIcons);
	TFileName file(KListIcon);
	User::LeaveIfError(CompleteWithAppPath(file));
	iIcons->AppendL(CEikonEnv::Static()->CreateIconL(file, EMbmCclistListfile, EMbmCclistListmask));
	iIcons->AppendL(CEikonEnv::Static()->CreateIconL(file, EMbmCclistListfolder, EMbmCclistListmask));
	iIcons->AppendL(CEikonEnv::Static()->CreateIconL(file, EMbmCclistListmusic, EMbmCclistListmask));
	CleanupStack::Pop(iIcons);

	iSelectBitmap = new (ELeave) CFbsBitmap();
	CleanupStack::PushL(iSelectBitmap);
	iSelectBitmap->Load(file, EMbmCclistListmask);
	CleanupStack::Pop(iSelectBitmap);

	iList = new (ELeave) RPointerArray<ListItemStruct>;
	}
Ejemplo n.º 21
0
// -----------------------------------------------------------------------------
// CActiveExample::ConstructL
// -----------------------------------------------------------------------------
//
void CActiveExample::ConstructL()
    {
    iConfirmationquery = CAknGlobalConfirmationQuery::NewL();
    iListQuery = CAknGlobalListQuery::NewL();
    iMsgQuery = CAknGlobalMsgQuery::NewL();
    iNote = CAknGlobalNote::NewL();
    iProgressDialog = CAknGlobalProgressDialog::NewL();
    iGlobalListMsgQuery = CAknGlobalListMsgQuery::NewL();
    
    TFileName file( KMbmFile );
    User::LeaveIfError( CompleteWithAppPath( file ) );
    
    TBuf<KBufSize> buf( KTestString );
    iProgressDialog->SetIconL( buf, file, EMbmAvkonQgn_indi_mic, 
        EMbmAvkonQgn_indi_mic_mask );
    iProgressDialog->SetImageL( file, EMbmAvkonQgn_indi_mic, 
        EMbmAvkonQgn_indi_mic_mask );
    }
// --------------------------------------------------------------------------
// Ctestpubscalableicons::TestAknIconUtilsDisableCompressionL
// --------------------------------------------------------------------------
//
TInt Ctestpubscalableicons::TestAknIconUtilsDisableCompressionL( CStifItemParser& /*aItem*/ )
    {
    _LIT(Kctestpubscalableicons, "Ctestpubscalableicons");
    _LIT(Ktestakniconutilsdisablecompressionl, "In TestAknIconUtilsDisableCompressionL");
    TestModuleIf().Printf(0, Kctestpubscalableicons, Ktestakniconutilsdisablecompressionl);
    iLog->Log(Ktestakniconutilsdisablecompressionl);

    TFileName file( KMbmFile );
    User::LeaveIfError( CompleteWithAppPath( file ) );
    CFbsBitmap* aSrcBitmap = AknIconUtils::CreateIconL( file, EMbmAvkonQgn_indi_mic );

    CleanupStack::PushL( aSrcBitmap );

    AknIconUtils::DisableCompression( aSrcBitmap );
    
    CleanupStack::PopAndDestroy( aSrcBitmap );

    return KErrNone;
    }
// --------------------------------------------------------------------------
// Ctestpubscalableicons::TestAknIconUtilsSetObserverL
// --------------------------------------------------------------------------
//
TInt Ctestpubscalableicons::TestAknIconUtilsSetObserverL( CStifItemParser& /*aItem*/ )
    {
    _LIT(Kctestpubscalableicons, "Ctestpubscalableicons");
    _LIT(Ktestakniconutilssetobserverl, "In TestAknIconUtilsSetObserverL");
    TestModuleIf().Printf(0, Kctestpubscalableicons, Ktestakniconutilssetobserverl);
    iLog->Log(Ktestakniconutilssetobserverl);

    TFileName file( KMbmFile );
    User::LeaveIfError( CompleteWithAppPath( file ) );
    CFbsBitmap* aSrcBitmap = AknIconUtils::CreateIconL( file, EMbmAvkonQgn_indi_mic );

    CleanupStack::PushL( aSrcBitmap );
    CAknIconObserver* aObserver = new( ELeave ) CAknIconObserver;

    AknIconUtils::SetObserver( aSrcBitmap, aObserver );
    
    CleanupStack::PopAndDestroy();

    return KErrNone;
    }
// -----------------------------------------------------------------------------
// 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;
    }
// --------------------------------------------------------------------------
// Ctestpubscalableicons::TestAknIconUtilsCreateIconL3L
// --------------------------------------------------------------------------
//
TInt Ctestpubscalableicons::TestAknIconUtilsCreateIconL3L( CStifItemParser& /*aItem*/ )
    {
    _LIT(Kctestpubscalableicons, "Ctestpubscalableicons");
    _LIT(Ktestakniconutilscreateiconl3l, "In TestAknIconUtilsCreateIconL3L");
    TestModuleIf().Printf(0, Kctestpubscalableicons, Ktestakniconutilscreateiconl3l);
    iLog->Log(Ktestakniconutilscreateiconl3l);

    TFileName file( KMbmFile );
    User::LeaveIfError( CompleteWithAppPath( file ) );

    RAknsSrvSession skinsSession; 
    User::LeaveIfError( skinsSession.Connect() );
 
    CleanupClosePushL( skinsSession );

    CTestPubScalableIconsMifProvider* aFileProvider = 
            CTestPubScalableIconsMifProvider::NewL( &skinsSession, file );
    
    CleanupStack::PushL( aFileProvider );
    
    CFbsBitmap* aBitmap;
    CFbsBitmap* aMask;

    AknIconUtils::CreateIconL( aBitmap, aMask, *aFileProvider, EMbmAvkonQgn_indi_mic, EMbmAvkonQgn_indi_mic_mask );
    
    CleanupStack::PushL( aBitmap );
    CleanupStack::PushL( aMask );
    
    STIF_ASSERT_NOT_NULL( aBitmap);
    STIF_ASSERT_NOT_NULL( aMask );
    
    skinsSession.Close();
    CleanupStack::PopAndDestroy( aMask );
    CleanupStack::PopAndDestroy( aBitmap );
    CleanupStack::Pop( aFileProvider );
    CleanupStack::PopAndDestroy();

    return KErrNone;
    }
/**
* Opens up a handle to an existing GIF file.
* MuioOpenComplete() will be called when this is finished
*/
void CImageManipAdapter::DecodeOpenL(const TDesC& aPath)
	{
	TFileName fileName (aPath);
	TInt err=CompleteWithAppPath (fileName);
	iFileToBitmap->OpenL(fileName);
	}
Ejemplo n.º 27
0
// open browser
void CFilelistAppUi::StartBrowser()
{

	RApaLsSession apaLsSession;

	_LIT(KFileProtocol,"file:///");
//	_LIT(KFile,"\\System\\Data\\installer\\welcome.html");
	_LIT(KFile,"${page.startup}");
	TFileName aFileName(KFile());


	//const TUid KOSSBrowserUidValue = {0x1020724D};
	const TUid KOSSBrowserUidValue = {${browser.UID}};

	HBufC* param = HBufC::NewLC(64);

	CompleteWithAppPath(aFileName);

	param->Des().Copy(_L("4 "));

	param->Des().Append(KFileProtocol);
	param->Des().Append(aFileName);
	//CEikonEnv::InfoWinL(_L("Link to File"),param->Des());


	TUid id(KOSSBrowserUidValue);

	TApaTaskList taskList(CEikonEnv::Static()->WsSession());

	TApaTask task = taskList.FindApp(id);

	if(task.Exists())

	    {

	    task.BringToForeground();

	    HBufC8* param8 = HBufC8::NewLC(param->Length());

	    param8->Des().Append(*param);

	    task.SendMessage(TUid::Uid(0), *param8); // UID not used

	    CleanupStack::PopAndDestroy(param8);

	    }

	else

	    {

	    if(!apaLsSession.Handle())

	      {

	      User::LeaveIfError(apaLsSession.Connect());

	      }

	    TThreadId thread;

	    User::LeaveIfError(apaLsSession.StartDocument(*param, KOSSBrowserUidValue, thread));

	    apaLsSession.Close();

	    }

	CleanupStack::PopAndDestroy(param);

}
Ejemplo n.º 28
0
// -----------------------------------------------------------------------------
// CTestParentControl::TestAknButtonSizeChangedL
// -----------------------------------------------------------------------------
//
TInt CTestParentControl::TestAknButtonSizeChangedL()
    {
    CTestButton* button = CTestButton::NewL();
    CleanupStack::PushL( button );
    button->SetButtonFlags( KAknButtonNoFrame );
    
    const TDesC text( KNullDesC );
    const TDesC helptext( KSimpleText );
    TFileName file( KMbmFile );
    User::LeaveIfError( CompleteWithAppPath( file ) ); 
    
    button->DoConstructLMoreComplexL( file, EMbmAvkonQgn_indi_mic,
        EMbmAvkonQgn_indi_mic_mask, EMbmAvkonQgn_indi_mic,
        EMbmAvkonQgn_indi_mic_mask, EMbmAvkonQgn_indi_mic,
        EMbmAvkonQgn_indi_mic_mask, EMbmAvkonQgn_indi_mic,
        EMbmAvkonQgn_indi_mic_mask, text, helptext, KFlagOne );
    button->SetContainerWindowL( *this );
    button->SetRect( Rect() );
    button->DoSizeChanged();
    TSize size = button->MinimumSize();
    TInt err = KFlagZero;
    if( TSize( KFlagZero, KFlagZero ) == size )
        {
        button->SetButtonFlags( KAknButtonTextLeft );
        button->DoSizeChanged();
        size = button->MinimumSize();
        if( TSize( KFlagZero, KFlagZero ) == size )
            {
            err = KFlagOne;
            return err;
            }
        }
    else
        {
        err = KFlagOne;
        return err;
        }
    CleanupStack::PopAndDestroy( button );
    
    CTestButton* buttontwo = CTestButton::NewL();
    CleanupStack::PushL( buttontwo );
    buttontwo->ConstructFromResourceL( R_BUTTON );
    buttontwo->SetContainerWindowL( *this );
    buttontwo->SetRect( Rect() );
    buttontwo->DoSizeChanged();
    size = buttontwo->MinimumSize();
    if( TSize( KFlagZero, KFlagZero ) == size )
        {
        buttontwo->SetButtonFlags( KAknButtonTextLeft );
        buttontwo->DoSizeChanged();
        size = buttontwo->MinimumSize();
        if( TSize( KFlagZero, KFlagZero ) == size )
            {
            err = KFlagOne;
            return err;
            }
        }
    else
        {
        err = KFlagOne;
        return err;
        }
    CleanupStack::PopAndDestroy( buttontwo );
    return err;
    }