www.pudn.com > warsrc.rar > DaemonFileBrowser.h
// DaemonFileBrowser.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDaemonFileBrowser dialog
class DLL_WAR_CLIENT_ CFileProperties
{
public:
CString m_Name;
CString m_Comment;
DWORD m_Flags;
__int64 m_Size;
__int64 m_Date;
USER m_Owner;
USER m_Class;
CFileProperties();
~CFileProperties();
};
class DLL_WAR_CLIENT_ CDaemonFileBrowser : public CDialog
{
// Construction
public:
CDaemonFileBrowser(CWnd* pParent = NULL); // standard constructor
~CDaemonFileBrowser();
BOOL RemoteReq(LPCSTR Command, CString& cSvrReply);
BOOL ListDir(LPCSTR Path, CLinkedList& List);
int BldTree(HTREEITEM pFather);
void AddFilesToTree(HTREEITEM pFather, CLinkedList& List, BOOL SuspendDelete = FALSE);
BOOL SetAccessState(HTREEITEM hNode, CFileProperties *pInfo);
static int GetImageIndex(BOOL IsRoot, CFileProperties *pInfo, BOOL Selected = FALSE);
CFileProperties *GetCurrentDir();
static int CALLBACK LocalViewListCmp(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
void SortItems(int iMode);
BOOL DoChangeDirs();
void SetListMode(int Mode);
BOOL GetPath(HTREEITEM Current, CString& cPath);
BOOL GetFlags(CFileProperties *pInfo, CString& cFlags);
void AddSelection(CWnd *pWin, CFileProperties *pInfo);
void RemoveSelection(CFileProperties *pInfo);
void UpdateSelections();
int SetSelectionFlag(int DlgId, DWORD Flag);
BOOL chmod(LPCSTR Path, int SetMode, int SetOwner,
int SetClass, LPCSTR SetComment, int DefDirMode,
int DefFileMode);
void UpdatePath();
void UpdatePermissions();
BOOL HasExecAccess(CFileProperties *pInfo);
void DoUpdateTreePermissions(HTREEITEM Current, BOOL HasAccess);
void DoUpdateSelections();
void DoUpdatePermissions();
void Schedule(DWORD Flags);
static BOOL RunDialog(CRemoteInterface *pRI);
#ifdef DLL_WAR_CLIENT_EXPORT
// Dialog Data
//{{AFX_DATA(CDaemonFileBrowser)
enum { IDD = IDD_FILE_BROWSER };
CButton m_ctlTakeOwnershipClass;
CButton m_ctlTakeOwnershipOwner;
CStatic m_ctlsClass;
CStatic m_ctlsOwner;
CButton m_ctlEditComment;
CEdit m_ctlComment;
CComboBox m_ctlUser;
CComboBox m_ctlClass;
CButton m_ctlCancel;
CButton m_ctlOK;
CEdit m_ctlPath;
CListCtrl m_List;
CTreeCtrl m_Tree;
CString m_Path;
//}}AFX_DATA
#else
CButton m_ctlTakeOwnershipClass;
CButton m_ctlTakeOwnershipOwner;
CStatic m_ctlsClass;
CStatic m_ctlsOwner;
CButton m_ctlEditComment;
CEdit m_ctlComment;
CComboBox m_ctlUser;
CComboBox m_ctlClass;
CButton m_ctlCancel;
CButton m_ctlOK;
CEdit m_ctlPath;
CListCtrl m_List;
CTreeCtrl m_Tree;
CString m_Path;
#endif
CImageList *m_ImgLarge, *m_ImgSmall;
CRemoteUsr *m_pUserInfo;
CRemoteInterface *m_Remote;
USER m_Class, m_User; // Current selections
int m_LocalSortMode;
int m_LocalListMode;
CLinkedList m_Selections;
CWnd *m_pSelWin;
DWORD m_Flags;
int m_TimerID;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDaemonFileBrowser)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDaemonFileBrowser)
afx_msg void OnAx();
afx_msg void OnAf();
afx_msg void OnAh();
afx_msg void OnAr();
afx_msg void OnAw();
afx_msg void OnCx();
afx_msg void OnCf();
afx_msg void OnCh();
afx_msg void OnCr();
afx_msg void OnOx();
afx_msg void OnOf();
afx_msg void OnOh();
afx_msg void OnOr();
afx_msg void OnOw();
virtual BOOL OnInitDialog();
virtual void OnOK();
afx_msg void OnSelchangeClass();
afx_msg void OnSelchangeUser();
afx_msg void OnEditComment();
afx_msg void OnRclickDirs(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnSetfocusDirs(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnSelchangedDirs(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnItemexpandingDirs(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDblclkFiles(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnRclickFiles(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnViewSortAscending();
afx_msg void OnViewSortBydate();
afx_msg void OnViewSortByname();
afx_msg void OnViewSortBysize();
afx_msg void OnViewSortBytype();
afx_msg void OnViewSortDescending();
afx_msg void OnDeleteitemDirs(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnMenuModeLargeicons();
afx_msg void OnMenuModeList();
afx_msg void OnMenuModeSmallicons();
afx_msg void OnMenuModeWide();
afx_msg void OnSize(UINT nType, int cx, int cy);
virtual void OnCancel();
afx_msg void OnDeleteitemFiles(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnItemchangedFiles(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnKillfocusFiles(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnCw();
afx_msg void OnSetfocusFiles(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnDropdownClass();
afx_msg void OnDropdownUser();
afx_msg void OnTakeOOwner();
afx_msg void OnTakeOClass();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
enum // Bitmaps
{
BIM_BACK,
BIM_SYSTEM,
BIM_FILE,
BIM_FOLDER,
BIM_SELECTED_FOLDER,
BIM_DRIVE,
BIM_DENIED,
BIM_LINK,
BIM_SHARE,
BIM_INVALID
};
enum // Overlay images
{
BOI_DENIED = 1,
BOI_LINK,
BOI_FREE, // Share
BOI_INVALID
};
// Flags
#define DO_UPD_PERMS 0x0001
#define DO_UPD_SEL 0x0002
#define TIMER_ACTIVE 0x0004