// apllTreeCharacteristicItem.h

#include "aplTreeItem.h"

class CaplCharacteristicTreeItem : public CaplTreeItem
{
        //Attributes
public:
	CaplInstance *m_val;
	CaplInstance *m_rev;
	CaplInstance *m_bp_rev;
	aplExtent m_all_items;
	CaplInstance *m_pLockInfo;
	CaplCharacteristicTreeItem *m_parent_value_item;
	bool m_has_version;

static bool m_ShowValue;
static bool m_ShowUnit;
static int m_ShowID_or_Name;

protected:

public:
    CaplCharacteristicTreeItem(CTreeCtrl *tree=0, CPSMDoc *doc=0,
		CaplInstance *val=0);
	~CaplCharacteristicTreeItem(){RemoveFromParenContents(m_val);}
    bool GetName(CString &name);
    bool RefreshItem();
	void ShowCmd(long cmd);
	//void ShowToolBarButton(CToolBarCtrl *tb);
	BOOL ShowToolBarButton(CCmdUI* pCmdUI);
    bool TrackPopupMenu(CWnd *wnd, CPoint &point, UINT view_mode= APLICM_NORMALE);
    bool CreateTreeItem(HTREEITEM parent_item);
    //bool Expand(UINT action);
	void GetAccessedInstances(aplExtent &ext);
	void GetMainInstances(aplExtent &ext);
    
	bool ShowInListCtrl(CListCtrl *list);
	void ShowProperties();
	void CreateCharacteristic(CaplInstance *val=0);
	void CreateCharacteristicGroup(CaplInstance *group=0);

	bool PasteItem(CaplTreeItem *item, CPoint *point);
	bool Expand(UINT action);
	void ShowAllVersion(bool showMsg = true);
	void InsertRevisionInTree(aplExtent &ext_rev,CaplCharacteristicTreeItem *parent_value_item);
	void CheckOut();
	void CheckIn();
	void UndoCheckOut();
	void HideAllVersion();

	bool ExpandRefItems();
};

