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

📄 appsview.cpp

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

#include "AppsView.h"
#include <SvexInfo.h>
#include "ServiceExplorerApp.hrh"
#include <ServiceExplorerApp.rsg>
#include "AppServiceList.h"
#include "SvexService.hrh"
#include <SvexUtil.h>


CAppsView* CAppsView::NewLC(const CSvexInfo& aInfo)
	{
	CAppsView* self = new(ELeave) CAppsView(aInfo);
	CleanupStack::PushL(self);
	self->ConstructMainPaneL();
	return self;
	}

CAppsView::CAppsView(const CSvexInfo& aInfo)
: iInfo(aInfo)
	{
	}

CAppsView::~CAppsView()
	{
	// remove the sub-view if it exists.
	delete iSubView;
	}

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

TInt CAppsView::Count() const
	{
	return iInfo.AppUids().Count();
	}

void CAppsView::GetText(TInt aIndex, TBuf<KMaxListText>& aText) const
	{
	TUid uid = iInfo.AppUids()[aIndex];
	const CSvexAppInfo& app = iInfo.AppInfo(uid);
	const TApaAppCaption& caption = app.AppCaption();
	_LIT(KFormat, "\t%S\t\t");
	aText.Format(KFormat, &caption);
	}

void CAppsView::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
	{
	CSvexListView::DynInitMenuPaneL(aResourceId, aMenuPane);
	if (aResourceId == R_SERVICEEXPLORERAPP_MENU)
        aMenuPane->SetItemDimmed(KSvexCmdIdOpen, Count() == 0);
	}

void CAppsView::OpenL()
	{
	// An app has been selected. Get the app UID...
	TInt index = iListBox->CurrentItemIndex();
	TInt count = iInfo.AppUids().Count();
	if (index < 0 || count <= index)
		return;
	
	TUid uid = iInfo.AppUids()[index];

	// Then launch the sub-view.
	delete iSubView;
	iSubView = 0;
	iSubView = new(ELeave) CAppServiceListDialog(iInfo, uid);
	iSubView->ConstructL(R_SERVICEEXPLORERAPP_APPSERVICE_MENUBAR);
	iSubView->ExecuteLD(R_SERVICEEXPLORERAPP_APPSERVICE_DIALOG);
	iSubView = 0;

	_LIT(KTitle, "Apps");
	SetTitlePaneL(KTitle);
	}

⌨️ 快捷键说明

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