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

📄 btserviceslistview.h

📁 蓝牙通迅服务,挺有用的东东,希望对大家有所帮助
💻 H
字号:
// BtServicesListView.h
//
// Copyright (c) 2003 Symbian Ltd.	All rights reserved.
//

#ifndef BTSERVICESLISTVIEW_H_
#define BTSERVICESLISTVIEW_H_

#include <coecntrl.h>
#include <coeview.h>
#include <eiktxlbx.h>
#include <eikdialg.h>
#include <qbtselectdlg.h>

const TInt KMaxDescriptorLength = 256;
const TInt KMaxUUIDTextBufferLength = 10;
const TInt KCancelMsgDuration = 3000000;
const TInt KErrorMsgDuration = 6000000;
const TInt KMaxDialogDescriptorLength = 32;

class CBtServicesEng;
class CEikCommandButton;
class CTextListBoxModel;
class CEikAppUi;

/**
This is the main View for the application, displaying
the list of services for a given devices. This class is
responsible for drawing this view, handling button
commands and selection of list items, and
displaying dialogs.
*/
class CBtServicesListView : public CCoeControl, public MCoeView, public MCoeControlObserver, public MEikListBoxObserver
	{
public:
	static CBtServicesListView* NewL(CBtServicesEng& aEngine);
	~CBtServicesListView();
	CEikTextListBox& ListBox() const;
	CEikonEnv* GetEikonEnv() const;
	void DimCancelButton(TBool aDimmed);
	void DimRefreshButton(TBool aDimmed);
	TBool RefreshButtonDimmed() const;
	void SetUUIDTextL(const TDesC& aBuf);
	void ConvertMenuChoiceToButtonL(TInt aButton);
	void DisplayDeviceInfoDialogL(const TBTDeviceName& aName, const TBTDevAddr& aAddress,const TBTDeviceClass& aClass);
	void DisplayAttributeDialogL(CDesCArrayFlat* aArray, const TDesC& aDeviceName, const TDesC& aServiceName);
	TBool DisplayUUIDSettingsDialogL(TUint32& aUUIDFilter);
private:
	CBtServicesListView(CBtServicesEng& aEngine);
	void ConstructL();
	void SelectDeviceL();

	// defined in CCoeControl
	void Draw(const TRect&) const;
	TInt CountComponentControls() const;
	CCoeControl* ComponentControl(TInt aIndex) const;

	// defined in MEikListBoxObserver
	void HandleListBoxEventL(CEikListBox* aListBox,TListBoxEvent aEventType);

	// defined in MCoeView
	TVwsViewId ViewId() const;
	void ViewActivatedL(const TVwsViewId& aPrevViewId,TUid aCustomMessageId,const TDesC8& aCustomMessage);
	void ViewDeactivated();

	// defined in MCoeControlObserver
	void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
private:
	enum
		{
		EMyListBox,
		EMySelectButton,
		EMyCancelButton,
		EMyDeviceLabel,
		EMyRefreshButton,
		EMyUUIDLabel,
		EMyControlCount
		};
	// View controls
	CEikLabel* iDeviceLabel;
	CEikLabel* iUUIDLabel;
	CEikTextListBox* iListBox;
	CEikCommandButton* iSelectButton;
	CEikCommandButton* iCancelButton;
	CEikCommandButton* iRefreshButton;

	CBtServicesEng& iEngine;
	};

/**
Dialog class for the Attribute dialog, which lists
the attributes for a given bluetooth service.
Responsible for displaying controls.
*/
class CAttributeDisplayDialog : public CEikDialog
	{
public:
	CAttributeDisplayDialog(CDesCArrayFlat* aArray, const TDesC& aDeviceName, const TDesC& aServiceName);
private:
	// defined in CEikDialog
	void PreLayoutDynInitL();
private:
	CDesCArrayFlat* iArray; // uses, does not own
	TBuf<KMaxDescriptorLength> iDeviceName;
	TBuf<KMaxDescriptorLength> iServiceName;
	};

/**
Dialog class for the UUID Settings dialog, which
allows the user to select which UUIDs to search
for. Responsible for displaying controls and
validating user input.
*/
class CUUIDSettingsDialog : public CEikDialog
	{
public:
	CUUIDSettingsDialog(TUint32& aUUIDFilter);
	// defined in CEikDialog
	TBool OkToExitL(TInt aButtonID);
private:
	// defined in CEikDialog
	void PreLayoutDynInitL();
	void HandleControlEventL(CCoeControl* aControl,TCoeEvent aEventType);
private:
	TUint32& iUUIDFilter;
	};

/**
Dialog class for the Device Info dialog, which displays
device name, address and class details. Responsible for
displaying controls.
*/
class CDeviceInfoDialog : public CEikDialog
	{
public:
	CDeviceInfoDialog(const TBTDeviceName& aName, const TBTDevAddr& aAddress, const TBTDeviceClass& aClass);
private:
	// defined in CEikDialog
	void PreLayoutDynInitL();
private:
	TBTDeviceName iDeviceName;
	TBTDevAddr iDeviceAddress;
	TBTDeviceClass iDeviceClass;
	};

#endif

⌨️ 快捷键说明

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