📄 smbmusicapsyncservercontentsserviceplorderitem.cpp
字号:
/* Copyright (C) 2006 Sony Ericsson Mobile Communications Japan, Inc. */
/*-------------------------------------------------------------------------*/
// FileName:
// SmbMusicAPSyncServerContentsServicePLOrderItem.cpp
//
// Description:
// 僾儗僀儕僗僩嬋弴曄峏梫媮僒乕價僗
/*------------------------------------------------------------------------*/
//曄峏棜楌
//擔晅 |曄峏幰 |撪梕
//--------------+-----------+----------------------------------------------
//2006/06/12 |K3悪杮 | 怴婯嶌惉
//2006/07/06 |K3悪杮 | 傾僾儕-僒乕僶娫偺index僆儕僕儞傪挷惍
// | | 儘僌弌椡廋惓
//2006/10/20 |K3悪杮 | 僐儊儞僩廋惓丒晄梫僿僢僟偺嶍彍
#ifndef __SMBMUSICAPSYNCSERVERCONTENTSSERVICEPLORDERITEM_H__
#include "SmbMusicAPSyncServerContentsServicePLOrderItem.h"
#endif // __SMBMUSICAPSYNCSERVERCONTENTSSERVICEPLORDERITEM_H__
#ifndef __E32ERR_H__
#include <e32err.h> // 僄儔乕僐乕僪
#endif // __E32ERR_H__
#ifndef __SMBMUSICAPSYNCSERVERDEF_H__
#include <SmbMusicAPSyncServerDef.h>
#endif // __SMBMUSICAPSYNCSERVERDEF_H__
#ifndef __SMBMUSICMWLIBCLIENT_H__
#include <SmbMusicMWLibClient.h> // CSmbMusicMWLibPLItem
#endif // __SMBMUSICMWLIBCLIENT_H__
#ifndef __SMBMUSICAPSYNCSERVERCONTENTSFUNC_H__
#include "SmbMusicAPSyncServerContentsFunc.h"
#endif // __SMBMUSICAPSYNCSERVERCONTENTSFUNC_H__
#ifndef __SMBMUSICAPSYNCSERVERCONTENTSSCREENTRACEMANAGER_H__
#include "SmbMusicAPSyncServerContentsScreenTraceManager.h"
#endif // __SMBMUSICAPSYNCSERVERCONTENTSSCREENTRACEMANAGER_H__
#ifndef __SMBMUSICAPSYNCSERVERCONTENTSASYNCOBSERVER_H__
#include "SmbMusicAPSyncServerContentsAsyncObserver.h"
#endif // __SMBMUSICAPSYNCSERVERCONTENTSASYNCOBSERVER_H__
#ifndef __SMBMUSICAPSYNCSERVERCONTENTSLIST_H__
#include "SmbMusicAPSyncServerContentsList.h"
#endif // __SMBMUSICAPSYNCSERVERCONTENTSLIST_H__
#ifndef __SMBMUSICAPSYNCSERVERCONTENTSPLORDERMANAGER_H__
#include "SmbMusicAPSyncServerContentsPLOrderManager.h"
#endif // __SMBMUSICAPSYNCSERVERCONTENTSPLORDERMANAGER_H__
#ifndef __SMBMUSICAPSYNCSERVERCONTENTSMANAGERINTERFACE_H__
#include "SmbMusicAPSyncServerContentsManagerInterface.h"
#endif // __SMBMUSICAPSYNCSERVERCONTENTSMANAGERINTERFACE_H__
USING_NAMESPACE_SEMCJ
/**
* 僐儞僗僩儔僋僞
*
* @param[in] aRlog 儘僌僒乕僶
* @param[in] aModel 摨婜僒乕僶儌僨儖
* @param[in] aObserver 旕摨婜僆僽僓乕僶
* @param[in] aFunc 僼傽儞僋僔儑儞
* @param[in] aManagerInterface 儅僱乕僕儍僀儞僞僼僃乕僗
* @param[in] aScreenData 僗僋儕乕儞僩儗乕僗儅僱乕僕儍
* @param[in] aRMessage 僋儔僀傾儞僩偐傜偺儊僢僙乕僕
**/
CSmbMusicAPSyncServerContentsServicePLOrderItem::CSmbMusicAPSyncServerContentsServicePLOrderItem(
DCM_NAMESPACE::RLog& aRlog,
CSmbMusicAPSyncServerModel& aModel,
MSmbMusicAPSyncServerContentsAsyncObserver& aObserver,
CSmbMusicAPSyncServerContentsFunc& aFunc,
MSmbMusicAPSyncServerContentsManagerInterface& aManagerInterface,
CSmbMusicAPSyncServerContentsScreenTraceManager& aScreenData,
const RMessage2& aRMessage
)
:CSmbMusicAPSyncServerContentsServiceBase(
aRlog, aModel, aObserver, aFunc, aManagerInterface, aScreenData, aRMessage
)
{
}
/**
* 僨僗僩儔僋僞
**/
CSmbMusicAPSyncServerContentsServicePLOrderItem::~CSmbMusicAPSyncServerContentsServicePLOrderItem()
{
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsServicePLOrderItem | EMusicAPSyncServerLocationNumber00;
_LIT(KServicePLOrderItemDestruct01, "SyncServerContentsServicePLOrderItem::~Destruct()");
SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelNormal, KServicePLOrderItemDestruct01);
#endif
}
/**
* 僒乕價僗偺奐巒梫媮
*
* @return 僒乕價僗張棟偺宲懕忬嫷
**/
TSmbMusicAPSyncServerContentsServiceState CSmbMusicAPSyncServerContentsServicePLOrderItem::StartServiceL()
{
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsServicePLOrderItem | EMusicAPSyncServerLocationNumber01;
_LIT(KServicePLOrderItemStartServiceL01, "SyncServerContentsServicePLOrderItem::StartServiceL Start");
SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelLow, KServicePLOrderItemStartServiceL01);
#endif
TSmbMusicAPSyncServerContentsPLOrderStatus orderStatus(iManagers.PLOrderManager().OrderStatus());
if (orderStatus != ESmbMusicAPSyncServerContentsPLOrderStateOrdering)
{ // 僾儗僀儕僗僩暲懼儅僱乕僕儍偑暲傃懼偊張棟拞偱側偄応崌
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
logCode = EMusicAPSyncServerClassNumber_ContentsServicePLOrderItem | EMusicAPSyncServerLocationNumber02;
_LIT(KServicePLOrderItemStartServiceL02, "SyncServerContentsServicePLOrderItem::StartServiceL Now Ordering:%d");
SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelNormal, KServicePLOrderItemStartServiceL02, orderStatus);
#endif
MessageComplete(KErrNotReady);
return ESmbMusicAPSyncServerContetnsServiceStateEnd;
}
// RMessage偐傜僷儔儊乕僞撉崬
if (LoadParam() == EFalse)
{ // 摨婜僄儞僕儞偐傜偺儊僢僙乕僕偑晄惓偩偭偨
MessageComplete(KErrArgument);
return ESmbMusicAPSyncServerContetnsServiceStateEnd;
}
// 僾儗僀儕僗僩暲懼儅僱乕僕儍偵暲傃懼偊捠抦
TInt error(iManagers.PLOrderManager().OrderItem(iCurrentIndex, iNewIndex));
if (error != KErrNone)
{
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
logCode = EMusicAPSyncServerClassNumber_ContentsServicePLOrderItem | EMusicAPSyncServerLocationNumber03;
_LIT(KServicePLOrderItemStartServiceL03, "SyncServerContentsServicePLOrderItem::StartServiceL OrderItem Error:%d");
SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelNormal, KServicePLOrderItemStartServiceL03, orderStatus);
#endif
MessageComplete(error);
return ESmbMusicAPSyncServerContetnsServiceStateEnd;
}
MessageComplete(KErrNone);
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
logCode = EMusicAPSyncServerClassNumber_ContentsServicePLOrderItem | EMusicAPSyncServerLocationNumber04;
_LIT(KServicePLOrderItemStartServiceL04, "SyncServerContentsServicePLOrderItem::StartServiceL End");
SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelLowest, KServicePLOrderItemStartServiceL04);
#endif
return ESmbMusicAPSyncServerContetnsServiceStateEnd;
}
/**
* 僒乕價僗僄儔乕捠抦
*
* @param[in] aError 僄儔乕僐乕僪
*
* @return 僒乕價僗張棟偺宲懕忬嫷
**/
TSmbMusicAPSyncServerContentsServiceState CSmbMusicAPSyncServerContentsServicePLOrderItem::ServiceErr(TInt aError)
{
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsServicePLOrderItem | EMusicAPSyncServerLocationNumber05;
_LIT(KServicePLOrderItemServiceErr01, "SyncServerContentsServicePLOrderItem::ServiceErr(%d)");
SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelNormal, KServicePLOrderItemServiceErr01, aError);
#endif
// 摨婜張棟側偺偱屇偽傟側偄偼偢丅
return ESmbMusicAPSyncServerContetnsServiceStateErr;
}
/**
* 僒乕價僗僉儍儞僙儖捠抦
**/
void CSmbMusicAPSyncServerContentsServicePLOrderItem::CancelService()
{
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsServicePLOrderItem | EMusicAPSyncServerLocationNumber06;
_LIT(KServicePLOrderItemCancelService01, "SyncServerContentsServicePLOrderItem::CancelService()");
SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelLow, KServicePLOrderItemCancelService01);
#endif
}
/**
* 僷儔儊乕僞撉崬
*
* @return 僷儔儊乕僞撉崬惉斲(ETrue:栤戣側偟丄EFalse:栤戣偁傝)
**/
TBool CSmbMusicAPSyncServerContentsServicePLOrderItem::LoadParam()
{
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsServicePLOrderItem | EMusicAPSyncServerLocationNumber07;
_LIT(KServicePLOrderItemLoadParam01, "SyncServerContentsServicePLOrderItem::LoadParam");
SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelLow, KServicePLOrderItemLoadParam01);
#endif
// 摨婜僄儞僕儞偐傜偺梫媮儊僢僙乕僕偺撉崬
TInt maxLen = iRMessage.GetDesLength(KSmbMusicAPSyncEngineMsgIn1);
if (maxLen < sizeof(TSmbMusicAPSyncServerContentsReqPkg))
{ // 僋儔僀傾儞僩偐傜偺梫媮儊僢僙乕僕挿偑堎忢側応崌
TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsServicePLOrderItem | EMusicAPSyncServerLocationNumber08;
_LIT(KServicePLOrderItemLoadParam02, "SyncServerContentsServicePLOrderItem::LoadParam Argument 1 Error:%d");
SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelNormal, KServicePLOrderItemLoadParam02, maxLen);
return EFalse;
}
TInt error(KErrNone);
// 梫媮僷僢働乕僕偺撉崬
TSmbMusicAPSyncServerContentsReqPkg reqPkg;
TPckg<TSmbMusicAPSyncServerContentsReqPkg> pkg(reqPkg);
error = iRMessage.Read(KSmbMusicAPSyncEngineMsgIn1, pkg);
if (error != KErrNone)
{ // 僋儔僀傾儞僩偐傜偺梫媮儊僢僙乕僕偺撉崬偵幐攕
TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsServicePLOrderItem | EMusicAPSyncServerLocationNumber09;
_LIT(KServicePLOrderItemLoadParam03, "SyncServerContentsServicePLOrderItem::LoadParam ContentsReqPkg Load Error:%d");
SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelNormal, KServicePLOrderItemLoadParam03, error);
return EFalse;
}
// 暲傃懼偊Index
iCurrentIndex = reqPkg.iData.iOrderItem.iSrcIndex + 1; // index僆儕僕儞傪挷惍
iNewIndex = reqPkg.iData.iOrderItem.iDstIndex + 1; // index僆儕僕儞傪挷惍
return ETrue;
}
// end of SmbMusicAPSyncServerContentsServicePLOrderItem.cpp
/* Copyright (C) 2006 Sony Ericsson Mobile Communications Japan, Inc. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -