AnyConnect Secure Mobility Client 4.10.00093

examples/GUI/GUIClientImpl.h

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 #ifndef _GUICLIENTIMPL_
00009 #define _GUICLIENTIMPL_
00010 
00011 #include "ClientIfc.h"
00012 
00013 enum RequestType { REQ_CONNECT, REQ_GROUPLIST, REQ_END };
00014 
00015 class MainDialog;
00016 
00017 /**
00018  * This is an example application demonstrating the implementation of the
00019  * AnyConnect API
00020  */
00021 
00022 class GUIClientImpl : public ClientIfc
00023 {
00024     public:
00025 
00026         GUIClientImpl( MainDialog *parent );
00027         virtual ~GUIClientImpl();
00028 
00029         bool connect(tstring host);
00030         
00031         tstring ms_user,
00032                 ms_pswd,
00033                 ms_group;
00034 
00035         void setUserData(ConnectPromptInfo &ConnectPrompt);
00036 
00037     protected:
00038 
00039         ConnectPromptInfo *m_pConnectPrompt;
00040         MainDialog *parentWindow;
00041 
00042         void StatsCB(IN VPNStats &stats);
00043 
00044         void StateCB(IN const VPNState state,
00045                      IN const VPNSubState subState,
00046                      IN const tstring stateString);
00047 
00048         void BannerCB(IN const tstring &banner);
00049 
00050         void NoticeCB(IN const tstring &notice,
00051                       IN const MessageType type,
00052                       IN const bool bSensitive = false);
00053 
00054         void ExitNoticeCB(IN const tstring &notice, const int returnCode);
00055 
00056         void ServiceReadyCB();
00057 
00058         void UserPromptCB(IN ConnectPromptInfo &ConnectPrompt);
00059 
00060         void CertBlockedCB(IN const tstring &rtstrUntrustedServer);
00061         void CertWarningCB(IN const tstring &rtstrUntrustedServer,
00062                            IN const std::list<tstring> &rltstrCertErrors,
00063                            IN bool bAllowImport);
00064 
00065         /**
00066          * The implementation of this method and subsequent call on
00067          * MainDialog::HandleEventAvailable demonstrates the posting of
00068          * an event.
00069          */
00070         void EventAvailable();
00071 
00072             
00073      private:
00074 
00075         RequestType me_RequestType;
00076 
00077 };
00078 
00079 
00080 #endif // _GUICLIENTIMPL_