📄 smbmusicapsonginfoeditview.cpp
字号:
}
else
{
EditReplaceKeyGuidanceL(EEditKeyInEdit);
}
}
}
/**
* (僐乕儖僶僢僋)TextBox 偺僀儀儞僩傪庴偗庢傞
*
* @param[in] aSakTextBox 僥僉僗僩儃僢僋僗偺億僀儞僞
* @param[in] aEventType 僀儀儞僩庬暿
*/
void CSmbMusicAPSongInfoEditView::HandleTextBoxEventL(CSkonTextBox* aSakTextBox, TSkonTextBoxEvent aEventType)
{
switch(aEventType)
{
case EEventCommitted:
{
TInt indexc = CurrentFocusedIndex();
if (EEditMgrTitle == iEditResource->ItemID(indexc))
{
if (aSakTextBox->Text()->Length() == 0)
{
SetControlDetailValueL(indexc);
//娗棟梡啦馁偼徣棯偱偒傑偣傫
WarningShowL(R_SONGINFO_EDIT_WARNING_DIALOG_MGRTITLE);
}
}
}
break;
//EEventEditCanceled 僆儁儗乕僔儑儞儌乕僪拞偱丄曇廤僉儍儞僙儖偝傟偨帪丅
case EEventFepEndByOffKey://儐乕僓偺廔榖僉乕墴壓偵傛傝廔椆
{
iFepEndEvent = ETrue;
iAppUi.HandleOnHookL();
}
break;
default:
{
// 懠偺僀儀儞僩偵懳偟偰丄壗傕偟側偄
}
break;
}
}
/**
* 擖椡壜擻側巆傝暥帤悢偑曄壔偟偨偲偒偺僀儀儞僩傪庴偗庢傞丅
*
* @param[in] aSkonTextBox 僥僉僗僩儃僢僋僗偺億僀儞僞丅
* @param[in] aLastByteLength 擖椡壜擻側巆傝暥帤悢丅
*/
void CSmbMusicAPSongInfoEditView::HandleLastByteChangeEventL(CSkonTextBox* /*aSakTextBox*/, TInt /*aLastByteLength*/)
{
//壗傕偟側偄
}
/**
* 栴報偺桳岠惈傪僙僢僩
*
* @param[in] aValid 桳岠惈偺僼儔僢僌
*/
void CSmbMusicAPSongInfoEditView::CSmbMusicAPSongInfoArrowStateProvider::SetArrowValid(TBool aValid)
{
iValid = aValid;
}
/**
* 栴報忣曬偺採嫙幰傪僙僢僩丟
* 桳岠偺応崌丄乽aArrowStateProvider乿偐傜栴報忣曬傪庢摼偡傞
*
* @param[in] aArrowStateProvider 栴報忣曬偺採嫙幰
*/
void CSmbMusicAPSongInfoEditView::CSmbMusicAPSongInfoArrowStateProvider::SetArrowStateProvider(MSkonArrowStateProvider* aArrowStateProvider)
{
iArrowStateProvider = aArrowStateProvider;
}
/**
* 栴報忣曬傪庢摼偡傞
*
* return 栴報忣曬
*/
TInt CSmbMusicAPSongInfoEditView::CSmbMusicAPSongInfoArrowStateProvider::CurrentArrowState() const
{
if(EFalse != iValid && NULL != iArrowStateProvider)
{
return iArrowStateProvider->CurrentArrowState();
}
return 0;
}
/**
* 僼僅乕僇僗偺NumBox偺僼僅乕僇僗懳徾傪堏摦
*
* @panic KPanicCategory EInvlalidControlItemStatus 塃懁偵僼僅乕僇僗偺忬懺偺憐掕偲堘斀偺応崌
*/
void CSmbMusicAPSongInfoEditView::MoveCurrentNumBoxFocusPos()
{
TInt curIndex = CurrentFocusedIndex();
CSkonHorizontalContainer* hContainer = STATIC_CAST(CSkonHorizontalContainer *, iContainer->ControlByIndex(curIndex));
CCoeControl* leftControl = hContainer->LeftControl();
CCoeControl* rightControl = hContainer->RightControl();
if(leftControl->IsFocused())
{
hContainer->SetFocusingType(1); //塃懁偵僼僅乕僇僗懳徾傪堏摦
leftControl->SetFocus(EFalse, ENoDrawNow);
rightControl->SetFocus(ETrue, ENoDrawNow);
iOperationNumBoxIndex = curIndex;
}
else
{
// 塃懁偵僼僅乕僇僗偺忬懺傪憐掕偱偡
__ASSERT_DEBUG(rightControl->IsFocused(), User::Panic(KPanicCategory, EInvlalidControlItemStatus));
hContainer->SetFocusingType(0); //嵍懁偵僼僅乕僇僗懳徾傪堏摦
leftControl->SetFocus(ETrue, ENoDrawNow);
rightControl->SetFocus(EFalse, ENoDrawNow);
iOperationNumBoxIndex = KNumBoxNotOperation;
// 僉乕傪嵞昤夋偡傞
DrawNow();
}
hContainer->Layout();
}
/**
* (僐乕儖僶僢僋)NumBox 偺僀儀儞僩傪庴偗庢傞
*
* @param[in] aControl 僐儞僩儘乕儖偺億僀儞僞
* @param[in] aEventType 僀儀儞僩庬暿
*/
void CSmbMusicAPSongInfoEditView::HandleControlEventL(CCoeControl* /*aControl*/,TCoeEvent aEventType)
{
switch(aEventType)
{
case EEventRequestExit :
{
// 悢帤崁栚偺曇廤忬懺傪僙僢僩
iItemStatusArray[CurrentFocusedIndex()] = EItemStatusEdit;
// 僼僅乕僇僗懳徾傪堏摦
MoveCurrentNumBoxFocusPos();
}
break;
case EEventRequestCancel :
{
// 僼僅乕僇僗懳徾傪堏摦
MoveCurrentNumBoxFocusPos();
}
break;
case EEventStateChanged :
default:
// 壗傕偟側偄
break;
}
}
/**
* 慖戰僟僀傾儘僌僋儔僗傪惗惉偡傞
*
* @panic KPanicCategory EInvlalidControlItemStatus iConfirmSelect偑NULL偺憐掕偲堘斀偺応崌
* @param result 僟僀傾儘僌偺慖戰寢壥
*/
TInt CSmbMusicAPSongInfoEditView::ConfirmFinishL()
{
// iConfirmSelect偑枅搙弌偰偐傜丄嶍彍偣傟傞偨傔丄NULL偺憐掕偱偡
__ASSERT_DEBUG(NULL == iConfirmSelect, User::Panic(KPanicCategory, EInvalidMemberArgument));
iConfirmSelect = new(ELeave) CSkonSelectionDialog();
//儕僜乕僗傪撉傒崬傓
iConfirmSelect->PrepareLC(R_SONGINFO_EDIT_SELECT_CANCEL);
// 僉儍儞僙儖妋擣拞僼儔僢僌傪僙僢僩
iCancelConfirmEvent = ETrue;
//儌乕僟儖傪昞帵偡傞
TInt result = iConfirmSelect->ShowLD();
// 嶍彍偣傟傞偨傔丄NULL傪僙僢僩
iConfirmSelect = NULL;
// 僉儍儞僙儖妋擣拞僼儔僢僌傪儕僙僢僩
iCancelConfirmEvent = EFalse;
if (KExitSelectYesIndex == result)
{
return ESmbSongInfoExitYes;
}
return ESmbSongInfoExitNo;
}
/**
* 寈崘僟僀傾儘僌僋儔僗傪惗惉偡傞
*
* @panic KPanicCategory EInvlalidControlItemStatus iWarningPopup偑NULL偺憐掕偲堘斀偺応崌
* @param result 僟僀傾儘僌偺昞帵寢壥
*/
TInt CSmbMusicAPSongInfoEditView::WarningShowL(TInt aResourceId)
{
// iWarningPopup偑枅搙弌偰偐傜丄嶍彍偣傟傞偨傔丄NULL偺憐掕偱偡
__ASSERT_DEBUG(NULL == iWarningPopup, User::Panic(KPanicCategory, EInvalidMemberArgument));
iWarningPopup = new(ELeave) CSkonWarningDialog();
//儕僜乕僗傪撉傒崬傓
iWarningPopup->PrepareLC(aResourceId);
//儌乕僟儖傪昞帵偡傞
TInt result = iWarningPopup->ShowLD();
// 嶍彍偣傟傞偨傔丄NULL傪僙僢僩
iWarningPopup = NULL;
return result;
}
/**
* 妋擣僟僀傾儘僌僋儔僗傪惗惉偡傞
*
* @panic KPanicCategory EInvlalidControlItemStatus iConfirmPopup偑NULL偺憐掕偲堘斀偺応崌
* @param result 僟僀傾儘僌偺昞帵寢壥
*/
TInt CSmbMusicAPSongInfoEditView::ConfirmShowL(TInt aResourceId)
{
// iConfirmPopup偑枅搙弌偰偐傜丄嶍彍偣傟傞偨傔丄NULL偺憐掕偱偡
__ASSERT_DEBUG(NULL == iConfirmPopup, User::Panic(KPanicCategory, EInvalidMemberArgument));
iConfirmPopup = new(ELeave) CSkonConfirmDialog();
//儕僜乕僗傪撉傒崬傓
iConfirmPopup->PrepareLC(aResourceId);
//曇廤姰椆拞丄妿偮僋儕傾僉乕傪墴偟偨応崌丄妋擣僟僀傾儘僌傪堦弖偵弌偡
if(EFalse != iClearInFinishEvent)
{
iConfirmPopup->SetAutoCloseTime(1);
}
//儌乕僟儖傪昞帵偡傞
TInt result = iConfirmPopup->ShowLD();
// 嶍彍偣傟傞偨傔丄NULL傪僙僢僩
iConfirmPopup = NULL;
return result;
}
/**
* 旕摨婜偺梫媮傪僉儍儞僙儖偡傞
*/
void CSmbMusicAPSongInfoEditView::CancelRequest()
{
if (iModel.IsRequestGetEditInfo())
{
iModel.CancelGetEditInfo();
}
if (iModel.IsRequestReflectEditInfo())
{
iModel.CancelReflectEditInfo();
}
}
/**
* 曇廤拞巭偡傞
*/
void CSmbMusicAPSongInfoEditView::EditInfoCancelL()
{
if (HasEditItemL() && ESmbSongInfoExitNo == ConfirmFinishL())
return;
//慜夋柺傊栠傞
BackToDetailViewL();
}
/**
* 曇廤偟偨崁栚偑偁傞偐傪僠僃僢僋偡傞
*
* @return 曇廤偟偨崁栚偑偁偭偨応崌丄ETrue傪曉媝偡傞
*/
TBool CSmbMusicAPSongInfoEditView::HasEditItemL()
{
TInt itemCount = iEditResource->EditItemCount();
for(TInt index = 0; index < itemCount; index++)
{
if (EFalse == IsEqualDetailValueL(index))
return ETrue;
}
return EFalse;
}
/**
* 曇廤偟偨崁栚敾掕梡價僢僩偺庢摼
*
* @return 曇廤偟偨崁栚敾掕梡價僢僩
*/
TUint CSmbMusicAPSongInfoEditView::EditPatternL()
{
TUint result = ESmbMusicAPSongInfoEditNone;
TInt itemCount = iEditResource->EditItemCount();
for(TInt index = 0; index < itemCount; index++)
{
if (EFalse == IsEqualDetailValueL(index))
{
result |= iEditResource->EditItemPatternL(index);
}
}
return result;
}
/**
* 僉乕僀儀儞僩張棟
*
* @param[in] aKeyEvent 僉乕僀儀儞僩
* @param[in] aType 僀儀儞僩僞僀僾
* @return 僉乕儗僗億儞僗
* @leave error 曇廤拞巭偑幐攕偟偨応崌
* @leave error 恊僋儔僗偺張棟偑幐攕偟偨応崌
*/
TKeyResponse CSmbMusicAPSongInfoEditView::OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType)
{
if(EEventKey != aType)
{
return EKeyWasNotConsumed;
}
switch(aKeyEvent.iCode)
{
//僋儕傾僉乕
case EWcdmaMpKeyClear:
{
if(KNumBoxNotOperation == iOperationNumBoxIndex)
{
//曇廤姰椆拞偺応崌丄曇廤姰椆拞妿偮僋儕傾僉乕僼儔僢僌傪僙僢僩
if(EFalse != iEditInfoFinishEvent)
{
iClearInFinishEvent = ETrue;
}
else
{
TRAPD(error, EditInfoCancelL());
if(KErrNone != error)
{
//儘僌弌椡
SmbMusicAPSongInfoLog::OutputLog(iLog, ESongInfoLogNo242, ELogLevelLow, error, KSmbMusicAPSongInfoLogEditViewOfferKeyEventLError);
//儕乕僽張棟
User::Leave(error);
}
}
return EKeyWasConsumed;
}
}
break;
case EWcdmaMpKeySelect:
case EWcdmaMpKeyUp:
case EWcdmaMpKeyDown:
{
//曇廤姰椆拞偺応崌丄慖戰僉乕偲忋壓僉乕偑柍岠偲偡傞
if(EFalse != iEditInfoFinishEvent)
{
return EKeyWasConsumed;
}
}
break;
default:
{
//壗傕偟側偄
}
break;
}
TKeyResponse res = EKeyWasNotConsumed;
TRAPD(error, res = CSmbAfView::OfferKeyEventL(aKeyEvent, aType));
if(KErrNone != error)
{
//儘僌弌椡
SmbMusicAPSongInfoLog::OutputLog(iLog, ESongInfoLogNo243, ELogLevelLow, error, KSmbMusicAPSongInfoLogEditViewOfferKeyEventLError);
//儕乕僽張棟
User::Leave(error);
}
return res;
}
/**
* 僼僅乕僇僗偺崁栚傪儕僙僢僩偡傞
*/
void CSmbMusicAPSongInfoEditView::EditInfoResetL()
{
TInt indexc = CurrentFocusedIndex();
SetControlResetValueL(indexc);
//僼僅乕僇僗偺崁栚傪鼐
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -