Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

129 lines
3.3 KiB

  1. // KRDoc.h : interface of the CKeyRingDoc class
  2. //
  3. /////////////////////////////////////////////////////////////////////////////
  4. #include "addons.h"
  5. enum {
  6. HINT_None = 0,
  7. HINT_ChangeSelection
  8. };
  9. class CKeyRingDoc : public CDocument
  10. {
  11. protected: // create from serialization only
  12. CKeyRingDoc();
  13. DECLARE_DYNCREATE(CKeyRingDoc)
  14. // Attributes
  15. public:
  16. // Operations
  17. public:
  18. // Overrides
  19. // ClassWizard generated virtual function overrides
  20. //{{AFX_VIRTUAL(CKeyRingDoc)
  21. public:
  22. virtual BOOL OnNewDocument();
  23. virtual void Serialize(CArchive& ar);
  24. virtual void OnCloseDocument();
  25. virtual BOOL CanCloseFrame(CFrameWnd* pFrame);
  26. //}}AFX_VIRTUAL
  27. // Implementation
  28. public:
  29. virtual ~CKeyRingDoc();
  30. #ifdef _DEBUG
  31. virtual void AssertValid() const;
  32. virtual void Dump(CDumpContext& dc) const;
  33. #endif
  34. BOOL Initialize();
  35. // test what is selected in the treeview
  36. // if the selcted item is not of the requested type (machine, key, etc...)
  37. // then it returns a NULL
  38. CTreeItem* PGetSelectedItem();
  39. CMachine* PGetSelectedMachine();
  40. CService* PGetSelectedService();
  41. CKey* PGetSelectedKey();
  42. // Access the dirty flag
  43. void SetDirty( BOOL fDirty ) {m_fDirty = fDirty;}
  44. BOOL FGetDirty() {return m_fDirty;}
  45. // key scrap stuff
  46. void SetScrapKey( CKey* pKey );
  47. CKey* PGetScrapKey( void )
  48. { return m_pScrapKey; }
  49. protected:
  50. // Generated message map functions
  51. protected:
  52. //{{AFX_MSG(CKeyRingDoc)
  53. afx_msg void OnUpdateServerConnect(CCmdUI* pCmdUI);
  54. afx_msg void OnServerConnect();
  55. afx_msg void OnUpdateEditCopy(CCmdUI* pCmdUI);
  56. afx_msg void OnEditCopy();
  57. afx_msg void OnUpdateEditCut(CCmdUI* pCmdUI);
  58. afx_msg void OnEditCut();
  59. afx_msg void OnUpdateEditPaste(CCmdUI* pCmdUI);
  60. afx_msg void OnEditPaste();
  61. afx_msg void OnUpdateProperties(CCmdUI* pCmdUI);
  62. afx_msg void OnProperties();
  63. afx_msg void OnUpdateServerCommitNow(CCmdUI* pCmdUI);
  64. afx_msg void OnServerCommitNow();
  65. afx_msg void OnUpdateKeyCreateRequest(CCmdUI* pCmdUI);
  66. afx_msg void OnKeyCreateRequest();
  67. afx_msg void OnUpdateKeyInstallCertificate(CCmdUI* pCmdUI);
  68. afx_msg void OnKeyInstallCertificate();
  69. afx_msg void OnUpdateKeySaveRequest(CCmdUI* pCmdUI);
  70. afx_msg void OnKeySaveRequest();
  71. afx_msg void OnUpdateKeyExportBackup(CCmdUI* pCmdUI);
  72. afx_msg void OnKeyExportBackup();
  73. afx_msg void OnUpdateKeyImportBackup(CCmdUI* pCmdUI);
  74. afx_msg void OnKeyImportBackup();
  75. afx_msg void OnUpdateKeyImportKeyset(CCmdUI* pCmdUI);
  76. afx_msg void OnKeyImportKeyset();
  77. afx_msg void OnKeyDelete();
  78. afx_msg void OnUpdateKeyDelete(CCmdUI* pCmdUI);
  79. afx_msg void OnNewCreateNew();
  80. afx_msg void OnUpdateNewCreateNew(CCmdUI* pCmdUI);
  81. afx_msg void OnHelptopics();
  82. //}}AFX_MSG
  83. DECLARE_MESSAGE_MAP()
  84. // manage connections to machines
  85. void ConnectToMachine( CString &sz );
  86. void StoreConnectedMachines( void );
  87. void RestoreConnectedMachines( void );
  88. private:
  89. // manage the add-on services
  90. BOOL FInitAddOnServices();
  91. BOOL FLoadAddOnServicesOntoMachine( CMachine* pMachine );
  92. void DeleteAddOnServices();
  93. // online key support utilities
  94. void DoKeyRenewal( CKey* pKey );
  95. void GetOnlineKeyApproval( CKey* pKey );
  96. // commit
  97. void DoCommitNow();
  98. // the service array
  99. CTypedPtrArray<CObArray, CAddOnService*> m_AddOnServiceArray;
  100. // a dirty flag
  101. BOOL m_fDirty;
  102. // the scrap key
  103. CKey* m_pScrapKey;
  104. };
  105. /////////////////////////////////////////////////////////////////////////////