⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 smbmusicapsyncservercontentsservicegetprevlist.cpp

📁 索爱相关代码。实现功能是server。很有参考价值。代码很难弄到。symbian。
💻 CPP
字号:
/* Copyright (C) 2006 Sony Ericsson Mobile Communications Japan, Inc. */
/*-------------------------------------------------------------------------*/
// FileName:
//  SmbMusicAPSyncServerContentsServiceGetPrevList.cpp
//
// Description:
//  慗堏尦儕僗僩忣曬庢摼梫媮僒乕價僗
/*------------------------------------------------------------------------*/
//曄峏棜楌
//擔晅          |曄峏幰     |撪梕
//--------------+-----------+----------------------------------------------
//2006/06/20	|K3悪杮		| 怴婯嶌惉
//2006/07/06	|K3悪杮		| 僋儔僀傾儞僩偐傜偺儊僢僙乕僕庢摼張棟廋惓
//				|			| 儘僌弌椡廋惓
//				|			| 傾僾儕-僒乕僶娫偺index僆儕僕儞傪挷惍
//2006/10/20	|K3悪杮		| 僐儊儞僩廋惓丒晄梫僿僢僟偺嶍彍


#ifndef __SMBMUSICAPSYNCSERVERCONTENTSSERVICEGETPREVLIST_H__
#include "SmbMusicAPSyncServerContentsServiceGetPrevList.h"
#endif	//  __SMBMUSICAPSYNCSERVERCONTENTSSERVICEGETPREVLIST_H__


#ifndef __E32ERR_H__
#include <e32err.h>	//  僄儔乕僐乕僪
#endif	//  __E32ERR_H__


#ifndef __SMBMUSICAPSYNCSERVERDEF_H__
#include <SmbMusicAPSyncServerDef.h>
#endif	//  __SMBMUSICAPSYNCSERVERDEF_H__


#ifndef __SMBMUSICAPSYNCSERVERCONTENTSSCREENTRACEMANAGER_H__
#include "SmbMusicAPSyncServerContentsScreenTraceManager.h"
#endif	//  __SMBMUSICAPSYNCSERVERCONTENTSSCREENTRACEMANAGER_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			僋儔僀傾儞僩偐傜偺儊僢僙乕僕
 **/
CSmbMusicAPSyncServerContentsServiceGetPrevList::CSmbMusicAPSyncServerContentsServiceGetPrevList(
		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
			)
	{
	}


/**
 *  僨僗僩儔僋僞
 **/
CSmbMusicAPSyncServerContentsServiceGetPrevList::~CSmbMusicAPSyncServerContentsServiceGetPrevList()
	{
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
	TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsServiceGetPrevList | EMusicAPSyncServerLocationNumber00;
	_LIT(KServiceGetPrevListDestruct01, "ServerContentsServiceGetPrevList::~Destruct()");
	SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelNormal, KServiceGetPrevListDestruct01);
#endif
	}


/**
 *  僒乕價僗偺奐巒梫媮
 *
 *  @return	僒乕價僗張棟偺宲懕忬嫷
 **/
TSmbMusicAPSyncServerContentsServiceState CSmbMusicAPSyncServerContentsServiceGetPrevList::StartServiceL()
	{
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
	TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsServiceGetPrevList | EMusicAPSyncServerLocationNumber01;
	_LIT(KServiceGetPrevListStartServiceL01, "ServerContentsServiceGetPrevList::StartServiceL Start");
	SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelLow, KServiceGetPrevListStartServiceL01);
#endif

	//  RMessage偐傜僷儔儊乕僞撉崬
	if (LoadParam() == EFalse)
		{	//  摨婜僄儞僕儞偐傜偺儊僢僙乕僕偑晄惓偩偭偨
		MessageComplete(KErrArgument);
		return ESmbMusicAPSyncServerContetnsServiceStateEnd;
		}

	//  慗堏尦儕僗僩偺庢摼
	TSmbMusicAPSyncEnginePrevListInfo prevListInfo;
	TBool result = iScreenData.GetPrevListInfo(iListHandle, prevListInfo);
	if (result == EFalse)
		{	//  慗堏尦儕僗僩忣曬偺庢摼偵幐攕
		TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsServiceGetPrevList | EMusicAPSyncServerLocationNumber02;
		_LIT(KServiceGetPrevListStartServiceL02, "ServerContentsServiceGetPrevList::StartServiceL GetPrevListInfo Error");
		SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelNormal, KServiceGetPrevListStartServiceL02);

		MessageComplete(KErrNotFound);
		return ESmbMusicAPSyncServerContetnsServiceStateEnd;
		}

	if (prevListInfo.iListItem.iIndex > 0)
		{	//  index偑桳岠側応崌
		prevListInfo.iListItem.iIndex--;	//  index僆儕僕儞傪挷惍
		}

	//  庢摼偟偨慗堏尦儕僗僩忣曬傪彂偒弌偡
	TPckg<TSmbMusicAPSyncEnginePrevListInfo> pkg(prevListInfo);
	TInt error = iRMessage.Write(KSmbMusicAPSyncEngineMsgOut1, pkg);
	if (error != KErrNone)
		{
		TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsServiceGetPrevList | EMusicAPSyncServerLocationNumber03;
		_LIT(KServiceGetPrevListStartServiceL03, "ServerContentsServiceGetPrevList::StartServiceL Message Write Error:%d");
		SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelNormal, KServiceGetPrevListStartServiceL03, error);

		MessageComplete(error);
		return ESmbMusicAPSyncServerContetnsServiceStateEnd;
		}

	MessageComplete(KErrNone);

#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
	logCode = EMusicAPSyncServerClassNumber_ContentsServiceGetPrevList | EMusicAPSyncServerLocationNumber04;
	_LIT(KServiceGetPrevListStartServiceL04, "SyncServerContentsServiceGetPrevList::StartServiceL End");
	SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelLowest, KServiceGetPrevListStartServiceL04);
#endif

	return ESmbMusicAPSyncServerContetnsServiceStateEnd;
	}


/**
 *  僒乕價僗僄儔乕捠抦
 *
 *  @param[in]	aError	僄儔乕僐乕僪
 *
 *  @return	僒乕價僗張棟偺宲懕忬嫷
 **/
TSmbMusicAPSyncServerContentsServiceState CSmbMusicAPSyncServerContentsServiceGetPrevList::ServiceErr(TInt aError)
	{
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
	TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsServiceGetPrevList | EMusicAPSyncServerLocationNumber05;
	_LIT(KServiceGetPrevListServiceErr01, "SyncServerContentsServiceGetPrevList::ServiceErr(%d)");
	SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelNormal, KServiceGetPrevListServiceErr01, aError);
#endif
	//  摨婜張棟側偺偱屇偽傟側偄偼偢丅
	return ESmbMusicAPSyncServerContetnsServiceStateErr;
	}


/**
 *  僒乕價僗僉儍儞僙儖捠抦
 **/
void CSmbMusicAPSyncServerContentsServiceGetPrevList::CancelService()
	{
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
	TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsServiceGetPrevList | EMusicAPSyncServerLocationNumber06;
	_LIT(KServiceGetPrevListCancelService01, "SyncServerContentsServiceGetPrevList::CancelService()");
	SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelLow, KServiceGetPrevListCancelService01);
#endif
	}


/**
 *  僷儔儊乕僞撉崬
 *
 *  @return	僷儔儊乕僞撉崬惉斲(ETrue:栤戣側偟丄EFalse:栤戣偁傝)
 **/
TBool CSmbMusicAPSyncServerContentsServiceGetPrevList::LoadParam()
	{
#ifdef __SMBMUSICAPSYNCSERVER_ENABLEALLLOG__
	TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsServiceGetPrevList | EMusicAPSyncServerLocationNumber07;
	_LIT(KServiceGetPrevListLoadParam01, "SyncServerContentsServiceGetPrevList::LoadParam");
	SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelLow, KServiceGetPrevListLoadParam01);
#endif

	//  摨婜僄儞僕儞偐傜偺梫媮儊僢僙乕僕偺撉崬
	TInt maxLen = iRMessage.GetDesLength(KSmbMusicAPSyncEngineMsgIn1);
	if (maxLen < sizeof(TSmbMusicAPSyncServerContentsReqPkg))
		{	//  僋儔僀傾儞僩偐傜偺梫媮儊僢僙乕僕挿偑堎忢側応崌
		TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsServiceGetPrevList | EMusicAPSyncServerLocationNumber08;
		_LIT(KServiceGetPrevListLoadParam02, "SyncServerContentsServiceGetPrevList::LoadParam Argument In Error:%d");
		SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelNormal, KServiceGetPrevListLoadParam02, maxLen);

		return EFalse;
		}

	TInt error(KErrNone);
	//  梫媮僷僢働乕僕偺撉崬
	TSmbMusicAPSyncServerContentsReqPkg reqPkg;
	TPckg<TSmbMusicAPSyncServerContentsReqPkg> pkg(reqPkg);
	error = iRMessage.Read(KSmbMusicAPSyncEngineMsgIn1, pkg);
	if (error != KErrNone)
		{	//  僋儔僀傾儞僩偐傜偺梫媮儊僢僙乕僕偺撉崬偵幐攕
		TUint32 logCode = EMusicAPSyncServerClassNumber_ContentsServiceGetPrevList | EMusicAPSyncServerLocationNumber09;
		_LIT(KServiceGetPrevListLoadParam03, "SyncServerContentsServiceGetPrevList::LoadParam ContentsReqPkg Load Error:%d");
		SmbMusicAPSyncServerLog(iRLog, logCode, ELogLevelNormal, KServiceGetPrevListLoadParam03, error);

		return EFalse;
		}

	//  慗堏尦傪偺儕僗僩傪庢摼偡傞懳徾偺儕僗僩僴儞僪儖
	iListHandle = reqPkg.iData.iPrevList.iListHandle;

	return ETrue;
	}


// end of SmbMusicAPSyncServerContentsServiceGetPrevList.cpp

/* Copyright (C) 2006 Sony Ericsson Mobile Communications Japan, Inc. */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -