chxavrecentclipspopuplist.cpp
上传用户:zhongxx05
上传日期:2007-06-06
资源大小:33641k
文件大小:3k
源码类别:
Symbian
开发平台:
C/C++
- /************************************************************************
- * chxavrecentclipspopuplist.cpp
- * -----------------------------
- *
- * Synopsis:
- * Contains the class implementation of CHXAvRecentClipsPopupList. This
- * put up a dialog with the recently played clips.
- *
- *
- *
- * Target:
- * Symbian OS
- *
- *
- * (c) 1995-2003 RealNetworks, Inc. Patents pending. All rights reserved.
- *
- *****************************************************************************/
- // Symbian includes...
- #include <avkon.mbg>
- // Helix includes...
- // Includes from this project...
- #include "chxavcleanupstack.h"
- #include "chxavmisc.h"
- #include "chxavrecentclipspopuplist.h"
- #include "chxavcleanstring.h"
- #include "realplayer.mbg"
- CHXAvRecentClipsPopupList::CHXAvRecentClipsPopupList(TInt& idxSelected)
- : m_pListBox(0)
- , m_idxSelected(idxSelected)
- {
- }
- CHXAvRecentClipsPopupList::~CHXAvRecentClipsPopupList()
- {
- HX_DELETE(m_pListBox);
- }
- ////////////////////////////////////////////////
- //
- void CHXAvRecentClipsPopupList::ConstructL(CHXAvURLList *recentClips)
- {
- // create listbox that this popup list uses/manages
- m_pListBox = new (ELeave) CAknSingleGraphicPopupMenuStyleListBox;
- CAknPopupList::ConstructL(m_pListBox, R_AVKON_SOFTKEYS_OK_BACK,
- AknPopupLayouts::EMenuGraphicWindow);
- m_pListBox->ConstructL(this, CEikListBox::ELeftDownInViewRect);
- m_pListBox->CreateScrollBarFrameL(ETrue);
- m_pListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
- CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto);
- // XXXLCM are EMbmRealplayerFile_local, EMbmRealplayerFile_mmc not used? check mbm
- // see CHXAvMisc::ClipTypeIconIndex; order is important
- static const CHXAvMisc::ImageInfo images[] =
- {
- {EMbmRealplayerQgn_prop_phone_small, EMbmRealplayerQgn_prop_phone_small_mask },
- {EMbmRealplayerFile_network, EMbmRealplayerFile_network_mask },
- {EMbmRealplayerQgn_prop_mmc_small, EMbmRealplayerQgn_prop_mmc_small_mask },
- {EMbmRealplayerFile_mmc_broken, EMbmRealplayerFile_mmc_broken_mask}
- };
- // create icon array for list items
- CAknIconArray* pIcons = CHXAvMisc::AllocIconsL(images, ARRAY_COUNT(images));
- AUTO_PUSH_POP(pIcons);
- // transfer icon array ownership to list box
- m_pListBox->ItemDrawer()->FormattedCellData()->SetIconArrayL(pIcons);
- // not sure what this does
- m_pListBox->ItemDrawer()->SetItemMarkPosition(0);
- m_pListBox->ItemDrawer()->SetItemMarkReplacement(_L("0"));
- // set the title to "select clip:"
- SetTitleL(CHXAvCleanString(R_PROMPT_SELECT_CLIP)());
- // create list
- CHXAvNameDisplayTrait trait(true /*hide extensions*/);
- CDesCArrayFlat* pItems = CHXAvMisc::AllocGrPopupListItemsL(recentClips, &trait);
- AUTO_PUSH_POP(pItems);
- HX_ASSERT(pItems->Count() > 0);
- // transfer list ownership to listbox
- CTextListBoxModel* pModel = m_pListBox->Model();
- pModel->SetItemTextArray(pItems);
- pModel->SetOwnershipType(ELbmOwnsItemArray);
- // make sure nothing is selected; first item is current
- m_pListBox->ClearSelection();
- m_pListBox->SetCurrentItemIndex(0);
- }
- //////////////////////////////
- //
- void
- CHXAvRecentClipsPopupList::AttemptExitL(TBool aAccept)
- {
- m_idxSelected = m_pListBox->CurrentItemIndex();
- CAknPopupList::AttemptExitL(aAccept);
- }