AnyConnect Secure Mobility Client  4.10.06090
ConnectPromptInfo.h
1 /**************************************************************************
2 * Copyright (c) 2006, Cisco Systems, All Rights Reserved
3 ***************************************************************************
4 *
5 * File: ConnectPromptInfo.h
6 * Date: 08/2006
7 *
8 ***************************************************************************
9 *
10 * Connect Prompt Info class implementation for the Client API.
11 *
12 ***************************************************************************/
13 #ifndef _CONNECTPROMPTINFO_
14 #define _CONNECTPROMPTINFO_
15 
16 #include "ConnectPromptInfoBase.h"
17 
18 class PromptEntry;
19 
20 /**
21  * This class transports credential data between the client interface
22  * and the API. The API creates PromptEntry instances for each required
23  * option or credential. These PromptEntry instances can range from an
24  * instance with group options to one containing a password prompt.
25  *
26  * The API automatically references the instance of this class and any
27  * values that have been set. When the selections or values are set,
28  * simply call the API method ClientIfc::UserSubmit to alert
29  * the API that it can process the responses and proceed with VPN
30  * establishment.
31  *
32  * The storage and management of this class are the responsibility of the API.
33  * No management is required on the part of a client program.
34  */
35 
36 
37 class VPN_VPNAPI ConnectPromptInfo : public ConnectPromptInfoBase
38 {
39 
40  public:
41 
42 
43  /**
44  * Specifies what type of data is being requested/presented to the user:
45  * Certificate - can be a single or list of certificates.
46  * Proxy - indicates being prompted for proxy credentials.
47  * Credentials - indicates being prompted for user credentials
48  * (for example, username, password).
49  */
51 
52  /**
53  * This method returns whether or not this connect prompt has been
54  * marked as canceled by the user.
55  */
56  bool isCanceled() const;
57 
58  /**
59  * Marks the canceled state of this connect prompt.
60  */
61  void setCanceled(bool bIsCanceled);
62 
63  /**
64  * This method returns whether or not this connect prompt has error occurred
65  */
66  UserResponseError getResponseError() const;
67 
68  /**
69  * Marks the error state of this connect prompt.
70  */
71  void setResponseError(UserResponseError err);
72 
73  /**
74  * This method returns the count of any available PromptEntry objects.
75  * Each PromptEntry object, typically, represents a credential whose
76  * value the client must set before calling the UserSubmit method.
77  */
78  unsigned int countPromptEntry() const;
79 
80 
81  /**
82  * Return the string if any, related to the credentials for which
83  * the user is being prompted.
84  */
85  const tstring &getMessage() const;
86 
87 
88  /**
89  * Retrieve a list of any available prompt names.
90  */
91  const std::list<tstring> &getListPromptNames(
92  std::list<tstring> &listPromptNames) const;
93 
94 
95  /**
96  * Retrieve a PromptEntry instance by name. The list of names can
97  * be obtained using getListPromptNames method.
98  *
99  * See the ::PromptType enum found in api.h for valid PromptEntry
100  * types (except for Prompt_Checkbox which is used by the Preference
101  * class).
102  */
103  PromptEntry *getPromptEntry(const tstring &promptName) const;
104 
105 
106  /**
107  * Retrieve the entire list of PromptEntry objects.
108  */
109  const std::list<PromptEntry *> &getListPromptEntry() const;
110 
111  /**
112  * If an error during authentication is detected,
113  * this method returns true.
114  */
116 
117  /**
118  * If an error during authentication is detected,
119  * this method returns the auth error code.
120  */
122 
123  /**
124  * Get the name to be used for the button used to submit user responses
125  * (For example, Connect, Submit)
126  */
127  const tstring &getSubmitButtonName() const;
128 
129 
130  /**
131  * Indicates that an enrollment Certificate Authority (CA) is
132  * available.
133  */
134  bool hasEnrollmentCA() const;
135 
136 
137  /**
138  * Set to true to indicate that we want to retrieve a
139  * certificate from the CA.
140  */
141  void setUseEnrollmentCA(bool bUseEnrollmentCA);
142 
143  /**
144  * Set the actively selected group.
145  * This method will update the value and enabled properties of the
146  * contained credential PromptEntry objects.
147  */
148  bool setTunnelGroup(const tstring &group);
149 
150  /**
151  * Indicates if this object is "Empty". This means:
152  * -The object has no entries and no enrollmentCA (and a detail message)
153  * -Has only disabled/invisible entries
154  * -Has only entries of Type Prompt_Banner or Prompt_Hidden or Prompt_Header or Prompt_CheckBox
155  * returns true if the object is "Empty" false otherwise
156  */
157  bool isEmpty() const;
158 
159  ConnectPromptInfo(tstring defaultSubmitButtonName);
160  virtual ~ConnectPromptInfo();
161 
162 };
163 
164 
165 #endif // _CONNECTPROMPTINFO_
ConnectPromptInfo::setUseEnrollmentCA
void setUseEnrollmentCA(bool bUseEnrollmentCA)
ConnectPromptInfo::isCanceled
bool isCanceled() const
ConnectPromptInfo::getAuthenticationError
int getAuthenticationError() const
ConnectPromptInfo::getConnectPromptType
ConnectPromptType getConnectPromptType() const
ConnectPromptInfo::setCanceled
void setCanceled(bool bIsCanceled)
ConnectPromptInfo::getMessage
const tstring & getMessage() const
ConnectPromptInfo::setTunnelGroup
bool setTunnelGroup(const tstring &group)
ConnectPromptInfo::hasEnrollmentCA
bool hasEnrollmentCA() const
ConnectPromptInfo::getResponseError
UserResponseError getResponseError() const
ConnectPromptInfo::getPromptEntry
PromptEntry * getPromptEntry(const tstring &promptName) const
ConnectPromptInfo::getSubmitButtonName
const tstring & getSubmitButtonName() const
ConnectPromptType
ConnectPromptType
Definition: api.h:225
ConnectPromptInfo::countPromptEntry
unsigned int countPromptEntry() const
tstring
#define tstring
Definition: api.h:35
ConnectPromptInfo::isEmpty
bool isEmpty() const
ConnectPromptInfo::getListPromptEntry
const std::list< PromptEntry * > & getListPromptEntry() const
PromptEntry
Definition: PromptEntry.h:41
ConnectPromptInfo
Definition: ConnectPromptInfo.h:38
ConnectPromptInfo::setResponseError
void setResponseError(UserResponseError err)
ConnectPromptInfoBase
Definition: ConnectPromptInfoBase.h:37
ConnectPromptInfo::getListPromptNames
const std::list< tstring > & getListPromptNames(std::list< tstring > &listPromptNames) const
ConnectPromptInfo::hasAuthenticationError
bool hasAuthenticationError() const