// SKOKOView.h : interface of the CSKOKOView class
//
/////////////////////////////////////////////////////////////////////////////

#if !defined(AFX_SKOKOVIEW_H__1A424BB4_0651_4BF3_828E_2BAAD4BB7747__INCLUDED_)
#define AFX_SKOKOVIEW_H__1A424BB4_0651_4BF3_828E_2BAAD4BB7747__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include <vector>
class CSKOKODoc;
class CFileAttrUpdate;

class CSKOKOView : public CListView
{
protected: // create from serialization only
  CSKOKOView();
  DECLARE_DYNCREATE(CSKOKOView)

// Attributes
public:
  CSKOKODoc* GetDocument();

// Operations
public:

// Overrides
  // ClassWizard generated virtual function overrides
  //{{AFX_VIRTUAL(CSKOKOView)
  public:
  virtual void OnDraw(CDC* pDC);  // overridden to draw this view
  virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  protected:
  virtual void OnInitialUpdate(); // called first time after construct
  virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
  //}}AFX_VIRTUAL

// Implementation
public:
	UINT GetSelectedFileCount( void );
	void UpdateSelectedFiles( CFileAttrUpdate* pUpdate );
	void UpdateAllFiles( CFileAttrUpdate* pUpdate );
  virtual ~CSKOKOView();
#ifdef _DEBUG
  virtual void AssertValid() const;
  virtual void Dump(CDumpContext& dc) const;
#endif

protected:

// Generated message map functions
protected:
  //{{AFX_MSG(CSKOKOView)
  afx_msg void OnColumnClick(NMHDR* pNMHDR, LRESULT* pResult);
  afx_msg void OnGetdispInfo(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnClick(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
	afx_msg void OnUpdateOperationCalculateSize(CCmdUI* pCmdUI);
	afx_msg void OnOperationCalculateSize();
	//}}AFX_MSG
  DECLARE_MESSAGE_MAP()
private:
	bool UpdateFile( CFileInfo* pFileInfo, CFileAttrUpdate* pUpdate );
  void CleanListCtrl( void );
  void RefreshListCtrl( void );
  void UpdateCountIndicator( void );
  void UpdateSizeIndicator( void );
  int m_sortColumn;
  std::vector<int> m_sortOrder;
  void Init( void );
  static int CALLBACK CompareFunc(
    LPARAM lParam1,
    LPARAM lParam2, 
    LPARAM lParamSort);

  BOOL m_firstUpdate;
  size_t m_totalSize;
  BGDNet::Context m_ctx;
};

#ifndef _DEBUG  // debug version in SKOKOView.cpp
inline CSKOKODoc* CSKOKOView::GetDocument()
   { return (CSKOKODoc*)m_pDocument; }
#endif

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

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SKOKOVIEW_H__1A424BB4_0651_4BF3_828E_2BAAD4BB7747__INCLUDED_)
