AnyConnect Secure Mobility Client
4.0.00061
|
00001 /******************************************************************************\ 00002 * This sample is supplied as is with no implied warranty. 00003 * It is designed to assist you in using the Cisco AnyConnect VPN API. 00004 * It is assumed that you will build a production application and 00005 * refer to this sample as a reference only. 00006 \*****************************************************************************/ 00007 00008 // MainDialog.h : header file 00009 // 00010 00011 #pragma once 00012 00013 #include <map> 00014 #include <list> 00015 #include <string> 00016 #include "GUIClientImpl.h" 00017 class Gui; 00018 class PromptDialog; 00019 00020 enum CustomMessage 00021 { 00022 MF_NEWEVENT = WM_APP 00023 }; 00024 00025 /** 00026 * MainDialog dialog 00027 */ 00028 class MainDialog : public CDialog 00029 { 00030 // Construction 00031 public: 00032 MainDialog(Gui* pParent = NULL); // standard constructor 00033 00034 enum { IDD = IDD_EXAMPLE4_DIALOG }; 00035 00036 CStatusBarCtrl *m_statusBar; 00037 PromptDialog *m_promptDialog; 00038 GUIClientImpl *m_pApiImpl; 00039 ConnectPromptInfo *m_pPromptInfo; 00040 std::list<tstring> m_promptNames; 00041 00042 void HandlePromptCB(ConnectPromptInfo &connectPrompt); 00043 /** 00044 * This method demonstrates the posting of an event once the API has 00045 * indicated there is data available (see GUIClientImpl::EventAvailable). 00046 * 00047 * After the posted event fires, the method MainDialog::OnEventAvailable 00048 * is called. 00049 */ 00050 void HandleEventAvailable(); 00051 00052 void showStatusbarText (const tstring &text); 00053 00054 // Implementation 00055 protected: 00056 Gui *m_pParent; 00057 tstring m_hostName; 00058 00059 virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support 00060 virtual BOOL OnInitDialog(); 00061 afx_msg void OnSysCommand(UINT nID, LPARAM lParam); 00062 afx_msg void OnCbnSelchangeCombo1(); 00063 afx_msg void OnBnClickedOk(); 00064 afx_msg void OnBnClickedCancel(); 00065 afx_msg void OnBnClickedDisconnect(); 00066 00067 /** 00068 * This method is invoked after the posted event from the method 00069 * MainDialog::HandleEventAvailable fires. 00070 * 00071 * This method invokes the API method ClientIfc::ProcessEvents 00072 * which in turn causes all pending events (NoticeCB, 00073 * UserPromptCB, etc.) to be delivered. 00074 */ 00075 LRESULT OnEventAvailable(WPARAM wparam, LPARAM lparam); 00076 00077 DECLARE_MESSAGE_MAP() 00078 };