📄 smbmusicapsonginfourlcmd.cpp
字号:
/* Copyright (C) 2006 Sony Ericsson Mobile Communications Japan, Inc. */
/*-------------------------------------------------------------------------*/
// FileName:
// SmbMusicAPSongInfoURLCmd.cpp
//
// Description:
// 儈儏乕僕僢僋梡徻嵶忣曬昞帵-URL昞帵夋柺僐儅儞僪僋儔僗
/*-------------------------------------------------------------------------*/
//曄峏棜楌
//擔晅 |曄峏幰 |撪梕
//---------------------------------------------------------------------------
//2006/04/17 |SEMCJ嬥岝 |怴婯嶌惉
#ifndef __SMBBRUEXTERNALINTERFACE_H__
#include <SmbBruExternalInterface.h>
#endif
#include "SmbMusicAPSongInfoURLCmd.h"
#include "SmbMusicAPSongInfoExternalInterface.h"
USING_NAMESPACE_SEMCJ
///////////////////////////////////////////////////////////////////////////////
/**
* 僐儞僗僩儔僋僞
*
* @param[in] aView 價儏乕僆僽僕僃僋僩
* @param[in] aModel 儌僨儖僆僽僕僃僋僩
* @param[in] aCmdObserver 僐儅儞僪僆僽僓乕僶僆僽僕僃僋僩
* @param[in] aLauncher 儔儞僠儍乕僙僢僔儑儞
* @param[in] aLog 儘僌僒乕僶偺僙僢僔儑儞
*/
CSmbMusicAPSongInfoURLCmd::CSmbMusicAPSongInfoURLCmd(CSmbMusicAPSongInfoURLView& aView,
CSmbMusicAPSongInfoModel& aModel,
MSmbMusicAPSongInfoCmdObserver& aCmdObserver,
RLauncherSession& aLauncher,
RLog& aLog)
:CSmbMusicAPSongInfoCmdBase(aModel, aCmdObserver, aLauncher, aLog), iView(aView)
{
}
/**
* View偵屌桳偺僐儅儞僪張棟
*
* @param[in] aCommand 僐儅儞僪ID
* @leave KErrArgument 巜掕偝傟偨僐儅儞僪ID偑憐掕奜偺抣偺応崌
*/
void CSmbMusicAPSongInfoURLCmd::HandleViewCommandL(TInt aCommand)
{
//僐儅儞僪梷惂僼儔僌傪僠僃僢僋偡傞
if(EFalse != iCommandControl)
{
//僐儅儞僪梷惂拞偺偨傔丄壗傕張棟偟側偄
return;
}
switch(aCommand)
{
case ECmdStartBrowser:
{
//僐儞僥儞僣昞帵婲摦張棟
TRAPD(error, StartBrowserL());
if(KErrNone != error)
{
//儘僌弌椡
SmbMusicAPSongInfoLog::OutputLog(iLog, ESongInfoLogNo044, ELogLevelHighest, error, KSmbMusicAPSongInfoLogApplicationStartErr);
//儕乕僽張棟
User::Leave(error);
}
}
break;
case ECmdChangeDetailView:
{
//徻嵶忣曬昞帵夋柺昞帵張棟
TRAPD(error, StartDetailL());
if(KErrNone != error)
{
//儘僌弌椡
SmbMusicAPSongInfoLog::OutputLog(iLog, ESongInfoLogNo212, ELogLevelHighest, error, KSmbMusicAPSongInfoLogStartDetailLErr);
//儕乕僽張棟
User::Leave(error);
}
}
break;
default:
{
//儘僌弌椡
TBuf<KSmbMusicAPSongInfoLogFormatLength> log;
log.Format(KSmbMusicAPSongInfoLogUnexpectCommandErr, aCommand);
SmbMusicAPSongInfoLog::OutputLog(iLog, ESongInfoLogNo210, ELogLevelHighest, KErrArgument, log);
//儕乕僽張棟
User::Leave(KErrArgument);
}
break;
}
}
/**
* 僐儞僥儞僣昞帵婲摦張棟
*/
void CSmbMusicAPSongInfoURLCmd::StartBrowserL()
{
//僐儞僥儞僣昞帵婲摦梫媮
TSmbBruViewerInfo param;
param.iURL = iModel.DetailInfo().iDetailSongInfo->DetailSongInfo()->iUrlInfo;
TSmbBruViewerInfoBuf* buf = new(ELeave) TSmbBruViewerInfoBuf(param);
TInt result = iLauncherSession.StartApp(KSmbBruUid, KSmbBruViewUid, KSmbBruViewerFromMusicPlayerUid, *buf);
delete buf;
if(KErrNone != result)
{
//儘僌弌椡
SmbMusicAPSongInfoLog::OutputLog(iLog, ESongInfoLogNo054, ELogLevelHighest, result, KSmbMusicAPSongInfoLogStartAppFuncErr);
//儕乕僽張棟
User::Leave(result);
}
}
/**
* 徻嵶忣曬曇廤夋柺昞帵張棟
*
* @leave result StartApp偺栠傝抣偑KErrNone偱偼側偄応崌
*/
void CSmbMusicAPSongInfoURLCmd::StartDetailL()
{
//徻嵶忣曬曇廤夋柺昞帵
TInt result = ChangeLocalView(TUid::Uid(ESmbMusicAPSongInfoDetailView), KNullDesC8);
if(KErrNone != result)
{
//儘僌弌椡
SmbMusicAPSongInfoLog::OutputLog(iLog, ESongInfoLogNo217, ELogLevelHighest, result, KSmbMusicAPSongInfoLogChangeViewErr);
//儕乕僽張棟
User::Leave(result);
}
}
// end of SmbMusicAPSongInfoURLCmd.cpp
/* Copyright (C) 2006 Sony Ericsson Mobile Communications Japan, Inc. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -