#if !defined(AFX_ORGANIZERVIEW_H__BB2CF801_3F9A_11D3_A14F_000000000000__INCLUDED_)
#define AFX_ORGANIZERVIEW_H__BB2CF801_3F9A_11D3_A14F_000000000000__INCLUDED_

#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// NavigatorView.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CNavigatorView view
class CPSMDoc;
class CMyOleDataSource;
class CaplCategoryTreeItem;
class CaplQueryTreeItem;

#include "apl_gui.h"
#include "aplTreeItem.h"

class CNavigatorView : public CaplTreeView
{
protected:
	CNavigatorView();           // protected constructor used by dynamic creation
	DECLARE_DYNCREATE(CNavigatorView)

	CPen m_StrikeOutPen;

// Attributes
public:
	DWORD m_last_tic_count;

	HTREEITEM m_struct_item;
	HTREEITEM m_categories_item;
	HTREEITEM m_ci_item;
	HTREEITEM m_LastLeftDownTreeItem;
	HTREEITEM m_desk_item;
	HTREEITEM m_clipboard_item;
	
	CaplQueryTreeItem *m_queries_item;
	CaplCategoryTreeItem *m_cur_categ_item;

	static bool AutoCloseItem;
	static bool DblclickViewDoc; // Двойной клик открывает документ

	CTreeCtrl& aplGetTreeCtrl();

	CImageList imagelist;
	
	CaplTreeItem *m_cur_item;
protected:
	COleDropTarget m_dropTarget;
	CTreeCtrl& GetTreeCtrl( );
	

// Operations
public:
//	CPSMDoc* m_doc;

// Overrides
	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CNavigatorView)
	public:
	virtual void OnInitialUpdate();
	virtual void OnDragLeave();
	virtual DROPEFFECT OnDragEnter(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point);
	virtual DROPEFFECT OnDragOver(COleDataObject* pDataObject, DWORD dwKeyState, CPoint point);
	virtual BOOL OnDrop(COleDataObject* pDataObject, DROPEFFECT dropEffect, CPoint point);
	virtual BOOL OnScroll(UINT nScrollCode, UINT nPos, BOOL bDoScroll = TRUE);
	protected:
	virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
	//}}AFX_VIRTUAL

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

	// Generated message map functions
protected:
	bool OnPaste(COleDataObject &pDataObject, CPoint *point=0);
	CMyOleDataSource* PrepareCOleDataSource(HTREEITEM item);
	//{{AFX_MSG(CNavigatorView)
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnRButtonDblClk(UINT nFlags, CPoint point);
	afx_msg void OnRButtonUp(UINT nFlags, CPoint point);
	afx_msg void OnBeginlabeledit(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnEndlabeledit(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnItemexpanding(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnSelchanging(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point);
	afx_msg void OnBegindrag(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnRealCreateProduct();
	afx_msg void OnContextMenu(CWnd* pWnd, CPoint point);
	afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
	//}}AFX_MSG

public:
	void OnCopy();
	void OnPaste();
	void RunToolCmd(long cmd);
	BOOL CNavigatorView::ShowToolBarButton(CCmdUI* pCmdUI);
	void ShowProperties();

	DECLARE_MESSAGE_MAP()
};


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

//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_ORGANIZERVIEW_H__BB2CF801_3F9A_11D3_A14F_000000000000__INCLUDED_)
