2001-12-18 20:56:45 +03:00
|
|
|
// PrefEditView.h : interface of the CPrefEditView class
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#if !defined(AFX_PREFEDITVIEW_H__6ACBEE69_AA14_43BA_B736_DF17EA66A7CE__INCLUDED_)
|
|
|
|
#define AFX_PREFEDITVIEW_H__6ACBEE69_AA14_43BA_B736_DF17EA66A7CE__INCLUDED_
|
|
|
|
|
|
|
|
#if _MSC_VER > 1000
|
|
|
|
#pragma once
|
|
|
|
#endif // _MSC_VER > 1000
|
|
|
|
|
|
|
|
|
|
|
|
#include <afxcview.h>
|
2001-12-29 00:17:11 +03:00
|
|
|
#include "xmlparse.h"
|
2001-12-18 20:56:45 +03:00
|
|
|
|
2001-12-29 00:17:11 +03:00
|
|
|
class CPrefElement;
|
2001-12-18 20:56:45 +03:00
|
|
|
|
|
|
|
class CPrefEditView : public CTreeView
|
|
|
|
{
|
|
|
|
protected:
|
|
|
|
CPrefEditView();
|
|
|
|
|
|
|
|
// Attributes
|
|
|
|
public:
|
|
|
|
|
|
|
|
CPrefEditView(CString strXMLFile);
|
|
|
|
DECLARE_DYNCREATE(CPrefEditView)
|
|
|
|
|
|
|
|
// Operations
|
|
|
|
public:
|
|
|
|
|
|
|
|
BOOL DoSavePrefsTree(CString strFileName); // save the XML to a file
|
|
|
|
void DoOpenItem(); // expand the tree, or open the selected item for edit
|
|
|
|
void DoFindFirst(); // open the Find Pref dialog
|
|
|
|
void DoFindNext(); // find next item
|
|
|
|
void DoAdd(); // open the Add Pref dialog
|
2002-07-24 07:04:12 +04:00
|
|
|
BOOL CheckForRemoteAdmins(); // see if any prefs were marked remote admin
|
2001-12-18 20:56:45 +03:00
|
|
|
|
2001-12-29 00:17:11 +03:00
|
|
|
// These are only for the XML parser to call.
|
|
|
|
void startElement(const char *name, const char **atts);
|
|
|
|
void characterData(const XML_Char *s, int len);
|
|
|
|
void endElement(const char *name);
|
|
|
|
|
2001-12-18 20:56:45 +03:00
|
|
|
|
|
|
|
// Overrides
|
|
|
|
// ClassWizard generated virtual function overrides
|
|
|
|
//{{AFX_VIRTUAL(CPrefEditView)
|
|
|
|
public:
|
|
|
|
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
|
|
|
|
//}}AFX_VIRTUAL
|
|
|
|
|
|
|
|
// Implementation
|
|
|
|
public:
|
|
|
|
virtual ~CPrefEditView();
|
|
|
|
#ifdef _DEBUG
|
|
|
|
virtual void AssertValid() const;
|
|
|
|
virtual void Dump(CDumpContext& dc) const;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
// Generated message map functions
|
|
|
|
protected:
|
|
|
|
//{{AFX_MSG(CPrefEditView)
|
|
|
|
afx_msg void OnDblclk(NMHDR* pNMHDR, LRESULT* pResult);
|
|
|
|
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
|
|
|
|
afx_msg void OnDestroy();
|
|
|
|
afx_msg void OnEditPrefItem();
|
|
|
|
afx_msg void OnFindPref();
|
|
|
|
afx_msg void OnFindNextPref();
|
|
|
|
afx_msg void OnAddPref();
|
2002-01-28 22:09:00 +03:00
|
|
|
afx_msg void OnDelPref();
|
2001-12-18 20:56:45 +03:00
|
|
|
afx_msg void OnRclick(NMHDR* pNMHDR, LRESULT* pResult);
|
|
|
|
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
|
2002-07-24 07:04:12 +04:00
|
|
|
afx_msg void OnExpanded(NMHDR* pNMHDR, LRESULT* pResult);
|
2001-12-18 20:56:45 +03:00
|
|
|
|
|
|
|
//}}AFX_MSG
|
|
|
|
DECLARE_MESSAGE_MAP()
|
|
|
|
|
|
|
|
private:
|
|
|
|
CImageList m_imageList; // padlocks to show which prefs are locked
|
|
|
|
CString m_strXMLFile; // the XML file used to load the m_pPrefXMLTree, and hence the tree control
|
2002-05-21 06:22:23 +04:00
|
|
|
CString m_strXMLVersion; // the client version for the XML file
|
|
|
|
CString m_strXMLSubVersion; // minor version inside the XML file
|
2001-12-18 20:56:45 +03:00
|
|
|
|
|
|
|
// Stuff for Find and FindNext.
|
2001-12-29 00:17:11 +03:00
|
|
|
HTREEITEM m_hNextFind;
|
2001-12-18 20:56:45 +03:00
|
|
|
CString m_strFind;
|
|
|
|
BOOL FindFirst(CString& rstrFind);
|
|
|
|
BOOL FindNext();
|
2001-12-29 00:17:11 +03:00
|
|
|
HTREEITEM GetNextItem(HTREEITEM hItem);
|
2001-12-18 20:56:45 +03:00
|
|
|
|
2001-12-29 00:17:11 +03:00
|
|
|
// Stuff for building the tree control from the XML file.
|
|
|
|
HTREEITEM m_hgroup;
|
|
|
|
CPrefElement* m_pParsingPrefElement;
|
2001-12-18 20:56:45 +03:00
|
|
|
|
2001-12-29 00:17:11 +03:00
|
|
|
HTREEITEM FindTreeItemFromPrefname(HTREEITEM hItem, CString& rstrPrefName);
|
|
|
|
HTREEITEM InsertPrefElement(CPrefElement* pe, HTREEITEM group);
|
2001-12-18 20:56:45 +03:00
|
|
|
HTREEITEM AddPref(CString& rstrPrefName, CString& rstrPrefDesc, CString& rstrPrefType);
|
2002-07-23 21:26:22 +04:00
|
|
|
bool IsRemoteAdministered(HTREEITEM hItem);
|
2001-12-18 20:56:45 +03:00
|
|
|
|
2001-12-29 00:17:11 +03:00
|
|
|
BOOL LoadTreeControl();
|
|
|
|
void WriteXMLItem(FILE* fp, int iLevel, HTREEITEM hItem);
|
|
|
|
|
|
|
|
void DeleteTreeCtrl(HTREEITEM hParent);
|
2001-12-18 20:56:45 +03:00
|
|
|
void EditSelectedPrefsItem();
|
|
|
|
|
2001-12-29 00:17:11 +03:00
|
|
|
void ShowPopupMenu( CPoint& point, int submenu );
|
|
|
|
|
2001-12-18 20:56:45 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
//{{AFX_INSERT_LOCATION}}
|
|
|
|
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
|
|
|
|
|
|
|
|
#endif // !defined(AFX_PREFEDITVIEW_H__6ACBEE69_AA14_43BA_B736_DF17EA66A7CE__INCLUDED_)
|