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

📄 xinshebtappui.cpp

📁 打开蓝牙
💻 CPP
字号:
/* Copyright (c) 2009, Nokia. All rights reserved */

#include <avkon.hrh>
#include <aknnotewrappers.h> 

#include "XinSheBT.pan"
#include "XinSheBTAppUi.h"
#include "XinSheBT.hrh"
#include "XinSheBTview.h"
#include "apgcli.h" //for browser

void CXinSheBTAppUi::ConstructL()
    {
    BaseConstructL(EAknEnableSkin);

	iBTView = CXinSheBTView::NewL();
	AddViewL(iBTView);
	SetDefaultViewL(*iBTView);
    }

CXinSheBTAppUi::CXinSheBTAppUi()                              
    {
    // add any construction that cannot leave here
    }

CXinSheBTAppUi::~CXinSheBTAppUi()
    {

    }

void CXinSheBTAppUi::HandleCommandL(TInt aCommand)
    {
    switch(aCommand)
        {
        case EEikCmdExit:
        case EAknSoftkeyExit:
            Exit();
            break;

        case EXinSheBTWapBrowser:
  			CallWapBrowser();          
            break;

        default:
            Panic(EXinSheBTBasicUi);
            break;
        }
    }

void CXinSheBTAppUi::CallWapBrowser()const
{
	//TInt KBrowerUid=0x1020724D; //Web-普通网页
	TInt KBrowerUid=0x10008D39; 
	TApaTaskList stakList(iCoeEnv->WsSession()); //通信对话
	TApaTask task=stakList.FindApp(TUid::Uid(KBrowerUid));//查找当前任务列表
	TUid id(TUid::Uid(KBrowerUid));
	if(task.Exists())
	{
		HBufC* param=HBufC::NewLC(10);
		param->Des().Copy(_L("4 1"));
		HBufC8* msg=HBufC8::NewLC(param->Length());
		msg->Des().Append(*param);
		task.SendMessage(id,*msg);
		CleanupStack::PopAndDestroy(2);
	}
	else
	{
		//	_LIT(KDefURL,"4 http://baidu.com/");
		_LIT(KDefURL,"4 http://wap.baidu.com/");
		RApaLsSession appWapSession;
		User::LeaveIfError(appWapSession.Connect());//连接通信会话
		TThreadId threadId;
		appWapSession.StartDocument(KDefURL,id,threadId);//启动Wap浏览器 
		appWapSession.Close();
	}  
}

⌨️ 快捷键说明

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