示例#1
0
void CFileSelectDialog::PostLayoutDynInitL()
	{
	CAknListQueryDialog::PostLayoutDynInitL();
	CArrayPtr<CGulIcon>* icons;
	icons=new (ELeave) CAknIconArray(1);
    CGulIcon* icon = AknsUtils::CreateGulIconL(AknsUtils::SkinInstance(),KAknsIIDQgnPropEmpty, AknIconUtils::AvkonIconFileName(),EMbmAvkonQgn_prop_empty,EMbmAvkonQgn_prop_empty_mask);	
	icon->SetBitmapsOwnedExternally(EFalse);
	icons->AppendL(icon);
	SetIconArrayL(icons);
	Update();
	Show();
	}
// ---------------------------------------------------------------------------
// CAppMngr2SisxRuntime::LoadIconsL()
// ---------------------------------------------------------------------------
//
void CAppMngr2SisxRuntime::LoadIconsL( CAknIconArray& aIconArray )
    {
    MAknsSkinInstance* skinInstance = AknsUtils::SkinInstance();
    HBufC* iconFilePath = NULL;
    
    iconFilePath = FullBitmapFileNameLC( KAppMngr2SisxIconFileNameMif );

    // Icon loading order in must be the same in which SISX icons
    // are defined in TAppMngr2SisxIcons enum in appmngr2sisx.hrh.
    
    // Icon 0: SIS application icon, EQgnMenuAmSis
    CGulIcon* icon = AknsUtils::CreateGulIconL( skinInstance,
            KAknsIIDQgnMenuAmSis, *iconFilePath,
            EMbmAppmngr2sisxQgn_menu_am_sis,
            EMbmAppmngr2sisxQgn_menu_am_sis_mask );
    CleanupStack::PushL( icon );
    aIconArray.AppendL( icon );
    CleanupStack::Pop( icon );

    // Icon 1: DRM expired rights icon, EQgnPropDrmExpLarge
    icon = AknsUtils::CreateGulIconL( skinInstance,
            KAknsIIDQgnPropDrmRightsExpLarge, *iconFilePath,
            EMbmAppmngr2sisxQgn_prop_drm_exp_large,
            EMbmAppmngr2sisxQgn_prop_drm_exp_large_mask );
    CleanupStack::PushL( icon );
    aIconArray.AppendL( icon );
    CleanupStack::Pop( icon );                                                

    // Icon 2: untrusted SIS application, EQgnIndiAmInstNoAdd
    // Indicator icons are color-skinned as normal icons are
    // graphically-skinned. CreateColorIconL() must be used to
    // create color-skinned icon.
    CFbsBitmap* bitmap = NULL;
    CFbsBitmap* mask = NULL;
    AknsUtils::CreateColorIconLC( skinInstance,
            KAknsIIDQgnIndiAmInstNoAdd,
            KAknsIIDQsnIconColors, EAknsCIQsnIconColorsCG13,
            bitmap, mask, *iconFilePath,
            EMbmAppmngr2sisxQgn_indi_am_inst_no_add,
            EMbmAppmngr2sisxQgn_indi_am_inst_no_add_mask,
            KRgbBlack );
    icon = CGulIcon::NewL( bitmap, mask );
    icon->SetBitmapsOwnedExternally( EFalse );
    CleanupStack::Pop( 2 );   // bitmap and mask, order may vary
    CleanupStack::PushL( icon );
    aIconArray.AppendL( icon );
    CleanupStack::Pop( icon );

    CleanupStack::PopAndDestroy( iconFilePath );
    }
示例#3
0
// -----------------------------------------------------------------------------
// CLandmarksModel::AppendIconL
// 
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CLandmarksModel::AppendIconL(
    const TDesC& aMbmFile, 
    TInt aIconOffset, 
    TInt aMaskOffset)
    {
    TAknsItemID aknsItemId = {0,0};
    CGulIcon* icon = AknsUtils::CreateGulIconL(NULL, aknsItemId,
        aMbmFile, 
        aIconOffset, 
        aMaskOffset);
    CleanupStack::PushL(icon);
    icon->SetBitmapsOwnedExternally(EFalse);
    iIconList->AppendL(icon);
    CleanupStack::Pop(icon);
    }
示例#4
0
// -----------------------------------------------------------------------------
// CLandmarksModel::CreateIconListL
// 
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
CIconList* CLandmarksModel::CreateIconListL()
    {
    CIconList* iconList = new (ELeave) CAknIconArray( KGranularity );

    CleanupStack::PushL(iconList);
    
    // Create the default landmark icon consisting of its image and mask
    TAknsItemID aknsItemId = {0,0};
    CGulIcon* icon = AknsUtils::CreateGulIconL(NULL, aknsItemId,
        KLandmarksMbmFileName, 
        EMbmLmrefappDefault_lm, 
        EMbmLmrefappDefault_lm_mask);
    CleanupStack::PushL(icon);
    icon->SetBitmapsOwnedExternally(EFalse);
    iconList->AppendL(icon);
    CleanupStack::Pop(2, iconList);

    // initialze iIconList. We don't need to delete any possible previous 
    // iIconList since ownership is transferred to calling object.
    iIconList = iconList;

    return iIconList;
    }
// --------------------------------------------------------------------------
// CHomeMediaContainer::UpdatePluginsL
// --------------------------------------------------------------------------
//
void CHomeMediaContainer::UpdatePluginsL()
    {
    __LOG("CHomeMediaContainer::UpdatePluginsL begin");
    CEikFormattedCellListBox* listBox = 
        static_cast<CEikFormattedCellListBox*>( &ListBox() );

    CArrayPtr<CGulIcon>& icons = 
        *listBox->ItemDrawer()->FormattedCellData()->IconArray();
    // Remove old plugins icons
    TInt pluginIcons = icons.Count() - KNumberOfItemsBeforePlugins;
    while( pluginIcons )
        {
        pluginIcons--;
        CGulIcon* icon = icons[ KNumberOfItemsBeforePlugins ];
        icons.Delete( KNumberOfItemsBeforePlugins );
        delete icon;
        icon = NULL;
        }

    for( TInt i = 0; i < iPluginArray.Count(); i++ )
        {
        //append icon
        const CGulIcon& icon = iPluginArray[i]->GetIcon();
        CGulIcon* copyIcon = CGulIcon::NewL( icon.Bitmap(), icon.Mask() );
        CleanupStack::PushL( copyIcon );
        // Icon is handled by us, but bitmaps by plugin
        // when we delete icon, we delete icon only but not bitmaps
        copyIcon->SetBitmapsOwnedExternally( ETrue );
        icons.AppendL( copyIcon ); //Ownership goes to array
        CleanupStack::Pop( copyIcon );

        HBufC* primary = NULL;
        HBufC* secondary = NULL;

        // if title of the plugin is not null alloc space for it
        if ( &(iPluginArray[i]->GetTitle()) )
            {
            primary = ( iPluginArray[i]->GetTitle() ).AllocLC();
            }
        else
            {
            primary = KNullDesC().AllocLC();
            }

        // if secondary text of the plugin is not null alloc space for it
        if ( &(iPluginArray[i]->GetSecondaryText()) )
            {
            secondary = ( iPluginArray[i]->GetSecondaryText() ).AllocLC();
            }
        else
            {
            secondary = KNullDesC().AllocLC();
            }

        AddColumnL( KFormatWithTwoStr,
                    i + KNumberOfItemsBeforePlugins,
                    primary,
                    secondary );

        // deletion of the texts after they have been set to listbox item
        CleanupStack::PopAndDestroy( secondary );
        CleanupStack::PopAndDestroy( primary );
        }
    __LOG("CHomeMediaContainer::UpdatePluginsL end");
    }
// ---------------------------------------------------------
// CDisconnectDlgDialog::PreLayoutDynInitL
// ---------------------------------------------------------
//
void CDisconnectDlgDialog::PreLayoutDynInitL()
    {
    CLOG_ENTERFN("CDisconnectDlgDialog::PreLayoutDynInitL");    
    
    CAknListQueryDialog::PreLayoutDynInitL();
    
    STATIC_CAST( CEikServAppUi*, 
                CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( ETrue );
    
    CConnectionCArray* connArray = iConnModel->GetConnArray();

    // items: application and IAP names
    CDesCArrayFlat* items = new( ELeave )CDesCArrayFlat( connArray->Count() );
    CleanupStack::PushL( items );
    // icons: application icons
    CArrayPtr< CGulIcon >* icons = new( ELeave )CAknIconArray( 
                                                        connArray->Count() );
    CleanupStack::PushL( icons );

    CGulIcon* iconTemp = NULL;
    CGulIcon* icon = NULL;

    TInt count = connArray->Count();
    CLOG_WRITEF(_L( "count: %d" ), count );     

    // Get the info of every connection and initialize the list of dialog
    for( TInt i = 0; i < count; i++ )
        {
        CConnectionInfo* info = connArray->At( i );

        TBool useSharedIcon = EFalse;
        // Application and IAP name
        HBufC* listItem = HBufC::NewLC( KListItemTextBuf );
        TPtrC iap = info->GetIapNameL();
        
        TPtrC app = info->GetAppNameL( useSharedIcon ); 

        // Application icon
        iconTemp = info->GetAppIconL( useSharedIcon );
        icon = CGulIcon::NewL();
        icon->SetBitmapsOwnedExternally( ETrue );
        icon->SetBitmap( iconTemp->Bitmap() );
        icon->SetMask( iconTemp->Mask() );

        icons->AppendL( icon );

        listItem->Des().Format( KFormat, i, &iap, &app );
        items->AppendL( listItem->Des() );

        CleanupStack::PopAndDestroy( listItem ); // listItem
        }

    // set new item list
    SetItemTextArray( items );
    // set icon list
    SetIconArrayL( icons );
    // we don't have to take care of delete items
    SetOwnershipType( ELbmOwnsItemArray );

    CleanupStack::Pop( icons );
    CleanupStack::Pop( items );
    
    iExpiryTimer = CExpiryTimer::NewL( *this );
    iExpiryTimer->Start();

    CLOG_LEAVEFN("CDisconnectDlgDialog::PreLayoutDynInitL");
    }