AnyConnect Secure Mobility Client  3.1.07021
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 tstring stateString);
00046 
00047         void BannerCB(IN const tstring &banner);
00048 
00049         void NoticeCB(IN const tstring notice,
00050                                IN const MessageType type);
00051 
00052         void ExitNoticeCB(IN const tstring &notice, const int returnCode);
00053 
00054         void ServiceReadyCB();
00055 
00056         void UserPromptCB(IN ConnectPromptInfo &ConnectPrompt);
00057 
00058         void CertBlockedCB(IN const tstring &rtstrUntrustedServer);
00059         void CertWarningCB(IN const tstring &rtstrUntrustedServer,
00060                            IN const std::list<tstring> &rltstrCertErrors,
00061                            IN bool bAllowImport);
00062 
00063         /**
00064          * The implementation of this method and subsequent call on
00065          * MainDialog::HandleEventAvailable demonstrates the posting of
00066          * an event.
00067          */
00068         void EventAvailable();
00069 
00070             
00071      private:
00072 
00073         RequestType me_RequestType;
00074 
00075 };
00076 
00077 
00078 #endif // _GUICLIENTIMPL_