AnyConnect Secure Mobility Client  4.10.08029
PromptEntry.h
1 /**************************************************************************
2 * Copyright (c) 2006, Cisco Systems, All Rights Reserved
3 ***************************************************************************
4 *
5 * File: PromptEntry.h
6 * Date: 08/2006
7 *
8 ***************************************************************************
9 *
10 * Prompt Entry class implementation for the Client API.
11 *
12 ***************************************************************************/
13 
14 #ifndef _PROMPTENTRY_
15 #define _PROMPTENTRY_
16 
17 
18 #include "PromptEntryBase.h"
19 
20 /**
21  * When Authentication requires a user to enter credentials or view a banner in
22  * conjunction with their VPN activation, one or more PromptEntry objects are
23  * created. Each PromptEntry typically contains a label and value. The
24  * value can be set with a default value that the user can then change.
25  *
26  * PromptEntry instances are collected into a list and delivered in a single
27  * instance of the ConnectPromptInfo class.
28  *
29  * When the selections or values are complete (using setValue method) for all
30  * the PromptEntry instances, simply call the API method
31  * ClientIfc::UserSubmit to alert the API that it can
32  * process the responses and proceed with VPN establishment.
33  *
34  * An example of accessing individual PromptEntry and their values can be
35  * found in ClientImpl::setUserData
36  *
37  */
38 
39 
40 class VPN_VPNAPI PromptEntry : public PromptEntryBase
41 {
42  public:
43 
44  /**
45  * use this method to get the current value set in the prompt entry.
46  */
47  const tstring& getValue() const;
48 
49  /**
50  * use this method to set the user selection. If a default value is
51  * present, it's value will be used unless this method in invoked.
52  * Returns true if the value is successfully set.
53  */
54  bool setValue(const tstring& value);
55 
56 
57  /**
58  * The fixed name associated with this prompt entry.
59  * This represents a non-translated fixed entity, whereas the
60  * label is a translated entry.
61  */
62  const tstring &getPromptName() const;
63 
64 
65  /**
66  * Set/get the label associated with this prompt entry.
67  * This value is translated if a translation is available.
68  */
69  const tstring &getPromptLabel() const;
70 
71 
72  /**
73  * Return the type of prompt entry. See the enum PromptType for
74  * the possible types.
75  */
76  PromptType getPromptType() const;
77 
78  /**
79  * Get the enabled state of this prompt entry which indicates if
80  * it can be edited.
81  */
82  bool isEnabled() const;
83 
84 
85  /**
86  * Get the visible state of this prompt entry which indicates if
87  * it should be displayed.
88  */
89  bool isVisible() const;
90 
91 
92  /**
93  * If a prompt entry has a list of possible selection, (like Prompt_Combo
94  * and Prompt_Checkbox in ::PromptType enum in api.h), that list is
95  * available via this method. For example, a checkbox type prompt
96  * would return "true" and "false" as options. The values returned could for
97  * example, be displayed in a combo box selection.
98  */
99  const std::list<tstring> &getValueOptions() const;
100 
101 
102  /**
103  * Use this prompt entry for group values
104  */
105  bool isEntryGroup() const;
106 
107  /*
108  * Returns whether this prompt entry is read only (IE
109  * it does not require user input)
110  */
111  bool isReadOnly() const;
112 
113 
114  static tstring Username; /**< Identifies the PromptEntry instance
115  requesting a username.
116  See getPromptName() method and example
117  in ClientImpl::setUserData() */
118  static tstring Password; /**< Identifies PromptEntry instance
119  requesting a password.
120  See getPromptName() method and example
121  in ClientImpl::setUserData() */
122  static tstring SecondaryUsername; /**< Identifies PromptEntry instance
123  requesting secondary username. */
124  static tstring SecondaryPassword; /**< Identifies PromptEntry instance
125  requesting secondary password. */
126  static tstring GroupList; /**< Identifies PromptEntry instance
127  with group list. */
128  static tstring Banner; /**< Identifies PromptEntry instance
129  containing banner. */
130  static tstring Pin; /**< Identifies PromptEntry PIN */
131  static tstring VerifyPin; /**< Identifies PromptEntry Verify PIN */
132  static tstring NetAccess; /**< Identifies the PromptEntry displaying
133  the network access state. */
134 
135  // The following methods are used to configure the PromptEntry
136  // and do not need to be used by a client application.
137 
138 
139  PromptEntry(tstring PromptName,
140  tstring PromptLabel,
141  PromptType promptType = Prompt_Input,
142  const tstring& DefaultValue = EmptyString,
143  ApiStringMap LabelValues = EmptyLabelValues);
144 
145  ~PromptEntry();
146 
147 
148 };
149 
150 
151 #endif // _PROMPTENTRY_
static tstring NetAccess
Definition: PromptEntry.h:132
static tstring Username
Definition: PromptEntry.h:114
Definition: api.h:249
static tstring Pin
Definition: PromptEntry.h:130
#define tstring
Definition: api.h:35
Definition: PromptEntryBase.h:25
static tstring VerifyPin
Definition: PromptEntry.h:131
static tstring GroupList
Definition: PromptEntry.h:126
static tstring SecondaryUsername
Definition: PromptEntry.h:122
static tstring SecondaryPassword
Definition: PromptEntry.h:124
Definition: PromptEntry.h:40
static tstring Banner
Definition: PromptEntry.h:128
static tstring Password
Definition: PromptEntry.h:118
PromptType
Definition: api.h:249