smbmusicapmainplayerglobalselectiondialog.cpp
来自「symbian」· C++ 代码 · 共 194 行
CPP
194 行
/* Copyright (C) 2005-2006 Sony Ericsson Mobile Communications Japan, Inc. */
/*-------------------------------------------------------------------------*/
// FileName:
// SmbMusicAPMainPlayerGlobalSelectionDialog.cpp
//
// Description:
// 儈儏乕僕僢僋傾僾儕偱巊梡偡傞僌儘乕僶儖慖戰僟僀傾儘僌偺幚憰丅
/*------------------------------------------------------------------------*/
//曄峏棜楌
//擔晅 |曄峏幰 |撪梕
//--------------+-----------+----------------------------------------------
//2006/06/07 |K3戝嫶 |怴婯嶌惉
//2006/09/06 |K3戝嫶 |QAC寢壥偺懳墳乮VER060810A斉乯
#include "SmbMusicAPMainPlayerPlayDebug.h"
#ifdef __SMBMUSICAP_PTX824_DEF__
#ifndef __SMBAFENV_H__
#include <SmbAfEnv.h>
#endif
#ifndef __SMBLACLIENT_H__
#include <SmbLaClient.h>
#endif
#endif
#ifndef FJAFENV_H__
#include <FjAfEnv.h>
#endif
#ifndef FJLACLIENT_H__
#include <fjlaclient.h>
#endif
#ifndef __SMBMUSICAPMAINPLAYEREXTERNALINTERFACE_H__
#include <SmbMusicAPMainPlayerExternalInterface.h>
#endif
#ifndef __SMBMUSICAPMAINPLAYERGLOBALDIALOGOBSERVER_H__
#include "SmbMusicAPMainPlayerGlobalDialogObserver.h"
#endif
#ifndef __SMBMUSICAPMAINPLAYERUTILITY_H__
#include "SmbMusicAPMainPlayerUtility.h"
#endif
#ifndef __SMBMUSICAPMAINPLAYERGLOBALSELECTIONDIALOG_H__
#include "SmbMusicAPMainPlayerGlobalSelectionDialog.h"
#endif
#include <SmbMainMenu.rsg>
USING_NAMESPACE_DCM
SEMCJ_NAMESPACE_BEGIN
/**
* 僌儘乕僶儖僟僀傾儘僌僋儘乕僘帪偺曉媝抣
*/
#define KSmbMusicAPMainPlayerGlobalDialogYes CSkonDialogBase::ESelectKey ///< "偼偄"傪慖戰
#define KSmbMusicAPMainPlayerGlobalDialogNo 1 ///< "偄偄偊"傪慖戰
#define KSmbMusicAPMainPlayerGlobalDialogClearKey CSkonDialogBase::EClearKey ///< 僋儕傾僉乕墴壓
#define KSmbMusicAPMainPlayerGlobalDialogOnHookKey 2 ///< OnHook僉乕墴壓
/**
* 僐儞僗僩儔僋僞
*
* @param[in] aLauncherSession 僌儘乕僶儖僟僀傾儘僌傪昞帵偝偣傞偨傔偺嶲徠
*/
#ifdef __SMBMUSICAP_PTX824_DEF__
CSmbMusicAPMainPlayerGlobalSelectionDialog::CSmbMusicAPMainPlayerGlobalSelectionDialog(RSmbLaSession& aLauncherSession)
#else
CSmbMusicAPMainPlayerGlobalSelectionDialog::CSmbMusicAPMainPlayerGlobalSelectionDialog(RLauncherSession& aLauncherSession)
#endif
: CActive(EPriorityStandard), iLauncherSession(aLauncherSession), iObserver(NULL), iMessage(NULL)
{
CActiveScheduler::Add(this);
}
/**
* 僨僗僩儔僋僞
*/
CSmbMusicAPMainPlayerGlobalSelectionDialog::~CSmbMusicAPMainPlayerGlobalSelectionDialog()
{
Cancel();
delete iMessage;
}
/**
* 僟僀傾儘僌傪昞帵偡傞
*
* @param[in] aResId TBUF儕僜乕僗ID
* @param[in] aObserver 僌儘乕僶儖僟僀傾儘僌傪暵偠偨偲偒偵捠抦偡傞僆僽僓乕僶
*/
void CSmbMusicAPMainPlayerGlobalSelectionDialog::ShowL(TInt aResId, MSmbMusicAPMainPlayerGlobalDialogObserver* aObserver)
{
if (IsActive() != EFalse) // == ETrue
{// 梫媮張棟拞偺応崌丄僉儍儞僙儖傪峴偆
// 僌儘乕僶儖僟僀傾儘僌昞帵拞偵嵞搙僌儘乕僶儖僟僀傾儘僌傪昞帵偡傞儐乕僗働乕僗偼側偄偨傔丄僷僯僢僋傪偐偗傞
__ASSERT_DEBUG(EFalse, PANIC(9020001));
// Cancel();
//
// delete iMessage;
// iMessage = NULL;
//
// iObserver = NULL;
return;
}
// 儕僜乕僗偐傜儊僢僙乕僕傪庢摼
//__UHEAP_FAILNEXT(1); // UT丗儕僜乕僗撉傒崬傒幐攕
iMessage = CEikonEnv::Static()->AllocReadResourceL(aResId);
iObserver = aObserver;
// 僨僼僅儖僩僼僅乕僇僗傪嵟壓抜偱昞帵
#ifdef __SMBMUSICAP_PTX824_DEF__
iLauncherSession.DisplaySmbNotifierDialog(KSmbMusicAPMainPlayerUid, R_MAINMENU_GLOBAL_NO, *iMessage, 0, iStatus);
#else
iLauncherSession.DisplayNotifierDialog(KSmbMusicAPMainPlayerUid, R_MAINMENU_GLOBAL_NO, *iMessage, iStatus);
#endif
SetActive();
}
/**
* 旕摨婜梫媮姰椆屻偺張棟
*/
void CSmbMusicAPMainPlayerGlobalSelectionDialog::RunL()
{
MSmbMusicAPMainPlayerGlobalDialogObserver::TSmbMusicAPMainPlayerGlobalDialogStatus result;
// if (iStatus.Int() == ESakCommonCmdSelectYes)
// {
// result = MSmbMusicAPMainPlayerGlobalDialogObserver::ESmbMusicAPGlobalDialogYes;
// }
// else if (iStatus.Int() == ESakCommonCmdSelectNo)
// {
// result = MSmbMusicAPMainPlayerGlobalDialogObserver::ESmbMusicAPGlobalDialogNo;
// }
// else if (iStatus.Int() == ESakCommonCmdSelectCancel)
// {
// result = MSmbMusicAPMainPlayerGlobalDialogObserver::ESmbMusicAPGlobalDialogCancel;
// }
if (iStatus.Int() == KSmbMusicAPMainPlayerGlobalDialogYes)
{// 偼偄
result = MSmbMusicAPMainPlayerGlobalDialogObserver::ESmbMusicAPGlobalDialogYes;
}
else if (iStatus.Int() == KSmbMusicAPMainPlayerGlobalDialogNo)
{// 偄偄偊
result = MSmbMusicAPMainPlayerGlobalDialogObserver::ESmbMusicAPGlobalDialogNo;
}
else if (iStatus.Int() == KSmbMusicAPMainPlayerGlobalDialogClearKey)
{// 僋儕傾僉乕墴壓
result = MSmbMusicAPMainPlayerGlobalDialogObserver::ESmbMusicAPGlobalDialogClear;
}
else if (iStatus.Int() == KSmbMusicAPMainPlayerGlobalDialogOnHookKey)
{// OnHook僉乕墴壓
result = MSmbMusicAPMainPlayerGlobalDialogObserver::ESmbMusicAPGlobalDialogOnHook;
}
else
{
// 憐掕奜偺抣
// 僐乕僨傿儞僌儈僗
__ASSERT_DEBUG(EFalse, PANIC(9020002));
_LIT(KLogFmt, "CSmbMusicAPMainPlayerGlobalSelectionDialog::RunL()[err = %d]");
SmbMusicAPMainPlayerUtility::OutputLog(CAfEnv::Static()->Log(), 20001, ELogLevelHigh, KLogFmt, iStatus.Int());
result = MSmbMusicAPMainPlayerGlobalDialogObserver::ESmbMusicAPGlobalDialogErr;
}
if (iObserver != NULL)
{
iObserver->HandleGlobalDialogClosed(result);
}
}
/**
* 僉儍儞僙儖張棟
*/
void CSmbMusicAPMainPlayerGlobalSelectionDialog::DoCancel()
{
// 僟僀傾儘僌傪暵偠傞
iLauncherSession.CloseNotifierDialog(KSmbMusicAPMainPlayerUid);
// 暵偠傜傟偨応崌丄僉儍儞僙儖埖偄偱曉偡
if (iObserver != NULL)
{
iObserver->HandleGlobalDialogClosed(MSmbMusicAPMainPlayerGlobalDialogObserver::ESmbMusicAPGlobalDialogClear);
}
}
SEMCJ_NAMESPACE_END
// end of SmbMusicAPMainPlayerGlobalSelectionDialog.cpp
/* Copyright (C) 2005-2006 Sony Ericsson Mobile Communications Japan, Inc. */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?