svexserviceapplistview.cpp

来自「演示如何使用的symbian v9服务器应用框架」· C++ 代码 · 共 53 行

CPP
53
字号
// Copyright (c) 2006 Murray Read, All rights reserved

#include "SvexServiceAppListView.h"
#include "SvexInfo.h"

EXPORT_C CSvexServiceAppListView* CSvexServiceAppListView::NewLC(TUid aServiceUid, const CSvexInfoBase& aInfo)
	{
	CSvexServiceAppListView* self = new(ELeave) CSvexServiceAppListView(aServiceUid, aInfo);
	CleanupStack::PushL(self);
	self->ConstructMainPaneL();
	return self;
	}

EXPORT_C CSvexServiceAppListView::CSvexServiceAppListView(TUid aServiceUid, const CSvexInfoBase& aInfo)
: iServiceUid(aServiceUid), iInfo(aInfo)
	{
	}

EXPORT_C CSvexServiceAppListView::~CSvexServiceAppListView()
	{
	delete iService;
	}

EXPORT_C CEikTextListBox* CSvexServiceAppListView::NewListBoxL() const
	{
	return new (ELeave) CAknSingleStyleListBox();
	}

EXPORT_C TInt CSvexServiceAppListView::Count() const
	{
	return iService->MsasiCount();
	}

EXPORT_C void CSvexServiceAppListView::GetText(TInt aIndex, TBuf<KMaxListText>& aText) const
	{
	// Use the app's caption as the list text
	TSvexAppServiceInfo info = iService->MsasiAt(aIndex);
	_LIT(KFormat, "\t%S\t\t");
	// Get the caption from apparc
	TApaAppCaption caption(iInfo.AppCaption(info.iAppUid));
	aText.Format(KFormat, &caption);
	}

EXPORT_C void CSvexServiceAppListView::ConstructMainPaneL()
	{
	// Get the apps list for a service directly from apparc
	iService = iInfo.DirectServiceInfoLC(iServiceUid);
	CleanupStack::Pop();
	CSvexListView::ConstructMainPaneL();
	}


⌨️ 快捷键说明

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