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

📄 svexserviceappappview.cpp

📁 symbian下读取服务的程序
💻 CPP
字号:
// Copyright (c) 2006 Murray Read, All rights reserved

#include "SvexServiceAppAppView.h"
#include "SvexServiceAppAppUi.h"
#include "SvexService.hrh"
#include "SvexService.h"

const TInt KMaxTextLen = 64;


CSvexServiceAppAppView* CSvexServiceAppAppView::NewL(CSvexServiceAppAppUi* aAppUi, const CSvexInfoBase& aInfo)
	{
	CSvexServiceAppAppView* self = new(ELeave) CSvexServiceAppAppView(aAppUi, aInfo);
	CleanupStack::PushL(self);
	self->ConstructMainPaneL();
	CleanupStack::Pop(self);
	return self;
	}

CSvexServiceAppAppView::~CSvexServiceAppAppView()
	{
	}

CSvexServiceAppAppView::CSvexServiceAppAppView(CSvexServiceAppAppUi* aAppUi, const CSvexInfoBase& aInfo)
: CSvexServiceAppListView(TUid::Uid(KSvexServiceInfoServiceUid), aInfo), iAppUi(aAppUi)
	{
	}

void CSvexServiceAppAppView::OpenL()
	{
	TInt index = iListBox->CurrentItemIndex();
	TInt count = iService->MsasiCount();
	if (index < 0 || count <= index)
		return;
	
	TUid uid = iService->MsasiAt(index).iAppUid;
	// if an app has been selected, ask the app UI to show
	// the info for that app
	iAppUi->ShowAppL(uid);
	}


CSvexServiceDialog* CSvexServiceDialog::NewL(const TSvexAppServiceInfo& aReg, const CSvexInfoBase& aInfo)
	{
	CSvexServiceDialog* self = new(ELeave) CSvexServiceDialog(aReg, aInfo);
	CleanupStack::PushL(self);
	self->ConstructL();
	CleanupStack::Pop(self);
	return self;
	}

CSvexServiceDialog::~CSvexServiceDialog()
	{
	}

CSvexServiceDialog::CSvexServiceDialog(const TSvexAppServiceInfo& aReg, const CSvexInfoBase& aInfo)
: CAppServiceInfoDialog(aReg, aInfo)
	{
	}

// ServiceApp's registration detail dialog uses 
// CSvexServiceServiceInfo::ExtractInfoLC() to get the details
// of a Service Info Service registration from the opaque_data
// field of the registration.
void CSvexServiceDialog::DialogTextL()
	{
	TBuf<KMaxTextLen> b;
	
	_LIT(KAppName, "App name:\n");
	AppendTextL(KAppName);
	AppendTextL(iInfo.AppCaption(iReg.iAppUid));
	_LIT(KCrlf, "\n");
	AppendTextL(KCrlf);
	_LIT(KAppUid, "App UID:\n");
	AppendTextL(KAppUid);
	_LIT(KHexFormat, "0x%08x");
	b.Format(KHexFormat, iReg.iAppUid);
	AppendTextL(b);
	AppendTextL(KCrlf);
	AppendTextL(KCrlf);
	
	TUid service;
	HBufC* name;
	CSvexServiceServiceInfo::ExtractInfoLC(iReg, service, name);

	_LIT(KRecServ, "Recognised service UID:\n");
	AppendTextL(KRecServ);
	b.Format(KHexFormat, service.iUid);
	AppendTextL(b);
	_LIT(KAny, " (any)");
	if (service.iUid == 0)
		AppendTextL(KAny);
	AppendTextL(KCrlf);

	_LIT(KRecName, "Recognised service name:\n");
	AppendTextL(KRecName);
	AppendTextL(*name);
	AppendTextL(KCrlf);

	CleanupStack::PopAndDestroy(name);
	}


⌨️ 快捷键说明

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