messagingappbase/mce/src/MceMainViewListContainer.cpp
changeset 1 d09ac5c1e252
parent 0 72b543305e3a
equal deleted inserted replaced
0:72b543305e3a 1:d09ac5c1e252
    39 
    39 
    40 // ================= MEMBER FUNCTIONS =======================
    40 // ================= MEMBER FUNCTIONS =======================
    41 
    41 
    42 
    42 
    43 CMceMainViewListContainer::CMceMainViewListContainer()
    43 CMceMainViewListContainer::CMceMainViewListContainer()
       
    44     : iListBox( NULL ),
       
    45     iListItems( NULL )
    44     {
    46     {
    45     }
    47     }
    46 
    48 
    47 CMceMainViewListContainer::~CMceMainViewListContainer()
    49 CMceMainViewListContainer::~CMceMainViewListContainer()
    48     {
    50     {
    50     delete iListItems;
    52     delete iListItems;
    51     }
    53     }
    52 
    54 
    53 CMceMainViewListContainer* CMceMainViewListContainer::NewL(
    55 CMceMainViewListContainer* CMceMainViewListContainer::NewL(
    54     const TRect& aRect,
    56     const TRect& aRect,
    55     CMsvSessionPtr aSession,
       
    56     CMceBitmapResolver& aBitmapResolver,
       
    57     //TODO:
    57     //TODO:
    58     TMsvId /*aFolderId*/,
    58     TMsvId /*aFolderId*/,
    59     //TODO
    59     //TODO
    60     TMceListType /*aListType*/ )
    60     TMceListType /*aListType*/ )
    61     {
    61     {
    62     CMceMainViewListContainer* self = new (ELeave)
    62     CMceMainViewListContainer* self = new (ELeave)
    63         CMceMainViewListContainer();
    63         CMceMainViewListContainer();
    64     CleanupStack::PushL(self);
    64     CleanupStack::PushL(self);
    65     self->ConstructL( aRect, aSession, aBitmapResolver );
    65     self->ConstructL( aRect );
    66     CleanupStack::Pop(); // self
    66     CleanupStack::Pop(); // self
    67     return self;
    67     return self;
    68     }
    68     }
    69 
    69 
       
    70 // ----------------------------------------------------
       
    71 // CMceMainViewListContainer::CreateListItemsL
       
    72 // ----------------------------------------------------
       
    73 void CMceMainViewListContainer::CreateListItemsL(
       
    74         CMsvSessionPtr aSession,
       
    75         CMceBitmapResolver& aBitmapResolver )
       
    76     {
       
    77     if ( iListBox && !iListItems )
       
    78         {
       
    79         iListItems = CMceMainViewListItemArray::NewL(
       
    80             aSession, KMsvRootIndexEntryId,
       
    81             EMceListTypeMainView, aBitmapResolver );
       
    82         iListBox->Model()->SetItemTextArray( iListItems );
       
    83         iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
       
    84         }
       
    85     }
    70 
    86 
    71 
    87 
    72 // ----------------------------------------------------
    88 // ----------------------------------------------------
    73 // CMceMainViewListContainer::GetHelpContext
    89 // CMceMainViewListContainer::GetHelpContext
    74 // returns helpcontext as aContext
    90 // returns helpcontext as aContext
    79     aContext.iMajor = KMceApplicationUid;
    95     aContext.iMajor = KMceApplicationUid;
    80     aContext.iContext = KMCE_HLP_MESSAGING;
    96     aContext.iContext = KMCE_HLP_MESSAGING;
    81     }
    97     }
    82 
    98 
    83 void CMceMainViewListContainer::ConstructL(
    99 void CMceMainViewListContainer::ConstructL(
    84     const TRect& aRect,
   100         const TRect& aRect )
    85     CMsvSessionPtr aSession,
       
    86     CMceBitmapResolver& aBitmapResolver )
       
    87     {
   101     {
    88     CreateWindowL();
   102     CreateWindowL();
    89     SetRect( aRect );
   103     SetRect( aRect );
    90 
   104 
    91     iListBox = new (ELeave) CAknDoubleLargeStyleListBox ;
   105     iListBox = new (ELeave) CAknDoubleLargeStyleListBox ;
    92 //    CEikTextListBox* listBox = new (ELeave) CAknSingleLargeStyleListBox;
   106 //    CEikTextListBox* listBox = new (ELeave) CAknSingleLargeStyleListBox;
    93     iListBox->ConstructL( this, EAknListBoxSelectionList );
   107     iListBox->ConstructL( this, EAknListBoxSelectionList );
    94 
   108 	
    95     iListItems = CMceMainViewListItemArray::NewL(
       
    96         aSession, KMsvRootIndexEntryId, EMceListTypeMainView, aBitmapResolver );
       
    97 
       
    98     iListBox->Model()->SetItemTextArray( iListItems );
       
    99     iListBox->Model()->SetOwnershipType( ELbmDoesNotOwnItemArray );
       
   100 
   109 
   101     //iSelectedEntries = new (ELeave) CMsvEntrySelection;
   110     //iSelectedEntries = new (ELeave) CMsvEntrySelection;
   102     }
   111     }
   103 
   112 
   104 // ----------------------------------------------------
   113 // ----------------------------------------------------