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

📄 smbmusicapfilemgrstorageinfofoldercmd.cpp

📁 索爱手机代码
💻 CPP
字号:
/* Copyright (C) 2006 Sony Ericsson Mobile Communications Japan, Inc. */
/*--------------------------------------------------------------------*/
/**
 * @file  SmbMusicAPFileMgrStorageInfoFolderCmd.cpp
 * @brief 儈儏乕僕僢僋僼傽僀儖娗棟僼僅儖僟忣曬昞帵View僐儅儞僪僋儔僗
 */
/*--------------------------------------------------------------------*/
//曄峏棜楌
//擔晅          |曄峏幰     |撪梕
//--------------+-----------+-------------------------------------------
//2006/07/04    |SDNA挿旜   |怴婯嶌惉
//2006/08/01    |SDNA挿旜   |儘僌弌椡儊僢僙乕僕傪廋惓 (RequestStorageInfoL(), NotifyRequestSongCountInfoCompleteL())
//2006/09/13    |SDNA挿旜   |慜夋柺慗堏帪偵僼僅儖僟忣曬偺昞帵傪僋儕傾偡傞傛偆偵廋惓 (HandleViewCommandImplL())
//2006/09/16    |SDNA挿旜   |儘僌弌椡張棟偺曄峏
//2006/09/25    |SDNA挿旜   |僐儅儞僪ID:ECmdPrepareToExit偺張棟傪捛壛 (HandleViewCommandImplL())
//2006/09/27    |SDNA挿旜   |僐儅儞僪ID:ECmdPrepareToExit偺張棟傪嶍彍 (HandleViewCommandImplL())
//2006/10/01    |SDNA挿旜   |捠抦宯僐儅儞僪偺僀儀儞僩僴儞僪儖傪捛壛 (HandleViewCommandImplL())
//2006/10/11    |SDNA挿旜   |__ASSERT_DEBUG(EFalse, PANIC(KErrArgument))傪嶍彍 (HandleViewCommandImplL())
//2006/10/16    |SDNA挿旜   |儘僌僒乕僶傪僐儞僗僩儔僋僞偐傜庢摼偟側偄傛偆偵曄峏
//2006/10/25    |SDNA挿旜   |iView傪嶍彍 (僐儞僗僩儔僋僞)
//              |           |  - 昁梫偵墳偠偰iView傪CSmbMusicAPFileMgrStorageInfoFolderView宆偵僗僞僥傿僢僋僉儍僗僩偡傞

#include <SmbMusicAPFileMgrExternalInterface.h>

#include "SmbMusicAPFileMgrCommonDef.h"
#include "SmbMusicAPFileMgrStorageInfoFolderCmd.h"
#include "SmbMusicAPFileMgrDebugLog.h"
#include "SmbMusicAPFileMgr.hrh"

USING_NAMESPACE_SEMCJ

/**
 * @param[in]		aAppUi				傾僾儕働乕僔儑儞UI
 * @param[in]		aView				傾僾儕働乕僔儑儞價儏乕
 * @param[in]		aController			傾僋僔儑儞僐儞僩儘乕儔
 */
CSmbMusicAPFileMgrStorageInfoFolderCmd::CSmbMusicAPFileMgrStorageInfoFolderCmd(CSmbMusicAPFileMgrAppUi& aAppUi,
                                                                               CSmbMusicAPFileMgrStorageInfoFolderView& aView,
                                                                               CSmbMusicAPFileMgrActionController& aController)
	:CSmbMusicAPFileMgrCmdBase(aAppUi, aView, aController),
	 iMaxSize(0), iUsedSize(0), iDisplayUnit(CSmbMusicAPFileMgrStorageInfoFolderView::EUnitDefault)
	{
	iSongCountInfo.iMaxSongCount = 0;
	iSongCountInfo.iCurrentSongCount = 0;
	}


/**
 * SpaceMgr僆僽僕僃僋僩(CSmbMusicAPFileMgrStorageInfoFolderCmd::iSpaceMgr)傪惗惉偡傞丏
 */
void CSmbMusicAPFileMgrStorageInfoFolderCmd::ConstructL(void)
	{
	iSpaceMgr = new(ELeave) CSmbMusicAPFileSystemComSpaceMgr();
	}


/**
 * 強桳偡傞僆僽僕僃僋僩傪嶍彍偡傞丏
 */
CSmbMusicAPFileMgrStorageInfoFolderCmd::~CSmbMusicAPFileMgrStorageInfoFolderCmd()
	{
	delete iSpaceMgr;
	}


/**
 * @param[in]		aCommand	僐儅儞僪ID
 */
void CSmbMusicAPFileMgrStorageInfoFolderCmd::HandleViewCommandImplL(TInt aCommand)
	{
	switch(aCommand)
		{
	case ECmdBackView:
		iDisplayUnit = CSmbMusicAPFileMgrStorageInfoFolderView::EUnitDefault;				// 梕検扨埵傪僨僼僅儖僩偵栠偡
		static_cast<CSmbMusicAPFileMgrStorageInfoFolderView&>(iView).ClearStorageInfo();	// 僼僅儖僟忣曬偺昞帵傪僋儕傾偡傞
		ChangeLocalView(TUid::Uid(ESmbMusicAPFileMgrFileView), KNullDesC8);
		break;
	case ECmdChangeUnit:
		ChangeDisplayUnit();
		break;
	default:
		break;
		}
	}


/**
 * 搊榐嬋忣曬傪庢摼偡傞丏(CSmbMusicAPFileMgrActionController::RequestSongCountInfoL())
 * @see NotifyRequestSongCountInfoCompleteL()
 */
void CSmbMusicAPFileMgrStorageInfoFolderCmd::RequestStorageInfoL(void)
	{
	iSpaceMgr->GetMusicCapacityL(iMaxSize);
	iSpaceMgr->GetMusicUsageL(iUsedSize);

	// 搊榐嬋忣曬庢摼(旕摨婜)傪埶棅偡傞
	TInt result = iController.RequestSongCountInfoL(ESmbMusicMWLibDataBox, iSongCountInfo);
	if (result == KErrNone)
		{
		// 僉乕僀儀儞僩傪梷惂偡傞
		iView.DisableKeyEvent();
		OUTPUT_LOG1_MUST("CSmbMusicAPFileMgrActionController::RequestSongCountInfoL(): %d", result);
		}
	else
		{
		OUTPUT_LOG1_ERROR("CSmbMusicAPFileMgrActionController::RequestSongCountInfoL(): %d", result);
		}
	}


/**
 * 庢摼偟偨忣曬傪尦偵丆僼僅儖僟忣曬傪昞帵偝偣傞丏(CSmbMusicAPFileMgrStorageInfoFolderView::ShowStorageInfoL())
 * @see RequestStorageInfoL()
 *
 * @param[in]		aResult				張棟寢壥
 */
void CSmbMusicAPFileMgrStorageInfoFolderCmd::NotifyRequestSongCountInfoCompleteL(TInt aResult)
	{
	// RequestStorageInfoL()屇傃弌偟偺嵺偵峴偭偨僉乕僀儀儞僩梷惂傪夝彍偡傞
	iView.EnableKeyEvent();

	if (aResult == KErrNone)
		{
		OUTPUT_LOG1_MUST("aResult: %d", aResult);
		}		
	else
		{
		OUTPUT_LOG1_ERROR("aResult: %d", aResult);
		}

	static_cast<CSmbMusicAPFileMgrStorageInfoFolderView&>(iView).ShowStorageInfoL(iDisplayUnit, iMaxSize, iUsedSize,
	                                                                              iSongCountInfo.iMaxSongCount,
	                                                                              iSongCountInfo.iCurrentSongCount);
	}


/**
 * 梕検昞帵偺扨埵傪愗傝懼偊傞丏(CSmbMusicAPFileMgrStorageInfoFolderView::SetDisplayUnitL())
 */
void CSmbMusicAPFileMgrStorageInfoFolderCmd::ChangeDisplayUnit(void)
	{
	// 尰嵼昞帵拞偺扨埵偑乽KB乿偺応崌丆昞帵偡傞扨埵傪乽MB乿偵愝掕偡傞
	iDisplayUnit = (iDisplayUnit == CSmbMusicAPFileMgrStorageInfoFolderView::EUnitKB)
	                ? CSmbMusicAPFileMgrStorageInfoFolderView::EUnitMB : CSmbMusicAPFileMgrStorageInfoFolderView::EUnitKB;
	
	TRAPD(error, static_cast<CSmbMusicAPFileMgrStorageInfoFolderView&>(iView).SetDisplayUnitL(iDisplayUnit))
	if (error != KErrNone)
		{
		OUTPUT_LOG2_ERROR("CSmbMusicAPFileMgrStorageInfoFolderView::SetDisplayUnitL(%d): %d", iDisplayUnit, error);
		}
	}


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

⌨️ 快捷键说明

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