亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? devicelistcontainer.cpp

?? Series_60_DP_1_0_2_0_Thread_And_Active_Objects_Example_v1_0 Symbian os S60線程與活動對象實例
?? CPP
字號:
/*
* ============================================================================
*  Name     : CDeviceListContainer from DeviceListContainer.h
*  Part of  : ThreadAO
*  Created  : 12.1.2005 by Forum Nokia
*  Version  : 1.0
*  Copyright: Nokia Corporation
* ============================================================================
*/

// INCLUDE FILES

// Class include
#include "DeviceListContainer.h"
#include "SharedIntermediator.h"
#include <aknnotewrappers.h>
#include "ThreadAOAppUi.h"
#include "BTDiscoverer.h" // KBTDeviceAddress

// System includes
#include <aknlists.h>		// CAknSingleStyleListBox
#include <barsread.h>		// TResource Reader
#include <eikclbd.h>		// CColumnListBoxData
#include <eikmenub.h>		// CEikMenuBar
#include <ThreadAO.rsg>		// R_DEVICE_LIST_LISTBOX
#include <stringloader.h>	// StringLoader
#include <uikon.hrh>		// TKeyCode #defines


const TInt KAknExListAddItemBufLength(256);
#define KListBoxPosition TPoint(0,0) 

_LIT( KListBoxHeader, "Bluetooth devices:");

CDeviceListContainer::CDeviceListContainer() : iSMediator(NULL)
	{	
	}

// ----------------------------------------------------------------------------
// CDeviceListContainer::ConstructL(const TRect& aRect)
//
// Symbian OS 2nd phase constructor. Creates a Window for the 
// controls, which it contains. Constructs a label and adds it to the window, 
// which it then activates.
// param aRect The rectangle for this window
// ----------------------------------------------------------------------------	
void CDeviceListContainer::ConstructL(const TRect& aRect)
	{
	 CreateWindowL();
	
	// Create the listbox
	iDeviceListBox = new (ELeave) CAknSingleStyleListBox;
	iDeviceListBox->SetContainerWindowL(*this);
	
	// Create from resource
	TResourceReader reader;
	CEikonEnv::Static()->CreateResourceReaderLC(reader, R_DEVICE_LIST_LISTBOX);
	iDeviceListBox->ConstructFromResourceL(reader);

	CleanupStack::PopAndDestroy(); // reader

	// Observe the list
	iDeviceListBox->SetListBoxObserver(this);

	// Set scroll bars
	CreateScrollBarsL();
	SetRect(aRect);
	ActivateL();

	// Use listbox first cell as a header
	AddItemL(KListBoxHeader);
	}


// ----------------------------------------------------------------------------
// CDeviceListContainer::CreateScrollBarsL()
//
// Creates vertical scrollbars for the list. Scrollbars are always visible.
// ----------------------------------------------------------------------------
void CDeviceListContainer::CreateScrollBarsL()
	{
	iDeviceListBox->CreateScrollBarFrameL();
	iDeviceListBox->ScrollBarFrame()->SetScrollBarVisibilityL(
		CEikScrollBarFrame::EOn, CEikScrollBarFrame::EOn);
	}


// ----------------------------------------------------------------------------
// Symbian OS 2 phase constructor.
//
// Constructs the CDeviceListContainer using the NewLC method, popping
// the constructed object from the CleanupStack before returning it.
// 
// ----------------------------------------------------------------------------
CDeviceListContainer* CDeviceListContainer::NewL(const TRect& aRect)
	{
	CDeviceListContainer* self = CDeviceListContainer::NewLC(aRect);
	CleanupStack::Pop(self);
	return self;
	}

// ----------------------------------------------------------------------------
// Symbian OS 2 phase constructor.
//
// discussion Constructs the CDeviceListContainer using the constructor and ConstructL 
// method, leaving the constructed object on the CleanupStack before returning it.
// 
// ----------------------------------------------------------------------------
CDeviceListContainer* CDeviceListContainer::NewLC(const TRect& aRect)
	{
	CDeviceListContainer* self = new (ELeave) CDeviceListContainer;
	CleanupStack::PushL(self);
	self->ConstructL(aRect);
	return self;
	}

// ----------------------------------------------------------------------------
// Destructor.  Frees up memory.
// ----------------------------------------------------------------------------
CDeviceListContainer::~CDeviceListContainer()
	{
	delete iDeviceListBox;
	iDeviceListBox = 0;
	}

// ----------------------------------------------------------------------------
// CDeviceListContainer::SizeChanged()
//
// Called by framework when the view size is changed.
// ----------------------------------------------------------------------------
//
void CDeviceListContainer::SizeChanged()
	{
	iDeviceListBox->SetExtent (KListBoxPosition, iDeviceListBox->MinimumSize());
	}


// ----------------------------------------------------------------------------
// CDeviceListContainer::CountComponentControls() const
//
// Returns number of components.
// ----------------------------------------------------------------------------
//
TInt CDeviceListContainer::CountComponentControls() const
	{
	return 1;
	}

// ----------------------------------------------------------------------------
// CDeviceListContainer::ComponentControl(TInt aIndex) const
//
// Returns pointer to particular component.
// ----------------------------------------------------------------------------
//
CCoeControl* CDeviceListContainer::ComponentControl(TInt aIndex) const
	{
	switch (aIndex)
		{
		case 0:
			return iDeviceListBox;
		default:
			return NULL;
		}
	}
// ----------------------------------------------------------------------------
// CDeviceListContainer::Draw(const TRect& aRect) const
//
// Fills the window's rectangle.
// ----------------------------------------------------------------------------
//
void CDeviceListContainer::Draw(const TRect& aRect) const
	{
	CWindowGc& gc = SystemGc();
	gc.Clear(aRect);
	}


// ----------------------------------------------------------------------------
// CDeviceListContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent,
// TEventCode aType)
//
// Handles the key events.
// ----------------------------------------------------------------------------
//
TKeyResponse CDeviceListContainer::OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType)
	{
	if (iDeviceListBox)
		return iDeviceListBox->OfferKeyEventL (aKeyEvent, aType);
	else
		return EKeyWasNotConsumed;
	}


// ----------------------------------------------------------------------------
// CDeviceListContainer::HandleListBoxEventL(CEikListBox* aListBox, 
//                      	 TListBoxEvent aEvent)
//
// Handles listbox event.
// ----------------------------------------------------------------------------
void CDeviceListContainer::HandleListBoxEventL(CEikListBox* /*aListBox*/, TListBoxEvent aEvent)
	{	
	// Select Key has been pressed
	if ((aEvent == MEikListBoxObserver::EEventEnterKeyPressed) ||
		(aEvent == MEikListBoxObserver::EEventItemClicked))
		{
		ShowSelectedAddressL();
		}
	}


// ----------------------------------------------------------------------------
// CDeviceListContainer::AddItemL(const TDesC& aNewItem)
//
// Add an item to the listbox.
// ----------------------------------------------------------------------------
void CDeviceListContainer::AddItemL(const TDesC& aNewItem)
	{
		
	CTextListBoxModel* model = iDeviceListBox->Model();  
	CDesCArray* deviceArray = static_cast <CDesCArray*> (model->ItemTextArray());
	
	TBuf <KAknExListAddItemBufLength> addedItem( 0 );
	
	// Listbox icon is required at the beginning of a descriptor, " \t" if there is no icon.
	_LIT( beginning, " \t");
	addedItem.Append( beginning );
	addedItem.Append( aNewItem );

	// Insert a new item into the array
	deviceArray->InsertL(deviceArray->Count(), addedItem);
	}

// ----------------------------------------------------------------------------
// CDeviceListContainer::HandleChangedL()
//
// Notify that the listbox should be redrawn. 
// ----------------------------------------------------------------------------
void CDeviceListContainer::HandleChangedL()
	{
	iDeviceListBox->HandleItemAdditionL();
	}

// ----------------------------------------------------------------------------
// CDeviceListContainer::ShowSelectedAddressL()
//
// Shows bluetooth address. 
// ----------------------------------------------------------------------------
void CDeviceListContainer::ShowSelectedAddressL()
	{
	if (iDeviceListBox)
		{
		CTextListBoxModel* model = iDeviceListBox->Model();  // Not taking ownership
		
		if (model->NumberOfItems() > 0)
			{
			
            // Selected item if you want to show
			TInt itemIndex = iDeviceListBox->CurrentItemIndex();			
	
			// First item in the listbox is header not tbluetoothinfo
			if (itemIndex > 0) 
				{
				TBuf <KBTDeviceAddress> address;
				iSMediator->GetAddress(address, itemIndex -1);
	
				// Display address using an information note
				CAknInformationNote* addressNote = new (ELeave) CAknInformationNote;
				addressNote->ExecuteLD(address);
				}				
			}
		}
	
	}

// ----------------------------------------------------------------------------
// CDeviceListContainer::SetSMediator(CSharedIntermediator* aSMediator)
//
// Set a shared intermediator for this class.
// ----------------------------------------------------------------------------
void CDeviceListContainer::SetSMediator(CSharedIntermediator* aSMediator)
	{
	iSMediator = aSMediator;
	}


// ----------------------------------------------------------------------------
// CDeviceListContainer::ClearListBox()
//
// Clear listbox.
// ----------------------------------------------------------------------------
void CDeviceListContainer::ClearListBox()
	{
	CTextListBoxModel* model = iDeviceListBox->Model();
	CDesCArray* deviceArray = static_cast <CDesCArray*>(model->ItemTextArray());
	deviceArray->Reset();
	}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一二三区精品| 一区二区三区在线看| 国产欧美一区二区精品久导航| 中文字幕 久热精品 视频在线 | 日本不卡一二三区黄网| 国产最新精品精品你懂的| 99久免费精品视频在线观看 | 日韩激情一二三区| 国产在线看一区| 97精品久久久久中文字幕| 欧美一级精品大片| 国产精品国产三级国产普通话99| 亚洲mv在线观看| 国产老妇另类xxxxx| 在线欧美一区二区| www国产精品av| 亚洲国产一区二区在线播放| 国产精品自拍网站| 欧美日韩一卡二卡三卡 | 成人精品小蝌蚪| 欧美日韩国产天堂| 国产精品人成在线观看免费| 五月婷婷综合网| 91原创在线视频| 欧美精品一区二区久久婷婷 | 欧美一区二区三区四区久久| 亚洲特黄一级片| 精品一区二区三区不卡| 欧美影视一区二区三区| 国产欧美日韩视频一区二区 | 久久久无码精品亚洲日韩按摩| 亚洲一区二区三区自拍| 成人av午夜电影| 精品久久一区二区三区| 亚洲国产精品一区二区久久恐怖片| 成人免费高清视频| 久久综合资源网| 蜜臀久久99精品久久久久宅男| 欧美性色黄大片手机版| 综合久久国产九一剧情麻豆| 国产suv一区二区三区88区| 日韩欧美精品在线视频| 亚洲第一激情av| 一本大道久久a久久精二百| 国产欧美精品一区二区三区四区| 免费高清不卡av| 91麻豆精品91久久久久同性| 一区二区激情视频| 91美女视频网站| 国产精品免费aⅴ片在线观看| 久久精品国产精品亚洲精品| 91精品国产高清一区二区三区蜜臀| 一区二区三区鲁丝不卡| 99久久综合狠狠综合久久| 欧美国产精品专区| 成人小视频免费观看| 久久亚洲精精品中文字幕早川悠里| 日本少妇一区二区| 欧美日本高清视频在线观看| 亚洲图片欧美色图| 欧美日韩三级视频| 亚洲国产一区二区在线播放| 欧美日韩综合色| 亚洲成a人片在线不卡一二三区| 欧美午夜一区二区| 亚洲国产精品久久不卡毛片| 在线观看亚洲一区| 亚洲综合色婷婷| 欧美日韩免费电影| 亚洲成人激情av| 91精品国产91久久综合桃花 | 久久网站最新地址| 国产在线看一区| 欧美激情资源网| av电影天堂一区二区在线| 中文字幕一区二区三区蜜月| 99精品视频一区二区三区| 自拍偷拍亚洲欧美日韩| 在线亚洲免费视频| 亚洲国产精品久久久久婷婷884 | 另类人妖一区二区av| 久久伊人中文字幕| 成人综合婷婷国产精品久久| 国产精品另类一区| 91视视频在线观看入口直接观看www| 综合自拍亚洲综合图不卡区| 在线精品视频一区二区三四| 亚洲国产精品自拍| 日韩视频国产视频| 国产激情偷乱视频一区二区三区 | 91蜜桃传媒精品久久久一区二区| 亚洲欧美视频一区| 7777精品伊人久久久大香线蕉最新版| 奇米色一区二区三区四区| 久久久噜噜噜久久中文字幕色伊伊 | 在线观看一区二区精品视频| 婷婷开心激情综合| 亚洲精品一区在线观看| 9i看片成人免费高清| 亚洲国产欧美在线人成| 欧美成人bangbros| www.久久精品| 午夜a成v人精品| 久久久一区二区三区捆绑**| 99国产精品国产精品久久| 亚洲成人av中文| 国产午夜久久久久| 91精品办公室少妇高潮对白| 男女男精品网站| 国产精品毛片高清在线完整版| 欧美亚洲一区二区在线观看| 经典三级视频一区| 亚洲欧洲国产日韩| 日韩一区二区三区视频| 成人app软件下载大全免费| 亚洲成人午夜影院| 国产区在线观看成人精品| 欧美日韩中文字幕精品| 国产福利91精品| 性感美女极品91精品| 国产亚洲制服色| 欧美高清dvd| 成人va在线观看| 毛片基地黄久久久久久天堂| 国产精品久久久久久久久久免费看| 亚洲精品一区二区三区蜜桃下载| 久久女同精品一区二区| 色综合久久天天综合网| 蜜桃传媒麻豆第一区在线观看| 亚洲手机成人高清视频| 欧美精品一区二区三区在线播放| 日本韩国欧美一区| 国产精品一二三| 日韩国产在线观看一区| 综合久久久久综合| 久久久久久久性| 欧美一区二区视频在线观看2020 | 亚洲国产成人一区二区三区| 欧美伦理电影网| 波多野结衣中文一区| 麻豆成人av在线| 亚洲一区国产视频| 综合av第一页| 欧美韩国一区二区| 日韩欧美中文一区| 欧美手机在线视频| 91在线精品一区二区三区| 国产精品一区二区你懂的| 日本在线播放一区二区三区| 亚洲激情自拍视频| 国产精品视频看| 久久看人人爽人人| 国产亚洲欧美日韩俺去了| 偷拍日韩校园综合在线| 久久免费看少妇高潮| 99视频在线精品| 丁香网亚洲国际| 韩国av一区二区| 美国十次综合导航| 日日夜夜免费精品| 亚洲成人在线网站| 一区二区三区精品在线观看| 亚洲欧洲精品一区二区精品久久久| 国产亚洲精品超碰| 精品国产一区二区三区久久久蜜月 | 欧美成人一区二区三区在线观看| 欧美性极品少妇| 在线免费观看日本一区| 91一区二区在线观看| 成人免费高清在线| 成人午夜免费av| 国产福利一区二区三区视频| 国产精品一区二区三区网站| 激情文学综合插| 精品午夜久久福利影院| 久久国产欧美日韩精品| 麻豆91在线观看| 精品写真视频在线观看| 国产一区在线看| 国产精品综合二区| 国产精品12区| 国产91精品露脸国语对白| 成人在线综合网站| 99久久国产综合精品色伊| 成人精品视频一区| 97久久人人超碰| 日本道色综合久久| 欧美体内she精高潮| 7777女厕盗摄久久久| 欧美白人最猛性xxxxx69交| 日韩欧美高清一区| 久久无码av三级| 国产精品家庭影院| 亚洲人成在线播放网站岛国| 在线不卡免费av| 亚洲摸摸操操av| 亚洲国产成人porn| 秋霞电影网一区二区| 国产麻豆精品在线| 91小视频免费观看|