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

📄 smbmusicapsyncservercontentslisthandle.cpp

📁 索爱相关代码。实现功能是server。很有参考价值。代码很难弄到。symbian。
💻 CPP
字号:
/* Copyright (C) 2006 Sony Ericsson Mobile Communications Japan, Inc. */
/*--------------------------------------------------------------------*/
// FileName:
//	SmbMusicAPSyncServerContentsListHandle.cpp
//
// Description:
//	PTX810 Music傾僾儕 摨婜僒乕僶 僐儞僥儞僣僋儔僗
/*--------------------------------------------------------------------*/
//曄峏棜楌
//擔晅			|曄峏幰			|撪梕
//--------------+---------------+--------------------------------------
//2006/06/08	|SDNA 壀嶳			|怴婯嶌惉


#ifndef __SMBMUSICAPSYNCSERVERCONTENTSLISTHANDLE_H__
#include "SmbMusicAPSyncServerContentsListHandle.h"
#endif

#ifndef __SMBMUSICAPSYNCSERVERCONTENTSLIST_H__
#include "SmbMusicAPSyncServerContentsList.h"
#endif

#ifndef __SMBMUSICAPSYNCSERVERUTIL_H__
#include "SmbMusicAPSyncServerUtil.h"
#endif

USING_NAMESPACE_SEMCJ


/**
 僐儞僗僩儔僋僞
 * @param [in]	aLog	RLog偺嶲徠
 * @param [in]	aList	儕僗僩僋儔僗偺億僀儞僞
 * @return	側偟
 */
CSmbMusicAPSyncServerContentsListHandle::CSmbMusicAPSyncServerContentsListHandle(DCM_NAMESPACE::RLog& aLog, CSmbMusicAPSyncServerContentsList* aList)
:iLog(aLog),iList(aList),iAllSelect(EFalse)
	{
	iList->RefarenceCountUp();
	}


/**
 僨僗僩儔僋僞
 * @param	側偟
 * @return	側偟
 */
CSmbMusicAPSyncServerContentsListHandle::~CSmbMusicAPSyncServerContentsListHandle()
	{

	delete iSelectedItem;
	iSelectedItem = 0;

	TInt Cnt = iList->RefarenceCountDown();

	// 嶲徠悢偑0偵側偭偨応崌丄儕僗僩僋儔僗傪攋婞偡傞
	if(Cnt == 0)
		{
		delete iList;
		iList = 0;
		}
	}


/**
 儕僗僩僴儞僪儖僋儔僗偺暋惢傪惗惉偡傞
 * @param	側偟
 * @return	暋惢偝傟偨僋儔僗
 */
CSmbMusicAPSyncServerContentsListHandle* CSmbMusicAPSyncServerContentsListHandle::Duplicate()
	{
	CSmbMusicAPSyncServerContentsListHandle* listHandle = 0;

	TRAPD(err, listHandle = new(ELeave) CSmbMusicAPSyncServerContentsListHandle(iLog, iList););
	if (err != KErrNone)
		{
		_LIT(KContentsListHandle00, "SyncServerContentsListHandle::Duplicate() new(ELeave) Leave %d");
		SmbMusicAPSyncServerLog(iLog,
								(EMusicAPSyncServerClassNumber_ContentsListHandle|EMusicAPSyncServerLocationNumber00),
								ELogLevelHighest,
								KContentsListHandle00,
								err);

		ASSERT(EFalse);
		}

	TInt index = GetIndex();
	if(KSmbMusicAPSyncEngineNoActiveFocusVal != index)
		{
		listHandle->SetSelectedIndex(index);
		}

	return listHandle;
	}


/**
 儕僗僩僋儔僗偺嶲徠傪庢摼偡傞
 * @param	側偟
 * @return	儕僗僩僋儔僗偺嶲徠
 */
CSmbMusicAPSyncServerContentsList& CSmbMusicAPSyncServerContentsListHandle::GetList()
	{
	return *iList;
	}


/**
 慖戰偝傟偨傾僀僥儉偺僀儞僨僢僋僗傪庢摼偡傞
 * @param	側偟
 * @return	慖戰偝傟偨傾僀僥儉偺僀儞僨僢僋僗
 */
TInt CSmbMusicAPSyncServerContentsListHandle::GetIndex()
	{
	if(iSelectedItem)
		{

		TInt index = iSelectedItem->Index();

		if(0 < index)
			{
			return index;
			}
		else
			{
			_LIT(KContentsListHandle01, "SyncServerContentsListHandle::GetIndex() Err");
			SmbMusicAPSyncServerLog(iLog,
									(EMusicAPSyncServerClassNumber_ContentsListHandle|EMusicAPSyncServerLocationNumber01),
									ELogLevelHigh,
									KContentsListHandle01);

			return KSmbMusicAPSyncEngineNoActiveFocusVal;
			}
		}
	else
		{
		if(EFalse != iAllSelect)
			{
			return KSmbMusicAPSyncEngineAllSelectItems;
			}
		else
			{
			return KSmbMusicAPSyncEngineNoActiveFocusVal;
			}
		}
	}


/**
 慖戰偝傟偨傾僀僥儉偺僀儞僨僢僋僗傪愝掕偡傞
 * @param [in]
 * @return		側偟
 */
void CSmbMusicAPSyncServerContentsListHandle::SetSelectedIndex(TInt aIndex)
	{
	// 僀儞僨僢僋僗忣曬傪弶婜壔偡傞
	delete iSelectedItem;
	iSelectedItem = 0;
	iAllSelect = EFalse;

	if(KSmbMusicAPSyncEngineAllSelectItems == aIndex)
		{
		iAllSelect = ETrue;
		}
	else if(0 < aIndex)
		{
		CSmbMusicMWLibListItem& listItem = iList->GetListItem();

		TRAPD(err, iSelectedItem = listItem.GetIteratorL(aIndex););
		if(KErrNone != err)
			{
			_LIT(KContentsListHandle02, "SyncServerContentsListHandle::SetSelectedIndex() GetIteratorL() Leave %d");
			SmbMusicAPSyncServerLog(iLog,
									(EMusicAPSyncServerClassNumber_ContentsListHandle|EMusicAPSyncServerLocationNumber02),
									ELogLevelHighest,
									KContentsListHandle02,
									err);
			}
		}
	else
		{
		_LIT(KContentsListHandle03, "SyncServerContentsListHandle::SetSelectedIndex() Invalid Index %d");
		SmbMusicAPSyncServerLog(iLog,
								(EMusicAPSyncServerClassNumber_ContentsListHandle|EMusicAPSyncServerLocationNumber03),
								ELogLevelHighest,
								KContentsListHandle03,
								aIndex);
		}
	}

// end of SmbMusicAPSyncServerContentsListHandle.cpp
/* Copyright (C) 2006 Sony Ericsson Mobile Communications Japan, Inc. */

⌨️ 快捷键说明

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