appinstaller/AppMngr2/inc/appmngr2listcontainer.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Thu, 17 Dec 2009 08:51:10 +0200
changeset 0 ba25891c3a9e
permissions -rw-r--r--
Revision: 200949 Kit: 200951

/*
* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:   Base class definitions for AppMng2 list view containers
*
*/


#ifndef C_APPMNGR2LISTCONTAINER_H
#define C_APPMNGR2LISTCONTAINER_H

#include <coecntrl.h>                   // CCoeControl
#include <eiklbo.h>                     // MEikListBoxObserver

class CAppMngr2Model;
class CAppMngr2InfoBase;
class CAppMngr2ListView;
class CAknDoubleLargeStyleListBox;
class CTextListBoxModel;
class CGulIcon;


class CAppMngr2ListContainer : public CCoeControl, public MEikListBoxObserver
    {
public:     // constructor and destructor
    CAppMngr2ListContainer( CAppMngr2ListView& aView );
    ~CAppMngr2ListContainer();
    
public:     // from CCoeControl
    TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
    void HandleResourceChange( TInt aType );
    void SizeChanged();
    TInt CountComponentControls() const;
    CCoeControl* ComponentControl( TInt aIndex ) const;

public:     // from MEikListBoxObserver
    void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );

public:     // new functions
    TBool IsListEmpty() const;
    void HandleGenericCommandL( TInt aCommand );
    void RefreshL( TBool aPreserveSelectedItem, TBool& aSelectedItemChanged,
            TInt aMoreRefreshesExpected );
    virtual CAppMngr2InfoBase& CurrentItem() const = 0;
    virtual TInt ListEmptyTextResourceId() const = 0;
    
protected:  // new functions
    virtual TInt ItemCount() const = 0;
    virtual CAppMngr2InfoBase& ItemInfo( TInt aIndex ) = 0;
    void ConstructL( const TRect& aRect );
    CAppMngr2Model& Model() const;

private:    // new functions
    void LoadIconsL();
    void CreateItemArrayL();
    void PopulateItemArrayL();
    void DeleteItemSpecificIcons( CArrayPtr<CGulIcon>& aIconArray );
    void SetEmptyTextL( TInt aMoreRefreshesExpected );

protected:  // data
    CAppMngr2ListView& iView;
    CAknDoubleLargeStyleListBox* iListBox;
    CDesCArrayFlat* iItemArray;
    TInt iItemSpecificIcons;
    };

#endif  // C_APPMNGR2LISTCONTAINER_H