📄 smbmusicapmainplayerfilterlistview.cpp
字号:
{
// 埵抲傪寁嶼偡傞
TInt viewWidth = iView->Width();
pointTitle = TPoint(viewWidth*aIndex,KSmbLayout_BASE_Y);
// TRK#10256
pointListbox = TPoint(viewWidth*aIndex,ETitleBarHeight);
}
// 埵抲傪堏摦偡傞
View()->SetControlPosition(TitleBar(), pointTitle);
View()->SetControlPosition(ListBox(), pointListbox);
}
/**
* 僞僀僩儖僶乕丒儕僗僩儃僢僋僗偺昞帵峏怴傪捠抦偡傞
*
* @param aIndex 僀儞僨僢僋僗
*/
void CSmbMusicAPMainPlayerFilterListView::HandleControlStatusUpdatedL()
{
//2006.10.13
//僐儞僩儘乕儖僐儞僥僫偑昤夋桳岠偵側偭偰偄傞応崌
if(EFalse!=View()->IsControlContainerDrawingEnabled())
{
// 僞僀僩儖僶乕偺昤夋傪桳岠偵偡傞
if(EFalse==TitleBar()->IsDrawingEnabled())
{
TitleBar()->EnableDrawingL();
}
// 儕僗僩儃僢僋僗偺昤夋傪桳岠偵偡傞
if(EFalse==ListBox()->IsDrawingEnabled())
{
ListBox()->EnableDrawingL();
}
}
//2006.10.12 TRK#10488
TitleBar()->HandleControlStatusUpdatedL();
ListBox()->HandleControlStatusUpdatedL();
/*
if(EFalse!=View()->IsControlContainerDrawingEnabled())
{
View()->DrawToOffscreen(TitleBar(), TitleBar()->Rect());
View()->DrawToOffscreen(ListBox(), ListBox()->Rect());
View()->DrawToScreen();
}
*/
}
////////////////////////////////////////////////////////////////////////////
// SkonMusicListBox僀儀儞僩
////////////////////////////////////////////////////////////////////////////
/**
* 儕僗僩儃僢僋僗僀儀儞僩
*
* @param[in] aMusicListBox CSkonMusicListBox偺僀儞僗僞儞僗
* @param[in] aEventType 僀儀儞僩偺僞僀僾
* @param[in] aIntParam aType偑EEventFocusMoving, EEventPageMoving偺応崌偼堏摦愭偺TopItemIndex / aType偑EEventFocusMoved, EEventPageMoved, EEventFocusMove, EEventPageMove偺応崌偼堏摦慜偺TopItemIndex
* @param[in] aIntParam2 aType偑EEventFocusMoving, EEventPageMoving偺応崌偼堏摦愭偺CurrentItemIndex / aType偑EEventFocusMoved, EEventPageMoved, EEventFocusMove, EEentPageMove偺応崌偼堏摦慜偺CurrentItemIndex
*/
void CSmbMusicAPMainPlayerFilterListView::HandleMusicListBoxEventL(CSkonMusicListBox* aMusicListBox, const TMusicListBoxEvent aEventType, const TInt aIntParam, const TInt aIntParam2)
{
#ifdef __DEBUG_LOG_MAINPLAYER__
_LIT(KLogFmt, "CSmbMusicAPMainPlayerFilterListView::HandleMusicListBoxEventL()[aEventType = %d, aIntParam = %d, aIntParam2 = %d]");
SmbMusicAPMainPlayerUtility::OutputLog(iLog, 101401, ELogLevelNormal, KLogFmt, aEventType, aIntParam, aIntParam2);
#endif
// 儕僗僩儃僢僋僗傪僠僃僢僋偡傞
if(aMusicListBox!=ListBox())
{
return;
}
// 僀儀儞僩傪僐儅儞僪偵曄姺偟偰僐儅儞僪張棟偡傞
switch(aEventType)
{
// 僇乕僜儖堏摦
case EEventPageMoving: // 儁乕僕堏摦奐巒
{
if(0 <= aIntParam2 && aIntParam2 < ItemCount())
{
HandleListFocusMoving(aIntParam, aIntParam2, aMusicListBox->NumberOfItemsPerLine() * aMusicListBox->NumberOfLinesPerPage()+2);
}
break;
}
case EEventFocusMoving: // 僇乕僜儖堏摦奐巒
{
HandleListFocusMoving(aIntParam, aIntParam2, aMusicListBox->NumberOfItemsPerLine() * aMusicListBox->NumberOfLinesPerPage()+2);
break;
}
case EEventFocusMove: // 僇乕僜儖偺堏摦愭愝掕
case EEventPageMove: // 堏摦愭儁乕僕偺愝掕
{
HandleListFocusMove(aIntParam, aIntParam2, aMusicListBox->NumberOfItemsPerLine() * aMusicListBox->NumberOfLinesPerPage()+2);
break;
}
case EEventFocusMoved: // 僇乕僜儖堏摦廔椆
case EEventPageMoved: // 儁乕僕堏摦廔椆
{
HandleListFocusMoved(aIntParam, aIntParam2, aMusicListBox->NumberOfItemsPerLine() * aMusicListBox->NumberOfLinesPerPage()+2);
// 2006.09.21 暲傋懼偊廋惓丗僼僅乕僇僗偵崌傢偣偰懳徾崁栚傪堏摦偡傞
// 傾僀僥儉堏摦拞偺応崌
if(EFalse!=ListBox()->IsModifyingItem())
{
// aIntParam:topItemIndex
// aIntParam2:currentItemIndex
HandleCommandL(ECmdFilterViewOrderEntryFocusMove);
}
break;
}
// 傾僀僥儉慖戰
case EEventStateChanged: // 暋悢慖戰帪丗傾僀僥儉慖戰捠抦
{
break;
}
// 暲傋懼偊
case EEventRequestExit: // 暲傋懼偊姰椆丄暋悢慖戰姰椆
{
break;
}
case EEventRequestCancel: // 暲傋懼偊僉儍儞僙儖丄暋悢慖戰僉儍儞僙儖
{
break;
}
case EEventStartAction:// 暲傋懼偊儌乕僪帪丗傾僀僥儉堏摦奐巒
{
HandleCommandL(ECmdFilterViewOrderEntrySelect);
}
break;
case EEventFinishAction:// 暲傋懼偊儌乕僪帪丗傾僀僥儉堏摦姰椆
{
HandleCommandL(ECmdFilterViewOrderEntryMove);
}
break;
case EEventCancelAction:// 暲傋懼偊儌乕僪帪丗傾僀僥儉堏摦僉儍儞僙儖
{
HandleCommandL(ECmdFilterViewOrderEntryCancel);
}
break;
}
}
/**
* 儕僗僩僼僅乕僇僗偺堏摦奐巒僀儀儞僩
*
* @param[in] aTopIndex 堏摦愭偺TopItemIndex
* @param[in] aItemIndex 堏摦愭偺CurrentItemIndex
* @param[in] aNumberOfVisibleItems 昞帵懳徾傾僀僥儉偺屄悢
*/
void CSmbMusicAPMainPlayerFilterListView::HandleListFocusMoving(TInt aTopIndex, TInt aItemIndex, TInt aNumberOfVisibleItems)
{
if(0<aTopIndex)
{
aTopIndex--;
}
MakeUpCache(aTopIndex, aItemIndex, aNumberOfVisibleItems);
}
/**
* 儕僗僩僼僅乕僇僗偺堏摦拞僀儀儞僩
*
* @param[in] aTopIndex 堏摦慜偺TopItemIndex
* @param[in] aItemIndex 堏摦慜偺CurrentItemIndex
* @param[in] aNumberOfVisibleItems 昞帵懳徾傾僀僥儉偺屄悢
*/
void CSmbMusicAPMainPlayerFilterListView::HandleListFocusMove(TInt /*aTopIndex*/, TInt /*aItemIndex*/,TInt /*aNumberOfVisibleItems*/)
{
// Add-S PTX-824 D_82400014586 暯壀 2007.09.11
// 僞僀僩儖僶乕傾僀僐儞傪愝掕偡傞
AdjustTitleIconL();
// Add-S PTX-824 D_82400014586 暯壀 2007.09.11
}
/**
* 儕僗僩僼僅乕僇僗偺堏摦姰椆僀儀儞僩
*
* @param[in] aTopIndex 堏摦慜偺TopItemIndex
* @param[in] aItemIndex 堏摦慜偺CurrentItemIndex
* @param[in] aNumberOfVisibleItems 昞帵懳徾傾僀僥儉偺屄悢
*/
void CSmbMusicAPMainPlayerFilterListView::HandleListFocusMoved(TInt /*aTopIndex*/, TInt /*aItemIndex*/,TInt /*aNumberOfVisibleItems*/)
{
// Del-S PTX-824 D_82400014586 暯壀 2007.09.11
// // 僞僀僩儖僶乕傾僀僐儞傪愝掕偡傞
// AdjustTitleIconL();
// Del-E PTX-824 D_82400014586 暯壀 2007.09.11
// 僉乕僈僀僟儞僗傪挷惍偡傞
if(EFalse!=View()->IsViewActivated())
{
// 儕僗僩儃僢僋僗偺僉乕僈僀僟儞僗傪愝掕偡傞
CSakKeyGuidance* keyGuidance = static_cast<CSkonKeyGuidance*>(View()->KeyGuidance());
// CSakKeyGuidance* keyGuidance = STATIC_CAST(CSkonKeyGuidance*, View()->KeyGuidance());
if(NULL!=keyGuidance)
{
// 偦傟偧傟偺夋柺偵墳偠偨僉乕僈僀僟儞僗傪愝掕偡傞
SetupKeyGuidanceL(keyGuidance);
}
//2006.09.25 TRK#9466
if(EFalse!=View()->IsFocused())
{
// 僉乕僈僀僟儞僗傪昞帵偡傞
SetFocus(ETrue);
}
}
}
/**
* 強帩偟偰偄傞僉儍僢僔儏傾僀僥儉傪挷惍偡傞
*
* @param[in] aTopIndex 昞帵懳徾傾僀僥儉孮偺嵟弶偺僀儞僨僢僋僗
* @param[in] aItemIndex 堏摦慜偺CurrentItemIndex
* @param[in] aNumberOfVisibleItems 昞帵懳徾傾僀僥儉偺屄悢
*/
void CSmbMusicAPMainPlayerFilterListView::MakeUpCache(TInt aTopIndex, TInt aItemIndex, TInt aNumberOfVisibleItems)
{
#ifdef __DEBUG_LOG_MAINPLAYER__
_LIT(KLogFmt, "CSmbMusicAPMainPlayerFilterListView::MakeUpCache([aTopIndex = %d, aItemIndex = %d, aNumberOfVisibleItems = %d])");
SmbMusicAPMainPlayerUtility::OutputLog(iLog, 101501, ELogLevelNormal, KLogFmt, aTopIndex, aItemIndex, aNumberOfVisibleItems);
#endif
// 僉儍僢僔儏忣曬傪庢摼偡傞
TInt topIndex = aTopIndex;
// 僒僀僋儕僢僋偱堦斣壓偵堏摦偡傞
if(0>aItemIndex)
{
if(ItemCount() < aNumberOfVisibleItems)
{
topIndex = 0;
}
else
{
topIndex = ItemCount()-aNumberOfVisibleItems;
}
}
// 僒僀僋儕僢僋偱堦斣忋偵堏摦偡傞
else if(ItemCount()<=aItemIndex)
{
// 傾僀僥儉嵞庢摼偡傞
topIndex = 0;
}
// aNumberOfVisibleItems埲忋偵傾僀僥儉偑偁傞偐偼偙偙偱偼堄幆偣偢梫媮偡傞
PostRequestGetListItems(topIndex, aNumberOfVisibleItems);
}
/**
* 儕僗僩儃僢僋僗嵞昤夋僀儀儞僩
*
* @param aMusicListBox [in]
* @param aRect [in]
*/
void CSmbMusicAPMainPlayerFilterListView::HandleMusicListBoxRedrawEvent(CSkonMusicListBox* aMusicListBox, const TRect& aRect)
{
// 儕僗僩儃僢僋僗傪僠僃僢僋偡傞
if(aMusicListBox==ListBox())
{
View()->HandleRedrawEvent(aRect);
}
}
////////////////////////////////////////////////////////////////////////////
// 僼傿儖僞儕僗僩儌僨儖僀儀儞僩
////////////////////////////////////////////////////////////////////////////
/**
* 僾儗僀儎忬懺曄峏捠抦
*
* @param[in] aState 僾儗僀儎忬懺
*/
void CSmbMusicAPMainPlayerFilterListView::HandlePlayerStateChangedL(TBool /*aState*/)
{
AdjustDefaultIndex();
// 儕僗僩儃僢僋僗偺昞帵峏怴傪捠抦偡傞
ListBox()->HandleControlStatusUpdatedL();
}
/**
* 嵞惗嬋偑曄峏偲側偭偨偙偲傪捠抦偡傞丅
* @param[in] aItem 嵞惗懳徾嬋忣曬
*/
void CSmbMusicAPMainPlayerFilterListView::HandlePlayerSongChangedL(TSmbMusicAPSyncEngineItemIndex /*aItem*/)
{
}
// from MSmbMusicAPMainPlayerFilterListModelObserver
/**
* 儕僗僩儌僨儖偺峏怴
*/
void CSmbMusicAPMainPlayerFilterListView::NotifyModelChanged()
{
// 儕僗僩儃僢僋僗偺昞帵峏怴傪捠抦偡傞
ListBox()->HandleControlStatusUpdatedL();
}
/**
* 儕僗僩傾僀僥儉偺峏怴
*
* @param aIndex 僀儞僨僢僋僗斣崋
*/
void CSmbMusicAPMainPlayerFilterListView::NotifyItemChanged(TInt /*aIndex*/)
{
// 儕僗僩儃僢僋僗偺昞帵峏怴傪捠抦偡傞
// 仸傾僀僥儉偩偗偺嵞昤夋偺曽朄傪梫挷嵏
ListBox()->HandleControlStatusUpdatedL();
}
/**
* 傾僀僥儉庢摼梫媮偺捠抦
*
* @param aIndex 僀儞僨僢僋僗斣崋
*/
void CSmbMusicAPMainPlayerFilterListView::NotifyItemRequest(TInt /*aIndex*/)
{
// SkonMusicListBox偐傜MSkonMusicListBoxModel::Item()偑梫媮偝傟偨偲偒偵
// 奩摉偡傞ListItem偑僉儍僢僔儏偝傟偰偄側偄応崌偵偙偺捠抦偑敪峴偝傟傞丅
// PostRequestGetListItems(TInt aTopIndex, TInt aCount)
}
/**
* 夋憸庢摼梫媮偺捠抦
*
* @param aIndex 僀儞僨僢僋僗斣崋
*/
void CSmbMusicAPMainPlayerFilterListView::NotifyImageRequest(TInt aIndex)
{
// SkonMusicListBox偐傜MSkonMusicListBoxItem::Image()偑梫媮偝傟偨偲偒偵
// 奩摉偡傞僒儉僱僀儖夋憸偑枹庢摼偺応崌偵偙偺捠抦偑敪峴偝傟傞丅
// 僒儉僱僀儖庢摼偑昁梫丠
PostRequestThumbnail(aIndex);
}
/**
* 恊奒憌偺夋柺偑偁傞偐偳偆偐
* @return 栴報忣曬
*/
TBool CSmbMusicAPMainPlayerFilterListView::HasParentList()
{
// 攈惗僋儔僗偱宲彸偡傞
return EFalse;
}
/**
* 巕奒憌偺夋柺偑偁傞偐偳偆偐
* @return 栴報忣曬
*/
TBool CSmbMusicAPMainPlayerFilterListView::HasChildList()
{
// 攈惗僋儔僗偱宲彸偡傞
return EFalse;
}
////////////////////////////////////////////////////////////////////////////
// 儌僨儖曄峏捠抦
////////////////////////////////////////////////////////////////////////////
void CSmbMusicAPMainPlayerFilterListView::HandleModelChangedL(TBool aDrawNow)
{
// 搊榐丒嶍彍偱儌僨儖曄峏偑敪惗
// 嵟慜柺偺價儏乕偱偁傞応崌丄僉乕僈僀僟儞僗傪嵞昤夋偡傞
if(EFalse!=View()->IsViewActivated())
{
// 儕僗僩儃僢僋僗偵僼僅乕僇僗傪愝掕偡傞
AdjustDefaultIndex();
if(EFalse!=aDrawNow
//2006.10.14 TRK#11375 僗僋儘乕儖拞偺儌僨儖曄峏偼僉乕僈僀僟儞僗傪昞帵偟側偄乮偪傜偮偒杊巭乯
&& EFalse==View()->IsAction())
{
// 昞帵峏怴傪捠抦偡傞
ListBox()->HandleControlStatusUpdatedL();
//2006.10.13 TRK#11375
// 僉乕僈僀僟儞僗傪昞帵偡傞
DrawKeyGuidanceL();
}
}
}
////////////////////////////////////////////////////////////////////////////
// 僐儅儞僪幚峴
////////////////////////////////////////////////////////////////////////////
// from MSmbAfCommandBase
MSmbAfCommandBase::TSmbAfCmdIdResponse CSmbMusicAPMainPlayerFilterListView::HandleCommandL(TInt aCommandId)
{
// 偦傟偧傟偺攈惗僋儔僗偱宲彸偟偰僐儅儞僪張棟偡傞
// 婎杮僐儅儞僪
switch(aCommandId)
{
case EMainPlayerFilterViewKGCmdSelect: // 崁栚慖戰僐儅儞僪乮抁墴偟乯
case EMainPlayerFilterViewKGCmdChildView: // 巕奒憌夋柺慗堏僐儅儞僪
break;
case EMainPlayerFilterViewKGCmdLongSelect: // 崁栚慖戰僐儅儞僪乮挿墴偟乯
break;
case EMainPlayerFilterViewKGCmdClear: // 僋儕傾乮慜夋柺乯僐儅儞僪
case EMainPlayerFilterViewKGCmdParentView: // 恊奒憌夋柺慗堏僐儅儞僪
return CSmbMusicAPMainPlayerFilterListView::ProcessCommandL(EMainPlayerFilterViewKGCmdParentView);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -