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

📄 iapconnectdemoconnectionmonitor.h

📁 symbian联网接入点的示例代码.新增,设置接入点.
💻 H
字号:
/*
* ============================================================================
*  Name     : CIAPConnectDemoConnectionMonitor from 
*			IAPConnectDemoConnectionMonitor.h
*  Part of  : Internet Access Points Example v2.0
*  Created  : 01.09.2006 by Forum Nokia
*  Version  : 2.0
*  Copyright: Forum Nokia
* ============================================================================
*/

#ifndef IAPCONNECTCONNECTIONMONITOR_H
#define IAPCONNECTCONNECTIONMONITOR_H

// INCLUDE FILES
#include <in_sock.h>
#include <rconnmon.h> 
#include <cdbpreftable.h> //connection db info

// FORWARD DECLARATIONS
class RConnection;
class RSocket;
class CIAPConnectDemoSettings;
class RHTTPSession;
class RConnectionMonitor;
class CIAPConnectDemoConnectionMonitor;

enum TMonitorState
{
EStopped,
EConnectionCount,
EIapName,
EStartTime,
EDownlinkData,
EUplinkData,
EConnectionTime,
EActiveConnection
};

const TInt KMaxAttributeLength = 100;

// CLASS DECLARATION

/**
* A mixin class for observing connection information.
*
*/
class MIAPConnectDemoConnectionMonitorObserver
	{
	public:
		/**
		* Called when information about connection needs to be shown.
		* @param aText text that needs to be shown.
		*/
		virtual void ShowInfoL( const TDesC& aText ) = 0;
	};


// CLASS DECLARATION

/**
* A class for connetion data.
*/
class TConnectionElement
{
	public:
	TUint iConnectionId;
	TUint iSubConnectionId;
};


// CLASS DECLARATION

/**
* A class for querying information about connections.
*
*/
class CIAPConnectDemoConnectionMonitor: public CActive
	{
public: // Constructors and destructor

	/**
	* Two-phased constructor.
	*/
	static CIAPConnectDemoConnectionMonitor* NewL(
        MIAPConnectDemoConnectionMonitorObserver& aObserver);
	
	/**
	* Two-phased constructor.
	*/
	static CIAPConnectDemoConnectionMonitor* NewLC(
        MIAPConnectDemoConnectionMonitorObserver& aObserver);
	
	/**
	* Destructor
	*/
	~CIAPConnectDemoConnectionMonitor();
	
public: // New functions
	
	/**
	* Will fetch all active connections.
	*/
	void GetActiveConnections();
	
	/**
	* Closes a connection.
	* @param aIndex index of the connection that is to be closed.
	* @return ETrue if successful, EFalse if not.
	*/
	TBool CloseConnection(const TInt& aIndex );
	
	/**
	* Gets information about a connection
	* @param aIndex index of the connection about which information is needed.
	* @param aInfo type of the information that is needed.
	* @return ETrue if successful, EFalse if not.
	*/
	TBool GetInfo (const TInt& aIndex, const TMonitorState& aInfo);
	
private:

	/**
	* Symbian OS default constructor
	*/
	CIAPConnectDemoConnectionMonitor(
        MIAPConnectDemoConnectionMonitorObserver& aObserver);
	void ConstructL();

private: // Functions from base classes
	
	/**
	* From CActive
	*/
	void DoCancel();

	/**
	* From CActive
	*/
	void RunL();
	
private: // Data members
	
	MIAPConnectDemoConnectionMonitorObserver& iObserver;
	
	RConnectionMonitor iMonitor;
	
	TUint iConnectionCount;
	
	TBuf<KMaxAttributeLength> iAttributeValue;
	
	TMonitorState iEngineStatus;
	
	TUint iSubconnectionIndex;
	TUint iConnectionIndex;
	
	TUint iSubconnectionId;
	TUint iConnectionId;
	
	TConnMonTimeBuf iStartTimePckg;  // Defined in rconnmon.h
	
	TUint iDataTransfer;
	
	CArrayFixSeg<TConnectionElement>* iConnections;

	};

#endif 

// End of file

⌨️ 快捷键说明

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