/*
*******************************************************************************
* Copyright (c) 1996-97 Digi International Inc., All Rights Reserved          *
*                                                                             *
* This  software  contains  proprietary  and  confidential   information   of *
* Digi International  Inc.   By  accepting  transfer  of this copy, Recipient *
* agrees to retain this software in  confidence,  to  prevent  disclosure  to *
* others,  and  to make no  use of this software other than that for which it *
* was delivered.  This is an unpublished copyright work  Digi   International *
* Inc.    Except   as   permitted   by  federal  law,  17 USC 117, copying is *
* strictly prohibited.                                                        *
*                                                                             *
* Digi  International  Inc.  CONFIDENTIAL  -   (Digi    International    Inc. *
* Confidential  when   combined   with   the   aggregated  modules  for  this *
* product) OBJECT CODE ONLY SOURCE MATERIALS                                  *
*                                                                             *
* (C) COPYRIGHT Digi International Inc. 1996-97                               *
*                                                                             *
* All Rights Reserved                                                         *
*                                                                             *
* US   Government   Users   Restricted   Rights   -   Use,   duplication   or *
* disclosure  restricted by GSA ADP Schedule Contract with Digi International *
* Inc.                                                                        *
*                                                                             *
*******************************************************************************

// PacketListView.h : header file
//

Revision History:

   $History: PacketListView.h $
 * 
 * *****************  Version 17  *****************
 * User: Mikez        Date: 7/11/97    Time: 5:02p
 * Branched in $/Components/Windows/NT/Sync/Build/Diag
 * 
 * *****************  Version 16  *****************
 * User: Rodgerb      Date: 2/25/97    Time: 1:23p
 * Updated in $/Components/Windows/NT/Sync/rev2diag
 * 
 * *****************  Version 15  *****************
 * User: Rodgerb      Date: 1/27/97    Time: 1:18p
 * Updated in $/Components/Windows/NT/Sync/rev2diag
 * 1) documentation
 * 2) added some new params to Physical layer stats
*/

/////////////////////////////////////////////////////////////////////////////
// CPacketListView view

enum ePacketListColumn
{
	plcFrameNumber = 0,
	plcTime,
	plcSource,
	plcCircuitNumber,
	plcFrameProtocol,
	plcDescription,
	plcNumColumns = 6
};

class CPacketListView : public CListViewEx
{
protected:
	CPacketListView();           // protected constructor used by dynamic creation
	DECLARE_DYNCREATE(CPacketListView)
	
// used to help handle when the user holds
// a key down and we need to scroll through
// the list quickly, the tree control will
// not be updated
	DWORD m_Hint;

// used to prevent cyclic recursion between this view
// and other views, the OnUpdate messaging can be
// a little complex, this is neccessary should there
// be more than one of these views attached to the same
// document
	BOOL InListChange;

// is this view active
	BOOL m_bActive;

// ************************************************
// set by a protcol specific filter dialog

// bit mask if frames to display in ListCtrl
	DWORD m_FilterMask; 

// circuit number of frames to display in ListCtrl
	CDWordArray m_FilterCircuit;

// array of frames after filter is applied
	CDWordArray m_Filtered;
// ************************************************

	void GetFilterFrames();

// Attributes
public:
	CDiagDoc* GetDocument();

	int GetNumFilteredFrames() const { return (int)(m_Filtered.GetSize()); };
	DWORD GetFilteredIndex(int i) const { return m_Filtered[i]; };
	BOOL OnCaptureFilter();

public:

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CPacketListView)
	public:
	virtual void OnInitialUpdate();
	protected:
	virtual void OnDraw(CDC* pDC);      // overridden to draw this view
	virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
	virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
	virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
	//}}AFX_VIRTUAL

// Implementation
protected:
	virtual ~CPacketListView();
#ifdef _DEBUG
	virtual void AssertValid() const;
	virtual void Dump(CDumpContext& dc) const;
#endif

	// Generated message map functions
protected:
	//{{AFX_MSG(CPacketListView)
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnItemchanged(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnViewMissing();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnGetdispinfo(NMHDR* pNMHDR, LRESULT* pResult);
	//}}AFX_MSG
	afx_msg LRESULT OnCommandHelp(WPARAM wParam, LPARAM lParam);
	DECLARE_MESSAGE_MAP()
};

#ifndef _DEBUG  // debug version in DiagView.cpp
inline CDiagDoc* CPacketListView::GetDocument()
   { return (CDiagDoc*)m_pDocument; }
#endif

/////////////////////////////////////////////////////////////////////////////
